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

Method scheduleDeferredGCTask

valdi/src/valdi/runtime/RuntimeManager.cpp:606–632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

604
605 auto disableAnimationRemoveOnCompleteIos =
606 runtimeTweaks != nullptr ? runtimeTweaks->disableAnimationRemoveOnCompleteIos() : false;
607 auto applyManagedChildFramePadding =
608 runtimeTweaks != nullptr ? runtimeTweaks->applyManagedChildFramePadding() : true;
609 for (const auto& viewManagerContext : _viewManagerContexts) {
610 viewManagerContext->getViewManager().setDisableAnimationRemoveOnCompleteIos(
611 disableAnimationRemoveOnCompleteIos);
612 viewManagerContext->setApplyManagedChildFramePadding(applyManagedChildFramePadding);
613 }
614
615 for (const auto& runtime : runtimes) {
616 runtime->setRuntimeTweaks(runtimeTweaks);
617 }
618}
619
620void RuntimeManager::cancelDeferredGCTask() {
621 const auto previousTaskID = swapDeferredGCTask(DispatchQueue::TaskIDNull);
622 if (previousTaskID != DispatchQueue::TaskIDNull) {
623 _workerQueue->cancel(previousTaskID);
624 }
625}
626
627void RuntimeManager::scheduleDeferredGCTask() {
628 auto weakThis = weakRef(this);
629 const auto taskID = _workerQueue->asyncAfter(
630 [weakThis]() {
631 auto strongThis = weakThis.lock();
632 if (!strongThis) {
633 return;
634 }
635 const auto runtimes = strongThis->getAllRuntimes();

Callers

nothing calls this directly

Calls 9

weakRefFunction · 0.85
performGcMethod · 0.80
getJavaScriptRuntimeMethod · 0.80
cancelMethod · 0.65
asyncAfterMethod · 0.45
lockMethod · 0.45
getAllRuntimesMethod · 0.45
emptyMethod · 0.45
enableDeferredGCMethod · 0.45

Tested by

no test coverage detected