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

Side by Side Diff: content/browser/tracing/power_tracing_agent.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, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/lazy_instance.h" 5 #include "base/lazy_instance.h"
6 #include "base/memory/singleton.h" 6 #include "base/memory/singleton.h"
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "base/trace_event/trace_event_impl.h" 8 #include "base/trace_event/trace_event_impl.h"
9 #include "content/browser/tracing/battor_power_trace_provider.h" 9 #include "content/browser/tracing/battor_power_trace_provider.h"
10 #include "content/browser/tracing/power_tracing_agent.h" 10 #include "content/browser/tracing/power_tracing_agent.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 base::Unretained(this), 108 base::Unretained(this),
109 callback, 109 callback,
110 result)); 110 result));
111 } 111 }
112 112
113 bool PowerTracingAgent::SupportsExplicitClockSync() { 113 bool PowerTracingAgent::SupportsExplicitClockSync() {
114 return true; 114 return true;
115 } 115 }
116 116
117 void PowerTracingAgent::RecordClockSyncMarker( 117 void PowerTracingAgent::RecordClockSyncMarker(
118 int sync_id, 118 const std::string& sync_id,
119 const RecordClockSyncMarkerCallback& callback) { 119 const RecordClockSyncMarkerCallback& callback) {
120 DCHECK_CURRENTLY_ON(BrowserThread::UI); 120 DCHECK_CURRENTLY_ON(BrowserThread::UI);
121 DCHECK(SupportsExplicitClockSync()); 121 DCHECK(SupportsExplicitClockSync());
122 122
123 thread_.task_runner()->PostTask( 123 thread_.task_runner()->PostTask(
124 FROM_HERE, 124 FROM_HERE,
125 base::Bind(&PowerTracingAgent::RecordClockSyncMarkerOnThread, 125 base::Bind(&PowerTracingAgent::RecordClockSyncMarkerOnThread,
126 base::Unretained(this), 126 base::Unretained(this),
127 sync_id, 127 sync_id,
128 callback)); 128 callback));
129 } 129 }
130 130
131 void PowerTracingAgent::RecordClockSyncMarkerOnThread( 131 void PowerTracingAgent::RecordClockSyncMarkerOnThread(
132 int sync_id, 132 const std::string& sync_id,
133 const RecordClockSyncMarkerCallback& callback) { 133 const RecordClockSyncMarkerCallback& callback) {
134 DCHECK(thread_.task_runner()->BelongsToCurrentThread()); 134 DCHECK(thread_.task_runner()->BelongsToCurrentThread());
135 DCHECK(SupportsExplicitClockSync()); 135 DCHECK(SupportsExplicitClockSync());
136 136
137 base::TimeTicks issue_ts = base::TimeTicks::Now(); 137 base::TimeTicks issue_ts = base::TimeTicks::Now();
138 battor_trace_provider_->RecordClockSyncMarker(sync_id); 138 battor_trace_provider_->RecordClockSyncMarker(sync_id);
139 base::TimeTicks issue_end_ts = base::TimeTicks::Now(); 139 base::TimeTicks issue_end_ts = base::TimeTicks::Now();
140 140
141 BrowserThread::PostTask( 141 BrowserThread::PostTask(
142 BrowserThread::UI, FROM_HERE, 142 BrowserThread::UI, FROM_HERE,
143 base::Bind(callback, sync_id, issue_ts, issue_end_ts)); 143 base::Bind(callback, sync_id, issue_ts, issue_end_ts));
144 } 144 }
145 145
146 } // namespace content 146 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/tracing/power_tracing_agent.h ('k') | content/browser/tracing/tracing_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698