1 /*
2 * Copyright (c) 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 #include "ohos_adapter/include/ark_res_sched_client_adapter.h"
17 #include "res_sched_client_adapter.h"
18
19 #include "base/bridge/ark_web_bridge_macros.h"
20
21 namespace OHOS::ArkWeb {
22
ReportKeyThread(int32_t statusAdapter,pid_t pid,pid_t tid,int32_t roleAdapter)23 bool ArkResSchedClientAdapter::ReportKeyThread(int32_t statusAdapter, pid_t pid, pid_t tid, int32_t roleAdapter)
24 {
25 return NWeb::ResSchedClientAdapter::ReportKeyThread(
26 (NWeb::ResSchedStatusAdapter)statusAdapter, pid, tid, (NWeb::ResSchedRoleAdapter)roleAdapter);
27 }
28
ReportWindowStatus(int32_t statusAdapter,pid_t pid,uint32_t windowId,int32_t nwebId)29 bool ArkResSchedClientAdapter::ReportWindowStatus(int32_t statusAdapter, pid_t pid, uint32_t windowId, int32_t nwebId)
30 {
31 return NWeb::ResSchedClientAdapter::ReportWindowStatus(
32 (NWeb::ResSchedStatusAdapter)statusAdapter, pid, windowId, nwebId);
33 }
34
ReportScene(int32_t statusAdapter,int32_t sceneAdapter,int32_t nwebId)35 bool ArkResSchedClientAdapter::ReportScene(int32_t statusAdapter, int32_t sceneAdapter, int32_t nwebId)
36 {
37 return NWeb::ResSchedClientAdapter::ReportScene(
38 (NWeb::ResSchedStatusAdapter)statusAdapter, (NWeb::ResSchedSceneAdapter)sceneAdapter, nwebId);
39 }
40
ReportAudioData(int32_t statusAdapter,pid_t pid,pid_t tid)41 bool ArkResSchedClientAdapter::ReportAudioData(int32_t statusAdapter, pid_t pid, pid_t tid)
42 {
43 return NWeb::ResSchedClientAdapter::ReportAudioData((NWeb::ResSchedStatusAdapter)statusAdapter, pid, tid);
44 }
45
ReportWindowId(int32_t windowId,int32_t nwebId)46 void ArkResSchedClientAdapter::ReportWindowId(int32_t windowId, int32_t nwebId)
47 {
48 return NWeb::ResSchedClientAdapter::ReportWindowId(windowId, nwebId);
49 }
50
ReportNWebInit(int32_t statusAdapter,int32_t nweb_id)51 void ArkResSchedClientAdapter::ReportNWebInit(int32_t statusAdapter, int32_t nweb_id)
52 {
53 NWeb::ResSchedClientAdapter::ReportNWebInit((NWeb::ResSchedStatusAdapter)statusAdapter, nweb_id);
54 }
55
ReportRenderProcessStatus(int32_t statusAdapter,pid_t pid)56 void ArkResSchedClientAdapter::ReportRenderProcessStatus(int32_t statusAdapter, pid_t pid)
57 {
58 NWeb::ResSchedClientAdapter::ReportRenderProcessStatus((NWeb::ResSchedStatusAdapter)statusAdapter, pid);
59 }
60
ReportScreenCapture(int32_t statusAdapter,pid_t pid)61 bool ArkResSchedClientAdapter::ReportScreenCapture(int32_t statusAdapter, pid_t pid)
62 {
63 return NWeb::ResSchedClientAdapter::ReportScreenCapture((NWeb::ResSchedStatusAdapter)statusAdapter, pid);
64 }
65
ReportVideoPlaying(int32_t statusAdapter,pid_t pid)66 bool ArkResSchedClientAdapter::ReportVideoPlaying(int32_t statusAdapter, pid_t pid)
67 {
68 return NWeb::ResSchedClientAdapter::ReportVideoPlaying((NWeb::ResSchedStatusAdapter)statusAdapter, pid);
69 }
70
ReportProcessInUse(pid_t pid)71 void ArkResSchedClientAdapter::ReportProcessInUse(pid_t pid)
72 {
73 NWeb::ResSchedClientAdapter::ReportProcessInUse(pid);
74 }
75
ReportSiteIsolationMode(bool mode)76 void ArkResSchedClientAdapter::ReportSiteIsolationMode(bool mode)
77 {
78 NWeb::ResSchedClientAdapter::ReportSiteIsolationMode(mode);
79 }
80
81 } // namespace OHOS::ArkWeb
82