| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |