• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 #ifndef I_APP_THR_EXECUTOR_H
16 #define I_APP_THR_EXECUTOR_H
17 
18 #include <string>
19 
20 namespace OHOS {
21 namespace HiviewDFX {
22 class IAppThrExecutor {
23 public:
24 
25     struct AppEvtData {
26         uint64_t time{0};
27         std::string domain{""};
28         std::string eventName{""};
29         std::string bundleName{""};
30         std::string abilityName{""};
31         std::string processName{""};
32         std::string pageUrl{""};
33         std::string sceneId{""};
34         std::string sourceType{""};
35         uint64_t inputTime{0};
36         uint64_t animationStartTime{0};
37         uint64_t renderTime{0};
38         uint64_t responseLatency{0};
39         std::string moduleName{""};
40         int32_t versionCode{0};
41         std::string versionName{""};
42         int32_t startType{0};
43         uint64_t startupTime{0};
44         int32_t startupAbilityType{0};
45         int32_t startupExtensionType{0};
46         int32_t callerUid{0};
47         std::string callerProcessName{""};
48         std::string callerBundleName{""};
49         int32_t appPid{0};
50         int32_t appUid{0};
51         std::string windowName{""};
52         uint64_t animationStartLatency{0};
53         uint64_t animationEndLatency{0};
54         uint64_t e2eLatency{0};
55         int32_t bundleType{0};
56         uint64_t exitTime{0};
57         int32_t exitResult{0};
58         int32_t exitPid{0};
59         std::string note{""};
60     };
61 
62     class IProcessAppEvtTask {
63     public:
64         virtual void ExecuteProcessAppEvtTaskInMainThr(const AppEvtData& data) = 0;
65 
66         virtual ~IProcessAppEvtTask() = default;
67     };
68 
69     virtual void ExecuteHandleEvtInMainThr(IProcessAppEvtTask* task, const AppEvtData& data) = 0;
70 
71     virtual ~IAppThrExecutor() = default;
72 };
73 } // HiviewDFX
74 } // OHOS
75 #endif