• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 ARK_SYSTEM_PROPERTIES_ADAPTER_IMPL_H
17 #define ARK_SYSTEM_PROPERTIES_ADAPTER_IMPL_H
18 #pragma once
19 
20 #include "ohos_adapter/include/ark_system_properties_adapter.h"
21 #include "system_properties_adapter.h"
22 
23 namespace OHOS::ArkWeb {
24 
25 class ArkSystemPropertiesAdapterImpl : public ArkSystemPropertiesAdapter {
26 public:
27     explicit ArkSystemPropertiesAdapterImpl(NWeb::SystemPropertiesAdapter&);
28 
29     bool GetResourceUseHapPathEnable() override;
30 
31     ArkWebString GetDeviceInfoProductModel() override;
32 
33     ArkWebString GetDeviceInfoBrand() override;
34 
35     int32_t GetDeviceInfoMajorVersion() override;
36 
37     int32_t GetProductDeviceType() override;
38 
39     bool GetWebOptimizationValue() override;
40 
41     bool IsAdvancedSecurityMode() override;
42 
43     ArkWebString GetUserAgentOSName() override;
44 
45     ArkWebString GetUserAgentOSVersion() override;
46 
47     ArkWebString GetUserAgentBaseOSName() override;
48 
49     int32_t GetSoftwareMajorVersion() override;
50 
51     int32_t GetSoftwareSeniorVersion() override;
52 
53     ArkWebString GetNetlogMode() override;
54 
55     bool GetTraceDebugEnable() override;
56 
57     ArkWebString GetSiteIsolationMode() override;
58 
59     bool GetOOPGPUEnable() override;
60 
61     void SetOOPGPUDisable() override;
62 
63     int32_t GetFlowBufMaxFd() override;
64 
65     void AttachSysPropObserver(int32_t key, void* observer) override;
66 
67     void DetachSysPropObserver(int32_t key, void* observer) override;
68 
69     bool GetBoolParameter(ArkWebString key, bool defaultValue) override;
70 
71     ArkFrameRateSettingAdapterVector GetLTPOConfig(const ArkWebString& settingName) override;
72 
73     ArkWebString GetOOPGPUStatus() override;
74 
75     bool IsLTPODynamicApp(ArkWebString settingName) override;
76 
77     int32_t GetLTPOStrategy() override;
78 
79     ArkWebString GetVulkanStatus() override;
80 
81     ArkWebString GetCompatibleDeviceType() override;
82 
83     ArkWebString GetDeviceInfoApiVersion() override;
84 
85     ArkWebString GetPRPPreloadMode() override;
86 
87     ArkWebString GetScrollVelocityScale() override;
88 
89     ArkWebString GetScrollFriction() override;
90 
91     ArkWebString GetBundleName() override;
92 
93     ArkWebString GetStringParameter(const ArkWebString& key, const ArkWebString& defaultValue) override;
94 
95     int32_t GetInitialCongestionWindowSize() override;
96 
97     int32_t GetIntParameter(const ArkWebString& key, int32_t defaultValue) override;
98 
99 private:
100     NWeb::SystemPropertiesAdapter& real_;
101 
102     IMPLEMENT_REFCOUNTING(ArkSystemPropertiesAdapterImpl);
103 };
104 
105 } // namespace OHOS::ArkWeb
106 
107 #endif // ARK_SYSTEM_PROPERTIES_ADAPTER_IMPL_H
108