zioinfo-mail/app/node_modules/react-native/ReactCommon/react/renderer/scheduler/SurfaceManager.cpp
DESKTOP-TKLFCPR\ython 11c670f2a0 refactor: 101.79.17.164 → zioinfo.co.kr 전체 도메인 변환 + Manager UI 배포
- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스)
- Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포
- 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 10:09:17 +09:00

103 lines
2.8 KiB
C++

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "SurfaceManager.h"
#include <react/renderer/scheduler/Scheduler.h>
namespace facebook::react {
SurfaceManager::SurfaceManager(const Scheduler& scheduler) noexcept
: scheduler_(scheduler) {}
void SurfaceManager::startSurface(
SurfaceId surfaceId,
const std::string& moduleName,
const folly::dynamic& props,
const LayoutConstraints& layoutConstraints,
const LayoutContext& layoutContext) const noexcept {
{
std::unique_lock lock(mutex_);
auto surfaceHandler = SurfaceHandler{moduleName, surfaceId};
surfaceHandler.setContextContainer(scheduler_.getContextContainer());
registry_.emplace(surfaceId, std::move(surfaceHandler));
}
visit(surfaceId, [&](const SurfaceHandler& surfaceHandler) {
surfaceHandler.setProps(props);
surfaceHandler.constraintLayout(layoutConstraints, layoutContext);
scheduler_.registerSurface(surfaceHandler);
surfaceHandler.start();
});
}
void SurfaceManager::stopSurface(SurfaceId surfaceId) const noexcept {
visit(surfaceId, [&](const SurfaceHandler& surfaceHandler) {
surfaceHandler.stop();
scheduler_.unregisterSurface(surfaceHandler);
});
{
std::unique_lock lock(mutex_);
auto iterator = registry_.find(surfaceId);
registry_.erase(iterator);
}
}
Size SurfaceManager::measureSurface(
SurfaceId surfaceId,
const LayoutConstraints& layoutConstraints,
const LayoutContext& layoutContext) const noexcept {
auto size = Size{};
visit(surfaceId, [&](const SurfaceHandler& surfaceHandler) {
size = surfaceHandler.measure(layoutConstraints, layoutContext);
});
return size;
}
MountingCoordinator::Shared SurfaceManager::findMountingCoordinator(
SurfaceId surfaceId) const noexcept {
auto mountingCoordinator = MountingCoordinator::Shared{};
visit(surfaceId, [&](const SurfaceHandler& surfaceHandler) {
mountingCoordinator = surfaceHandler.getMountingCoordinator();
});
return mountingCoordinator;
}
void SurfaceManager::constraintSurfaceLayout(
SurfaceId surfaceId,
const LayoutConstraints& layoutConstraints,
const LayoutContext& layoutContext) const noexcept {
visit(surfaceId, [=](const SurfaceHandler& surfaceHandler) {
surfaceHandler.constraintLayout(layoutConstraints, layoutContext);
});
}
void SurfaceManager::visit(
SurfaceId surfaceId,
const std::function<void(SurfaceHandler const& surfaceHandler)>& callback)
const noexcept {
std::shared_lock lock(mutex_);
auto iterator = registry_.find(surfaceId);
if (iterator == registry_.end()) {
return;
}
callback(iterator->second);
}
} // namespace facebook::react