MCPcopy Create free account
hub / github.com/Snapchat/Valdi / registerModuleFactoriesProvider

Method registerModuleFactoriesProvider

valdi/src/valdi/runtime/RuntimeManager.cpp:274–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272 _viewManagerContexts.emplace_back(viewManagerContext);
273
274 // Seed the kill switch from the current tweaks so contexts created after the provider is set pick
275 // it up; the setTweakValueProvider loop handles contexts created before it arrives.
276 viewManagerContext->setApplyManagedChildFramePadding(
277 _runtimeTweaks != nullptr ? _runtimeTweaks->applyManagedChildFramePadding() : true);
278
279 return viewManagerContext;
280}
281
282void RuntimeManager::registerModuleFactoriesProvider(
283 const Shared<snap::valdi_core::ModuleFactoriesProvider>& moduleFactoriesProvider) {
284 auto moduleFactories = moduleFactoriesProvider->createModuleFactories(Valdi::Value(Valdi::strongSmallRef(this)));
285
286 std::vector<SharedRuntime> runtimes;
287 {
288 std::lock_guard<Mutex> guard(_mutex);
289 for (const auto& moduleFactory : moduleFactories) {
290 _registeredModuleFactories.emplace_back(moduleFactory);
291 }
292 runtimes = getAllRuntimes(guard);
293 }
294
295 // Register the ModuleFactories to the existing Runtimes
296 for (const auto& runtime : runtimes) {

Callers

nothing calls this directly

Calls 4

strongSmallRefFunction · 0.85
createModuleFactoriesMethod · 0.65
ValueClass · 0.50

Tested by

no test coverage detected