• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef FOUNDATION_ACE_FRAMEWORKS_BASE_LOG_ACE_HICHECKER_H
17 #define FOUNDATION_ACE_FRAMEWORKS_BASE_LOG_ACE_HICHECKER_H
18 
19 #include <string>
20 
21 #include "base/utils/macros.h"
22 
23 namespace OHOS::Ace {
24 class ACE_EXPORT AceChecker final {
25 public:
26     static bool IsPerformanceCheckEnabled();
27 
28     static void NotifyCaution(const std::string& tag);
29 
30     static void InitPerformanceParameters();
31 
32     static void SetPerformanceCheckStatus(bool status, const std::string& message);
33 
IsWebSocketCheckEnabled()34     static bool IsWebSocketCheckEnabled()
35     {
36         return isWebSocketCheckEnabled_;
37     }
38 
GetCheckMessge()39     static std::string GetCheckMessge()
40     {
41         return checkMessage_;
42     }
43 
GetPageNodes()44     static int32_t GetPageNodes()
45     {
46         return pageNodes_;
47     }
48 
GetPageDepth()49     static int32_t GetPageDepth()
50     {
51         return pageDepth_;
52     }
53 
GetNodeChildren()54     static int32_t GetNodeChildren()
55     {
56         return nodeChildren_;
57     }
58 
GetFunctionTimeout()59     static int32_t GetFunctionTimeout()
60     {
61         return functionTimeout_;
62     }
63 
GetVsyncTimeout()64     static int32_t GetVsyncTimeout()
65     {
66         return vsyncTimeout_;
67     }
68 
GetNodeTimeout()69     static int32_t GetNodeTimeout()
70     {
71         return nodeTimeout_;
72     }
73 
GetForeachItems()74     static int32_t GetForeachItems()
75     {
76         return foreachItems_;
77     }
78 
GetFlexLayouts()79     static int32_t GetFlexLayouts()
80     {
81         return flexLayouts_;
82     }
83 
84 private:
85     static int32_t pageNodes_;
86     static int32_t pageDepth_;
87     static int32_t nodeChildren_;
88     static int32_t functionTimeout_;
89     static int32_t vsyncTimeout_;
90     static int32_t nodeTimeout_;
91     static int32_t foreachItems_;
92     static int32_t flexLayouts_;
93     static std::string checkMessage_;
94     static bool isPerformanceCheckEnabled_;
95     static bool isWebSocketCheckEnabled_;
96 };
97 } // namespace OHOS::Ace
98 #endif // FOUNDATION_ACE_FRAMEWORKS_BASE_LOG_ACE_HICHECKER_H
99