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 FRAMEWORKS_SERVICES_MEDIA_MULTI_STAGES_CAPTURE_INCLUDE_MULTISTAGES_CAPTURE_DFX_FIRST_VISIT_H
17 #define FRAMEWORKS_SERVICES_MEDIA_MULTI_STAGES_CAPTURE_INCLUDE_MULTISTAGES_CAPTURE_DFX_FIRST_VISIT_H
18 
19 #include <memory>
20 #include <string>
21 
22 #include "medialibrary_async_worker.h"
23 
24 namespace OHOS {
25 namespace Media {
26 #define EXPORT __attribute__ ((visibility ("default")))
27 class FirstVisitAsyncTaskData : public AsyncTaskData {
28 public:
FirstVisitAsyncTaskData(int32_t fileId,const std::string & photoId,int64_t startTime,int64_t visitTime)29     FirstVisitAsyncTaskData(int32_t fileId, const std::string &photoId, int64_t startTime, int64_t visitTime)
30         : fileId_(fileId), photoId_(photoId), startTime_(startTime), visitTime_(visitTime) {}
31     virtual ~FirstVisitAsyncTaskData() override = default;
32 
33     int32_t fileId_;
34     std::string photoId_;
35     int64_t startTime_;
36     int64_t visitTime_;
37 };
38 
39 class MultiStagesCaptureDfxFirstVisit {
40 public:
41     EXPORT static MultiStagesCaptureDfxFirstVisit& GetInstance();
42     EXPORT void Report(const std::string &photoId);
43 
44 private:
45     MultiStagesCaptureDfxFirstVisit();
46     virtual ~MultiStagesCaptureDfxFirstVisit();
47     MultiStagesCaptureDfxFirstVisit(const MultiStagesCaptureDfxFirstVisit &totalTime) = delete;
48     const MultiStagesCaptureDfxFirstVisit &operator=(const MultiStagesCaptureDfxFirstVisit &totalTime) = delete;
49 };
50 
51 } // namespace Media
52 } // namespace OHOS
53 #endif  // FRAMEWORKS_SERVICES_MEDIA_MULTI_STAGES_CAPTURE_INCLUDE_MULTISTAGES_CAPTURE_DFX_FIRST_VISIT_H