1 /* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FOUNDATION_ACE_FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_FRONTEND_DELEGATE_DECLARATIVE_H 17 #define FOUNDATION_ACE_FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_FRONTEND_DELEGATE_DECLARATIVE_H 18 19 #include <future> 20 #include <mutex> 21 #include <unordered_map> 22 23 #include "base/memory/ace_type.h" 24 #include "base/memory/referenced.h" 25 #include "base/thread/cancelable_callback.h" 26 #include "base/utils/measure_util.h" 27 #include "bridge/declarative_frontend/ng/page_router_manager.h" 28 #include "core/common/js_message_dispatcher.h" 29 #include "core/components_ng/pattern/overlay/overlay_manager.h" 30 #include "core/pipeline/pipeline_context.h" 31 #include "frameworks/bridge/common/accessibility/accessibility_node_manager.h" 32 #include "frameworks/bridge/common/manifest/manifest_parser.h" 33 #include "frameworks/bridge/js_frontend/engine/common/group_js_bridge.h" 34 #include "frameworks/bridge/js_frontend/engine/common/js_engine.h" 35 #include "frameworks/bridge/js_frontend/frontend_delegate.h" 36 #include "frameworks/bridge/js_frontend/frontend_delegate_impl.h" 37 #include "frameworks/bridge/js_frontend/js_ace_page.h" 38 39 namespace OHOS::Ace::Framework { 40 41 using ExternalEventCallback = std::function<void(const std::string&, const uint32_t&, const bool&)>; 42 43 enum class RouterAction { 44 PUSH = 0, 45 REPLACE, 46 BACK, 47 CLEAR, 48 }; 49 50 struct RouterTask { 51 RouterAction action = RouterAction::PUSH; 52 PageTarget target = PageTarget(""); 53 std::string params; 54 std::function<void(const std::string&, int32_t)> errorCallback; 55 }; 56 57 class FrontendDelegateDeclarative : public FrontendDelegate { 58 DECLARE_ACE_TYPE(FrontendDelegateDeclarative, FrontendDelegate); 59 60 public: 61 FrontendDelegateDeclarative(const RefPtr<TaskExecutor>& taskExecutor, const LoadJsCallback& loadCallback, 62 const JsMessageDispatcherSetterCallback& transferCallback, const EventCallback& asyncEventCallback, 63 const EventCallback& syncEventCallback, const UpdatePageCallback& updatePageCallback, 64 const ResetStagingPageCallback& resetLoadingPageCallback, const DestroyPageCallback& destroyPageCallback, 65 const DestroyApplicationCallback& destroyApplicationCallback, 66 const UpdateApplicationStateCallback& updateApplicationStateCallback, const TimerCallback& timerCallback, 67 const MediaQueryCallback& mediaQueryCallback, const LayoutInspectorCallback& layoutInpsectorCallback, 68 const DrawInspectorCallback& drawInpsectorCallback, const RequestAnimationCallback& requestAnimationCallback, 69 const JsCallback& jsCallback, const OnWindowDisplayModeChangedCallBack& onWindowDisplayModeChangedCallBack, 70 const OnConfigurationUpdatedCallBack& onConfigurationUpdatedCallBack, 71 const OnSaveAbilityStateCallBack& onSaveAbilityStateCallBack, 72 const OnRestoreAbilityStateCallBack& onRestoreAbilityStateCallBack, const OnNewWantCallBack& onNewWantCallBack, 73 const OnMemoryLevelCallBack& onMemoryLevelCallBack, 74 const OnStartContinuationCallBack& onStartContinuationCallBack, 75 const OnCompleteContinuationCallBack& onCompleteContinuationCallBack, 76 const OnRemoteTerminatedCallBack& onRemoteTerminatedCallBack, const OnSaveDataCallBack& onSaveDataCallBack, 77 const OnRestoreDataCallBack& onRestoreDataCallBack, const ExternalEventCallback& externalEventCallback); 78 ~FrontendDelegateDeclarative() override; 79 80 void AttachPipelineContext(const RefPtr<PipelineBase>& context) override; 81 void AttachSubPipelineContext(const RefPtr<PipelineBase>& context); 82 83 // JSFrontend delegate functions. 84 UIContentErrorCode RunPage( 85 const std::string& url, const std::string& params, const std::string& profile, bool isNamedRouter = false); 86 void RunPage(const std::shared_ptr<std::vector<uint8_t>>& content, 87 const std::string& params, const std::string& profile); 88 void SetJsMessageDispatcher(const RefPtr<JsMessageDispatcher>& dispatcher) const; 89 void TransferComponentResponseData(int32_t callbackId, int32_t code, std::vector<uint8_t>&& data); 90 void TransferJsResponseData(int32_t callbackId, int32_t code, std::vector<uint8_t>&& data) const; 91 #if defined(PREVIEW) 92 void TransferJsResponseDataPreview(int32_t callbackId, int32_t code, ResponseData responseData) const; 93 #endif 94 void TransferJsPluginGetError(int32_t callbackId, int32_t errorCode, std::string&& errorMessage) const; 95 void TransferJsEventData(int32_t callbackId, int32_t code, std::vector<uint8_t>&& data) const; 96 void LoadPluginJsCode(std::string&& jsCode) const; 97 void LoadPluginJsByteCode(std::vector<uint8_t>&& jsCode, std::vector<int32_t>&& jsCodeLen) const; 98 void OnJSCallback(const std::string& callbackId, const std::string& data); 99 bool OnPageBackPress(); 100 void OnBackGround(); 101 void OnForeground(); 102 void OnConfigurationUpdated(const std::string& data); 103 void OnSaveAbilityState(std::string& data); 104 void OnRestoreAbilityState(const std::string& data); 105 void OnNewWant(const std::string& data); 106 bool OnStartContinuation(); 107 void OnCompleteContinuation(int32_t code); 108 void OnMemoryLevel(int32_t level); 109 void OnSaveData(std::string& data); 110 void GetPluginsUsed(std::string& data); 111 bool OnRestoreData(const std::string& data); 112 void OnRemoteTerminated(); 113 void OnNewRequest(const std::string& data); 114 void SetColorMode(ColorMode colorMode); 115 void CallPopPage(); 116 void OnApplicationDestroy(const std::string& packageName); 117 void UpdateApplicationState(const std::string& packageName, Frontend::State state); 118 void OnWindowDisplayModeChanged(bool isShownInMultiWindow, const std::string& data); 119 void NotifyAppStorage( 120 const WeakPtr<Framework::JsEngine>& jsEngineWeak, const std::string& key, const std::string& value); 121 122 // distribute 123 std::pair<std::string, UIContentErrorCode> RestoreRouterStack(const std::string& contentInfo) override; 124 std::string GetContentInfo() override; 125 126 // Accessibility delegate functions. GetJSAccessibilityManager()127 RefPtr<Framework::AccessibilityNodeManager> GetJSAccessibilityManager() const 128 { 129 return jsAccessibilityManager_; 130 } 131 void FireAccessibilityEvent(const AccessibilityEvent& accessibilityEvent); 132 void InitializeAccessibilityCallback(); 133 134 void OnMediaQueryUpdate(bool isSynchronous = false) override; 135 void OnSurfaceChanged(); 136 void OnLayoutCompleted(const std::string& componentId); 137 void OnDrawCompleted(const std::string& componentId); 138 // JSEventHandler delegate functions. 139 void FireAsyncEvent(const std::string& eventId, const std::string& param, const std::string& jsonArgs); 140 bool FireSyncEvent(const std::string& eventId, const std::string& param, const std::string& jsonArgs); 141 void FireSyncEvent( 142 const std::string& eventId, const std::string& param, const std::string& jsonArgs, std::string& result); 143 void FireExternalEvent(const std::string& eventId, const std::string& componentId, uint32_t nodeId, bool isDestroy); 144 145 // FrontendDelegate overrides. 146 void Push(const PageTarget& target, const std::string& params, 147 const std::function<void(const std::string&, int32_t)>& errorCallback = nullptr); 148 void Replace(const PageTarget& target, const std::string& params, 149 const std::function<void(const std::string&, int32_t)>& errorCallback = nullptr); 150 void BackWithTarget(const PageTarget& target, const std::string& params); 151 152 void Push(const std::string& uri, const std::string& params) override; 153 void PushWithMode(const std::string& uri, const std::string& params, uint32_t routerMode) override; 154 void PushWithCallback(const std::string& uri, const std::string& params, 155 const std::function<void(const std::string&, int32_t)>& errorCallback, uint32_t routerMode = 0) override; 156 void PushNamedRoute(const std::string& uri, const std::string& params, 157 const std::function<void(const std::string&, int32_t)>& errorCallback, uint32_t routerMode = 0) override; 158 void Replace(const std::string& uri, const std::string& params) override; 159 void ReplaceWithMode(const std::string& uri, const std::string& params, uint32_t routerMode) override; 160 void ReplaceWithCallback(const std::string& uri, const std::string& params, 161 const std::function<void(const std::string&, int32_t)>& errorCallback, uint32_t routerMode = 0) override; 162 void ReplaceNamedRoute(const std::string& uri, const std::string& params, 163 const std::function<void(const std::string&, int32_t)>& errorCallback, uint32_t routerMode = 0) override; 164 void Back(const std::string& uri, const std::string& params) override; 165 void Clear() override; 166 int32_t GetStackSize() const override; 167 void GetState(int32_t& index, std::string& name, std::string& path) override; 168 std::string GetParams() override; 169 int32_t GetIndexByUrl(const std::string& url) override; 170 171 void PostponePageTransition() override; 172 void LaunchPageTransition() override; 173 size_t GetComponentsCount() override; 174 void TriggerPageUpdate(int32_t pageId, bool directExecute = false) override; 175 176 void PostJsTask(std::function<void()>&& task) override; 177 178 const std::string& GetAppID() const override; 179 const std::string& GetAppName() const override; 180 const std::string& GetVersionName() const override; 181 int32_t GetVersionCode() const override; GetWindowConfig()182 WindowConfig& GetWindowConfig() 183 { 184 return manifestParser_->GetWindowConfig(); 185 } 186 187 double MeasureText(const MeasureContext& context) override; 188 Size MeasureTextSize(const MeasureContext& context) override; 189 190 void ShowToast(const std::string& message, int32_t duration, const std::string& bottom, 191 const NG::ToastShowMode& showMode = NG::ToastShowMode::DEFAULT) override; 192 void SetToastStopListenerCallback(std::function<void()>&& stopCallback) override; 193 void ShowDialog(const std::string& title, const std::string& message, const std::vector<ButtonInfo>& buttons, 194 bool autoCancel, std::function<void(int32_t, int32_t)>&& callback, 195 const std::set<std::string>& callbacks) override; 196 void ShowDialog(const std::string& title, const std::string& message, const std::vector<ButtonInfo>& buttons, 197 bool autoCancel, std::function<void(int32_t, int32_t)>&& callback, 198 const std::set<std::string>& callbacks, std::function<void(bool)>&& onStatusChanged) override; 199 void ShowDialog(const PromptDialogAttr &dialogAttr, const std::vector<ButtonInfo> &buttons, 200 std::function<void(int32_t, int32_t)> &&callback, const std::set<std::string> &callbacks) override; 201 void ShowDialog(const PromptDialogAttr &dialogAttr, const std::vector<ButtonInfo> &buttons, 202 std::function<void(int32_t, int32_t)> &&callback, const std::set<std::string> &callbacks, 203 std::function<void(bool)>&& onStatusChanged) override; 204 void ShowDialogInner(DialogProperties& dialogProperties, std::function<void(int32_t, int32_t)>&& callback, 205 const std::set<std::string>& callbacks); 206 void OpenCustomDialog(const PromptDialogAttr &dialogAttr, std::function<void(int32_t)> &&callback) override; 207 void CloseCustomDialog(const int32_t dialogId) override; 208 209 void EnableAlertBeforeBackPage(const std::string& message, std::function<void(int32_t)>&& callback) override; 210 211 void DisableAlertBeforeBackPage() override; 212 213 void ShowActionMenu(const std::string& title, const std::vector<ButtonInfo>& button, 214 std::function<void(int32_t, int32_t)>&& callback) override; 215 void ShowActionMenu(const std::string& title, const std::vector<ButtonInfo>& button, 216 std::function<void(int32_t, int32_t)>&& callback, std::function<void(bool)>&& onStatusChanged) override; 217 void ShowActionMenu(const PromptDialogAttr& dialogAttr, const std::vector<ButtonInfo>& buttons, 218 std::function<void(int32_t, int32_t)>&& callback) override; 219 void ShowActionMenuInner(DialogProperties& dialogProperties, const std::vector<ButtonInfo>& button, 220 std::function<void(int32_t, int32_t)>&& callback); 221 222 Rect GetBoundingRectData(NodeId nodeId) override; 223 224 std::string GetInspector(NodeId nodeId) override; 225 226 void PushJsCallbackToRenderNode(NodeId id, double ratio, std::function<void(bool, double)>&& callback) override; 227 // For async event. 228 void SetCallBackResult(const std::string& callBackId, const std::string& result) override; 229 230 void WaitTimer(const std::string& callbackId, const std::string& delay, bool isInterval, bool isFirst) override; 231 void ClearTimer(const std::string& callbackId) override; 232 233 void PostSyncTaskToPage(std::function<void()>&& task) override; 234 void AddTaskObserver(std::function<void()>&& task) override; 235 void RemoveTaskObserver() override; 236 237 bool GetAssetContent(const std::string& url, std::string& content) override; 238 bool GetAssetContent(const std::string& url, std::vector<uint8_t>& content) override; 239 std::string GetAssetPath(const std::string& url) override; 240 241 // i18n 242 void GetI18nData(std::unique_ptr<JsonValue>& json) override; 243 244 void GetResourceConfiguration(std::unique_ptr<JsonValue>& json) override; 245 246 void GetConfigurationCommon(const std::string& filePath, std::unique_ptr<JsonValue>& data) override; 247 248 int32_t GetMinPlatformVersion() override; 249 250 void LoadResourceConfiguration(std::map<std::string, std::string>& mediaResourceFileMap, 251 std::unique_ptr<JsonValue>& currentResourceData) override; 252 253 void ChangeLocale(const std::string& language, const std::string& countryOrRegion) override; 254 255 void RegisterFont(const std::string& familyName, const std::string& familySrc, const std::string& bundleName = "", 256 const std::string& moduleName = "") override; 257 258 void GetSystemFontList(std::vector<std::string>& fontList) override; 259 260 bool GetSystemFont(const std::string& fontName, FontInfo& fontInfo) override; 261 262 void GetUIFontConfig(FontConfigJsonInfo& fontConfigJsonInfo) override; 263 264 void HandleImage(const std::string& src, std::function<void(bool, int32_t, int32_t)>&& callback) override; 265 266 void GetSnapshot(const std::string& componentId, 267 std::function<void(std::shared_ptr<Media::PixelMap>, int32_t, std::function<void()>)>&& callback) override; 268 void CreateSnapshot(std::function<void()>&& customBuilder, 269 std::function<void(std::shared_ptr<Media::PixelMap>, int32_t, std::function<void()>)>&& callback, 270 bool enableInspector) override; 271 272 void RequestAnimationFrame(const std::string& callbackId) override; 273 274 void CancelAnimationFrame(const std::string& callbackId) override; 275 276 SingleTaskExecutor GetAnimationJsTask() override; 277 278 SingleTaskExecutor GetUiTask() override; 279 GetMediaQueryInfoInstance()280 const RefPtr<MediaQueryInfo>& GetMediaQueryInfoInstance() override 281 { 282 return mediaQueryInfo_; 283 } 284 GetGroupJsBridge()285 const RefPtr<GroupJsBridge>& GetGroupJsBridge() override 286 { 287 return groupJsBridge_; 288 } 289 290 #if defined(PREVIEW) SetPagePath(const std::string & pagePath)291 void SetPagePath(const std::string& pagePath) 292 { 293 if (manifestParser_) { 294 manifestParser_->SetPagePath(pagePath); 295 } 296 } 297 #endif 298 299 RefPtr<PipelineBase> GetPipelineContext() override; 300 SetGroupJsBridge(const RefPtr<GroupJsBridge> & groupJsBridge)301 void SetGroupJsBridge(const RefPtr<GroupJsBridge>& groupJsBridge) 302 { 303 groupJsBridge_ = groupJsBridge; 304 } 305 306 RefPtr<JsAcePage> GetPage(int32_t pageId) const override; 307 308 void RebuildAllPages(); 309 310 std::string GetCurrentPageUrl(); 311 312 // Get the currently running JS page information in NG structure. 313 RefPtr<RevSourceMap> GetCurrentPageSourceMap(); 314 315 // Get the currently running JS page information in NG structure. 316 RefPtr<RevSourceMap> GetFaAppSourceMap(); 317 318 void GetStageSourceMap( 319 std::unordered_map<std::string, RefPtr<Framework::RevSourceMap>>& sourceMap); 320 321 void InitializeRouterManager( 322 NG::LoadPageCallback&& loadPageCallback, NG::LoadPageByBufferCallback&& loadPageByBufferCallback, 323 NG::LoadNamedRouterCallback&& loadNamedRouterCallback, 324 NG::UpdateRootComponentCallback&& updateRootComponentCallback); 325 326 #if defined(PREVIEW) 327 void SetIsComponentPreview(NG::IsComponentPreviewCallback&& callback); 328 #endif 329 GetPageRouterManager()330 const RefPtr<NG::PageRouterManager>& GetPageRouterManager() const 331 { 332 return pageRouterManager_; 333 } 334 GetTaskExecutor()335 const RefPtr<TaskExecutor>& GetTaskExecutor() const 336 { 337 return taskExecutor_; 338 } 339 GetManifestParser()340 const RefPtr<Framework::ManifestParser>& GetManifestParser() const 341 { 342 return manifestParser_; 343 } 344 345 protected: 346 bool isCardDelegate_ = false; 347 348 private: 349 int32_t GenerateNextPageId(); 350 void RecyclePageId(int32_t pageId); 351 352 UIContentErrorCode LoadPage( 353 int32_t pageId, const PageTarget& target, bool isMainPage, const std::string& params, bool isRestore = false); 354 void OnPageReady(const RefPtr<Framework::JsAcePage>& page, const std::string& url, bool isMainPage, bool isRestore); 355 void FlushPageCommand( 356 const RefPtr<Framework::JsAcePage>& page, const std::string& url, bool isMainPage, bool isRestore); 357 void AddPageLocked(const RefPtr<JsAcePage>& page); 358 void OnPrePageChange(const RefPtr<JsAcePage>& page); 359 void SetCurrentPage(int32_t pageId); 360 361 void OnPushPageSuccess(const RefPtr<JsAcePage>& page, const std::string& url); 362 void OnPopToPageSuccess(const std::string& url); 363 void PopToPage(const std::string& url); 364 int32_t OnPopPageSuccess(); 365 void PopPage(); 366 void RestorePopPage(const RefPtr<JsAcePage>& page, const std::string& url); 367 368 void PushPageTransitionListener(const TransitionEvent& event, const RefPtr<JsAcePage>& page); 369 370 void PopPageTransitionListener(const TransitionEvent& event, int32_t destroyPageId); 371 372 void PopToPageTransitionListener(const TransitionEvent& event, const std::string& url, int32_t pageId); 373 374 void RestorePageTransitionListener( 375 const TransitionEvent& event, const std::string& url, const RefPtr<JsAcePage>& page); 376 377 int32_t OnClearInvisiblePagesSuccess(); 378 void ClearInvisiblePages(); 379 380 void OnReplacePageSuccess(const RefPtr<JsAcePage>& page, const std::string& url); 381 void ReplacePage(const RefPtr<JsAcePage>& page, const std::string& url); 382 void LoadReplacePage(int32_t pageId, const PageTarget& url, const std::string& params); 383 384 void ReplacePageInSubStage(const RefPtr<JsAcePage>& page, const std::string& url); 385 std::optional<int32_t> GetEffectiveContainerId() const; 386 387 uint64_t GetSystemRealTime(); 388 389 // Page lifecycle 390 void OnPageShow(); 391 void OnPageHide(); 392 void OnPageDestroy(int32_t pageId); 393 394 int32_t GetRunningPageId() const; 395 std::string GetRunningPageUrl() const; 396 int32_t GetPageIdByUrl(const std::string& url, bool& isRestore); GetPageIdByUrl(const std::string & url)397 int32_t GetPageIdByUrl(const std::string& url) 398 { 399 bool tmp = false; 400 return GetPageIdByUrl(url, tmp); 401 } 402 403 void ResetStagingPage(); 404 void FlushAnimationTasks(); 405 406 void StartPush(const PageTarget& target, const std::string& params, 407 const std::function<void(const std::string&, int32_t)>& errorCallback); 408 void StartReplace(const PageTarget& target, const std::string& params, 409 const std::function<void(const std::string&, int32_t)>& errorCallback); 410 void StartBack(const PageTarget& target, const std::string& params); 411 void BackCheckAlert(const PageTarget& target, const std::string& params); 412 void ProcessRouterTask(); 413 void AddRouterTask(const RouterTask& task); 414 bool IsNavigationStage(const PageTarget& target); 415 void RecycleSinglePage(); 416 void ClearAlertCallback(PageInfo pageInfo); 417 418 std::atomic<uint64_t> pageIdPool_ = 0; 419 int32_t callbackCnt_ = 0; 420 int32_t pageId_ = -1; 421 bool isRouteStackFull_ = false; 422 bool isStagingPageExist_ = false; 423 int32_t singlePageId_ = -1; 424 std::string mainPagePath_; 425 PageTarget backUri_ = PageTarget(""); 426 std::string backParam_; 427 std::vector<PageInfo> pageRouteStack_; 428 std::unordered_map<int32_t, RefPtr<JsAcePage>> pageMap_; 429 std::unordered_map<int32_t, std::string> pageParamMap_; 430 std::unordered_map<int32_t, std::string> jsCallBackResult_; 431 432 LoadJsCallback loadJs_; 433 ExternalEventCallback externalEvent_; 434 JsMessageDispatcherSetterCallback dispatcherCallback_; 435 EventCallback asyncEvent_; 436 EventCallback syncEvent_; 437 UpdatePageCallback updatePage_; 438 ResetStagingPageCallback resetStagingPage_; 439 DestroyPageCallback destroyPage_; 440 DestroyApplicationCallback destroyApplication_; 441 UpdateApplicationStateCallback updateApplicationState_; 442 TimerCallback timer_; 443 std::unordered_map<std::string, CancelableCallback<void()>> timeoutTaskMap_; 444 MediaQueryCallback mediaQueryCallback_; 445 LayoutInspectorCallback layoutInspectorCallback_; 446 DrawInspectorCallback drawInspectorCallback_; 447 RequestAnimationCallback requestAnimationCallback_; 448 JsCallback jsCallback_; 449 OnWindowDisplayModeChangedCallBack onWindowDisplayModeChanged_; 450 OnConfigurationUpdatedCallBack onConfigurationUpdated_; 451 OnSaveAbilityStateCallBack onSaveAbilityState_; 452 OnRestoreAbilityStateCallBack onRestoreAbilityState_; 453 OnNewWantCallBack onNewWant_; 454 OnMemoryLevelCallBack onMemoryLevel_; 455 OnStartContinuationCallBack onStartContinuationCallBack_; 456 OnCompleteContinuationCallBack onCompleteContinuationCallBack_; 457 OnRemoteTerminatedCallBack onRemoteTerminatedCallBack_; 458 OnSaveDataCallBack onSaveDataCallBack_; 459 OnRestoreDataCallBack onRestoreDataCallBack_; 460 RefPtr<Framework::ManifestParser> manifestParser_; 461 RefPtr<Framework::AccessibilityNodeManager> jsAccessibilityManager_; 462 RefPtr<MediaQueryInfo> mediaQueryInfo_; 463 RefPtr<GroupJsBridge> groupJsBridge_; 464 465 RefPtr<TaskExecutor> taskExecutor_; 466 467 PipelineContextHolder pipelineContextHolder_; 468 469 BaseId::IdType pageTransitionListenerId_ = 0L; 470 std::queue<std::string> animationFrameTaskIds_; 471 std::unordered_map<std::string, CancelableCallback<void()>> animationFrameTaskMap_; 472 473 mutable std::mutex mutex_; 474 475 std::queue<RouterTask> routerQueue_; 476 mutable std::mutex routerQueueMutex_; 477 478 RefPtr<RevSourceMap> appSourceMap_; 479 RefPtr<NG::PageRouterManager> pageRouterManager_; 480 }; 481 482 } // namespace OHOS::Ace::Framework 483 484 #endif // FOUNDATION_ACE_FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_FRONTEND_DELEGATE_DECLARATIVE_H 485