| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 for (const std::string& category : category_set) | 204 for (const std::string& category : category_set) |
| 205 categories.push_back(category); | 205 categories.push_back(category); |
| 206 client_->SendGetCategoriesResponse(command_id, | 206 client_->SendGetCategoriesResponse(command_id, |
| 207 GetCategoriesResponse::Create()->set_categories(categories)); | 207 GetCategoriesResponse::Create()->set_categories(categories)); |
| 208 } | 208 } |
| 209 | 209 |
| 210 Response TracingHandler::RequestMemoryDump(DevToolsCommandId command_id) { | 210 Response TracingHandler::RequestMemoryDump(DevToolsCommandId command_id) { |
| 211 if (!IsRecording()) | 211 if (!IsRecording()) |
| 212 return Response::InternalError("Tracing is not started"); | 212 return Response::InternalError("Tracing is not started"); |
| 213 | 213 |
| 214 base::trace_event::MemoryDumpArgs dump_args = { | |
| 215 base::trace_event::MemoryDumpArgs::LevelOfDetail::HIGH}; | |
| 216 base::trace_event::MemoryDumpManager::GetInstance()->RequestGlobalDump( | 214 base::trace_event::MemoryDumpManager::GetInstance()->RequestGlobalDump( |
| 217 base::trace_event::MemoryDumpType::EXPLICITLY_TRIGGERED, dump_args, | 215 base::trace_event::MemoryDumpType::EXPLICITLY_TRIGGERED, |
| 216 base::trace_event::MemoryDumpLevelOfDetail::DETAILED, |
| 218 base::Bind(&TracingHandler::OnMemoryDumpFinished, | 217 base::Bind(&TracingHandler::OnMemoryDumpFinished, |
| 219 weak_factory_.GetWeakPtr(), command_id)); | 218 weak_factory_.GetWeakPtr(), command_id)); |
| 220 return Response::OK(); | 219 return Response::OK(); |
| 221 } | 220 } |
| 222 | 221 |
| 223 void TracingHandler::OnMemoryDumpFinished(DevToolsCommandId command_id, | 222 void TracingHandler::OnMemoryDumpFinished(DevToolsCommandId command_id, |
| 224 uint64 dump_guid, | 223 uint64 dump_guid, |
| 225 bool success) { | 224 bool success) { |
| 226 client_->SendRequestMemoryDumpResponse( | 225 client_->SendRequestMemoryDumpResponse( |
| 227 command_id, | 226 command_id, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 255 did_initiate_recording_ = false; | 254 did_initiate_recording_ = false; |
| 256 } | 255 } |
| 257 | 256 |
| 258 bool TracingHandler::IsRecording() const { | 257 bool TracingHandler::IsRecording() const { |
| 259 return TracingController::GetInstance()->IsRecording(); | 258 return TracingController::GetInstance()->IsRecording(); |
| 260 } | 259 } |
| 261 | 260 |
| 262 } // namespace tracing | 261 } // namespace tracing |
| 263 } // namespace devtools | 262 } // namespace devtools |
| 264 } // namespace content | 263 } // namespace content |
| OLD | NEW |