| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 base::trace_event::MemoryDumpManager::GetInstance()->RequestGlobalDump( | 218 base::trace_event::MemoryDumpManager::GetInstance()->RequestGlobalDump( |
| 219 base::trace_event::MemoryDumpType::EXPLICITLY_TRIGGERED, | 219 base::trace_event::MemoryDumpType::EXPLICITLY_TRIGGERED, |
| 220 base::trace_event::MemoryDumpLevelOfDetail::DETAILED, | 220 base::trace_event::MemoryDumpLevelOfDetail::DETAILED, |
| 221 base::Bind(&TracingHandler::OnMemoryDumpFinished, | 221 base::Bind(&TracingHandler::OnMemoryDumpFinished, |
| 222 weak_factory_.GetWeakPtr(), command_id)); | 222 weak_factory_.GetWeakPtr(), command_id)); |
| 223 return Response::OK(); | 223 return Response::OK(); |
| 224 } | 224 } |
| 225 | 225 |
| 226 void TracingHandler::OnMemoryDumpFinished(DevToolsCommandId command_id, | 226 void TracingHandler::OnMemoryDumpFinished(DevToolsCommandId command_id, |
| 227 uint64 dump_guid, | 227 uint64_t dump_guid, |
| 228 bool success) { | 228 bool success) { |
| 229 client_->SendRequestMemoryDumpResponse( | 229 client_->SendRequestMemoryDumpResponse( |
| 230 command_id, | 230 command_id, |
| 231 RequestMemoryDumpResponse::Create() | 231 RequestMemoryDumpResponse::Create() |
| 232 ->set_dump_guid(base::StringPrintf("0x%" PRIx64, dump_guid)) | 232 ->set_dump_guid(base::StringPrintf("0x%" PRIx64, dump_guid)) |
| 233 ->set_success(success)); | 233 ->set_success(success)); |
| 234 } | 234 } |
| 235 | 235 |
| 236 void TracingHandler::SetupTimer(double usage_reporting_interval) { | 236 void TracingHandler::SetupTimer(double usage_reporting_interval) { |
| 237 if (usage_reporting_interval == 0) return; | 237 if (usage_reporting_interval == 0) return; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 263 } | 263 } |
| 264 | 264 |
| 265 bool TracingHandler::IsStartupTracingActive() { | 265 bool TracingHandler::IsStartupTracingActive() { |
| 266 return ::tracing::TraceConfigFile::GetInstance()->IsEnabled() && | 266 return ::tracing::TraceConfigFile::GetInstance()->IsEnabled() && |
| 267 TracingController::GetInstance()->IsTracing(); | 267 TracingController::GetInstance()->IsTracing(); |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace tracing | 270 } // namespace tracing |
| 271 } // namespace devtools | 271 } // namespace devtools |
| 272 } // namespace content | 272 } // namespace content |
| OLD | NEW |