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