Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(638)

Unified Diff: content/browser/tracing/tracing_controller_impl.cc

Issue 1644653002: [Tracing] Update sync_id to be string type for clock sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/tracing/tracing_controller_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/tracing_controller_impl.cc
diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc
index 9ed3c03f2597aa037d38a71245e39060b16cc31e..f629a605542233e766e2c051d50a3ffa373e1416 100644
--- a/content/browser/tracing/tracing_controller_impl.cc
+++ b/content/browser/tracing/tracing_controller_impl.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/cpu.h"
#include "base/files/file_util.h"
+#include "base/guid.h"
#include "base/json/string_escape.h"
#include "base/macros.h"
#include "base/strings/string_number_conversions.h"
@@ -157,7 +158,6 @@ TracingControllerImpl::TracingControllerImpl()
approximate_event_count_(0),
pending_memory_dump_ack_count_(0),
failed_memory_dump_count_(0),
- clock_sync_id_(0),
pending_clock_sync_ack_count_(0),
is_tracing_(false),
is_monitoring_(false) {
@@ -1027,19 +1027,13 @@ bool TracingControllerImpl::SupportsExplicitClockSync() {
}
void TracingControllerImpl::RecordClockSyncMarker(
- int sync_id,
+ const std::string& sync_id,
const RecordClockSyncMarkerCallback& callback) {
DCHECK(SupportsExplicitClockSync());
TRACE_EVENT_CLOCK_SYNC_RECEIVER(sync_id);
}
-int TracingControllerImpl::GetUniqueClockSyncID() {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- // There is no need to lock because this function only runs on UI thread.
- return ++clock_sync_id_;
-}
-
void TracingControllerImpl::IssueClockSyncMarker() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(pending_clock_sync_ack_count_ == 0);
@@ -1047,7 +1041,7 @@ void TracingControllerImpl::IssueClockSyncMarker() {
for (const auto& it : additional_tracing_agents_) {
if (it->SupportsExplicitClockSync()) {
it->RecordClockSyncMarker(
- GetUniqueClockSyncID(),
+ base::GenerateGUID(),
base::Bind(&TracingControllerImpl::OnClockSyncMarkerRecordedByAgent,
base::Unretained(this)));
pending_clock_sync_ack_count_++;
@@ -1066,7 +1060,7 @@ void TracingControllerImpl::IssueClockSyncMarker() {
}
void TracingControllerImpl::OnClockSyncMarkerRecordedByAgent(
- int sync_id,
+ const std::string& sync_id,
const base::TimeTicks& issue_ts,
const base::TimeTicks& issue_end_ts) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
« no previous file with comments | « content/browser/tracing/tracing_controller_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698