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

Side by Side Diff: content/browser/devtools/protocol/tracing_handler.cc

Issue 2833873003: WIP: The tracing service prototype
Patch Set: sync Created 3 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/devtools/protocol/tracing_handler.h" 5 #include "content/browser/devtools/protocol/tracing_handler.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 std::unique_ptr<RequestMemoryDumpCallback> callback, 302 std::unique_ptr<RequestMemoryDumpCallback> callback,
303 uint64_t dump_guid, 303 uint64_t dump_guid,
304 bool success) { 304 bool success) {
305 callback->sendSuccess(base::StringPrintf("0x%" PRIx64, dump_guid), success); 305 callback->sendSuccess(base::StringPrintf("0x%" PRIx64, dump_guid), success);
306 } 306 }
307 307
308 Response TracingHandler::RecordClockSyncMarker(const std::string& sync_id) { 308 Response TracingHandler::RecordClockSyncMarker(const std::string& sync_id) {
309 if (!IsTracing()) 309 if (!IsTracing())
310 return Response::Error("Tracing is not started"); 310 return Response::Error("Tracing is not started");
311 311
312 TracingControllerImpl::GetInstance()->RecordClockSyncMarker( 312 TRACE_EVENT_CLOCK_SYNC_RECEIVER(sync_id);
313 sync_id,
314 base::trace_event::TracingAgent::RecordClockSyncMarkerCallback());
315 313
316 return Response::OK(); 314 return Response::OK();
317 } 315 }
318 316
319 void TracingHandler::SetupTimer(double usage_reporting_interval) { 317 void TracingHandler::SetupTimer(double usage_reporting_interval) {
320 if (usage_reporting_interval == 0) return; 318 if (usage_reporting_interval == 0) return;
321 319
322 if (usage_reporting_interval < kMinimumReportingInterval) 320 if (usage_reporting_interval < kMinimumReportingInterval)
323 usage_reporting_interval = kMinimumReportingInterval; 321 usage_reporting_interval = kMinimumReportingInterval;
324 322
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 358
361 std::string mode; 359 std::string mode;
362 if (tracing_dict->GetString(kRecordModeParam, &mode)) 360 if (tracing_dict->GetString(kRecordModeParam, &mode))
363 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-')); 361 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-'));
364 362
365 return base::trace_event::TraceConfig(*tracing_dict); 363 return base::trace_event::TraceConfig(*tracing_dict);
366 } 364 }
367 365
368 } // namespace tracing 366 } // namespace tracing
369 } // namespace protocol 367 } // namespace protocol
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/gpu/browser_gpu_channel_host_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698