!16130 SendUIMessage增加cmdIndex标识

Merge pull request !16130 from chenq/1018-cmdindex
This commit is contained in:
openharmony_ci 2024-10-21 06:15:31 +00:00 committed by Gitee
commit 9b395ba359
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 8 additions and 3 deletions

View File

@ -3154,12 +3154,12 @@ void RSMainThread::SendCommands()
auto& app = appIter->second;
auto transactionPtr = transactionIter.second;
if (transactionPtr != nullptr) {
dfxString += "[pid:" + std::to_string(pid) + ",cmdIndex:" + std::to_string(transactionPtr->GetIndex())
+ ",cmdCount:" + std::to_string(transactionPtr->GetCommandCount()) + "]";
dfxString += "[pid:" + std::to_string(pid) + ",index:" + std::to_string(transactionPtr->GetIndex())
+ ",cnt:" + std::to_string(transactionPtr->GetCommandCount()) + "]";
}
app->OnTransaction(transactionPtr);
}
RS_LOGI("RSMainThread::SendCommand to %{public}s", dfxString.c_str());
RS_LOGI("RS send to %{public}s", dfxString.c_str());
RS_TRACE_NAME_FMT("RSMainThread::SendCommand to %s", dfxString.c_str());
});
}

View File

@ -48,6 +48,7 @@ private:
private:
mutable std::mutex transactionMapMutex_;
std::unordered_map<uint32_t, std::shared_ptr<RSTransactionData>> transactionMap_;
uint32_t transactionDataIndex_ = 0;
};
} // namespace Rosen
} // namespace OHOS

View File

@ -38,6 +38,8 @@ void RSMessageProcessor::AddUIMessage(uint32_t pid, std::unique_ptr<RSCommand>&
std::unique_lock<std::mutex> lock(transactionMapMutex_);
if (!transactionMap_.count(pid)) {
std::shared_ptr<RSTransactionData> transactionData = std::make_shared<RSTransactionData>();
transactionDataIndex_++;
transactionData->SetIndex(transactionDataIndex_);
transactionMap_[pid] = transactionData;
}
transactionMap_[pid]->AddCommand(std::move(command), 0, FollowType::NONE);
@ -48,6 +50,8 @@ void RSMessageProcessor::AddUIMessage(uint32_t pid, std::unique_ptr<RSCommand>&&
std::unique_lock<std::mutex> lock(transactionMapMutex_);
if (!transactionMap_.count(pid)) {
std::shared_ptr<RSTransactionData> transactionData = std::make_shared<RSTransactionData>();
transactionDataIndex_++;
transactionData->SetIndex(transactionDataIndex_);
transactionMap_[pid] = transactionData;
}
transactionMap_[pid]->AddCommand(std::move(command), 0, FollowType::NONE);