!2352 fix:避免获取this指针

Merge pull request !2352 from wTong888/master
This commit is contained in:
openharmony_ci 2024-10-19 02:47:23 +00:00 committed by Gitee
commit c43735f2be
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 8 additions and 8 deletions

View File

@ -32,12 +32,12 @@ bool CloudReport::RegisterCloudReportInstance(CloudReport *instance)
return true;
}
std::string CloudReport::GetPrepareTraceId(int32_t userId, const std::string &bundleName)
std::string CloudReport::GetPrepareTraceId(int32_t userId)
{
return "";
}
std::string CloudReport::GetRequestTraceId(int32_t userId, const std::string &bundleName)
std::string CloudReport::GetRequestTraceId(int32_t userId)
{
return "";
}

View File

@ -25,8 +25,8 @@ public:
using ReportParam = DistributedData::ReportParam;
API_EXPORT static CloudReport *GetInstance();
API_EXPORT static bool RegisterCloudReportInstance(CloudReport *instance);
virtual std::string GetPrepareTraceId(int32_t userId, const std::string &bundleName);
virtual std::string GetRequestTraceId(int32_t userId, const std::string &bundleName);
virtual std::string GetPrepareTraceId(int32_t userId);
virtual std::string GetRequestTraceId(int32_t userId);
virtual bool Report(const ReportParam &reportParam);
private:

View File

@ -154,7 +154,7 @@ bool SyncManager::SyncInfo::Contains(const std::string &storeName)
std::function<void(const Event &)> SyncManager::GetLockChangeHandler()
{
return [this](const Event &event) {
return [](const Event &event) {
auto &evt = static_cast<const CloudLockEvent &>(event);
auto storeInfo = evt.GetStoreInfo();
auto callback = evt.GetCallback();
@ -623,10 +623,10 @@ SyncManager::TraceIds SyncManager::GetPrepareTraceId(const SyncInfo &info, const
}
if (info.bundleName_.empty()) {
for (const auto &it : cloud.apps) {
traceIds.emplace(it.first, cloudReport->GetPrepareTraceId(info.user_, it.first));
traceIds.emplace(it.first, cloudReport->GetPrepareTraceId(info.user_));
}
} else {
traceIds.emplace(info.bundleName_, cloudReport->GetPrepareTraceId(info.user_, info.bundleName_));
traceIds.emplace(info.bundleName_, cloudReport->GetPrepareTraceId(info.user_));
}
return traceIds;
}

View File

@ -129,6 +129,7 @@ private:
static std::vector<std::tuple<QueryKey, uint64_t>> GetCloudSyncInfo(const SyncInfo &info, CloudInfo &cloud);
static std::vector<SchemaMeta> GetSchemaMeta(const CloudInfo &cloud, const std::string &bundleName);
static bool NeedGetCloudInfo(CloudInfo &cloud);
static GeneralError IsValid(SyncInfo &info, CloudInfo &cloud);
Task GetSyncTask(int32_t times, bool retry, RefCount ref, SyncInfo &&syncInfo);
void UpdateSchema(const SyncInfo &syncInfo);
std::function<void(const Event &)> GetSyncHandler(Retryer retryer);
@ -136,7 +137,6 @@ private:
Retryer GetRetryer(int32_t times, const SyncInfo &syncInfo, int32_t user);
RefCount GenSyncRef(uint64_t syncId);
int32_t Compare(uint64_t syncId, int32_t user);
GeneralError IsValid(SyncInfo &info, CloudInfo &cloud);
void UpdateStartSyncInfo(const std::vector<std::tuple<QueryKey, uint64_t>> &cloudSyncInfos);
void UpdateFinishSyncInfo(const QueryKey &queryKey, uint64_t syncId, int32_t code);
std::function<void(const DistributedData::GenDetails &result)> GetCallback(const GenAsync &async,