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 1282453002: [tracing] Reland of Throttle rate of heavy dumps and support to request light/heavy dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix IPC messages. Created 5 years, 4 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
« no previous file with comments | « components/tracing/tracing_messages.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 for (const std::string& category : category_set) 152 for (const std::string& category : category_set)
153 categories.push_back(category); 153 categories.push_back(category);
154 client_->SendGetCategoriesResponse(command_id, 154 client_->SendGetCategoriesResponse(command_id,
155 GetCategoriesResponse::Create()->set_categories(categories)); 155 GetCategoriesResponse::Create()->set_categories(categories));
156 } 156 }
157 157
158 Response TracingHandler::RequestMemoryDump(DevToolsCommandId command_id) { 158 Response TracingHandler::RequestMemoryDump(DevToolsCommandId command_id) {
159 if (!did_initiate_recording_) 159 if (!did_initiate_recording_)
160 return Response::InternalError("Tracing is not started"); 160 return Response::InternalError("Tracing is not started");
161 161
162 base::trace_event::MemoryDumpArgs dump_args = {
163 base::trace_event::MemoryDumpArgs::LevelOfDetail::HIGH};
162 base::trace_event::MemoryDumpManager::GetInstance()->RequestGlobalDump( 164 base::trace_event::MemoryDumpManager::GetInstance()->RequestGlobalDump(
163 base::trace_event::MemoryDumpType::EXPLICITLY_TRIGGERED, 165 base::trace_event::MemoryDumpType::EXPLICITLY_TRIGGERED, dump_args,
164 base::Bind(&TracingHandler::OnMemoryDumpFinished, 166 base::Bind(&TracingHandler::OnMemoryDumpFinished,
165 weak_factory_.GetWeakPtr(), command_id)); 167 weak_factory_.GetWeakPtr(), command_id));
166 return Response::OK(); 168 return Response::OK();
167 } 169 }
168 170
169 void TracingHandler::OnMemoryDumpFinished(DevToolsCommandId command_id, 171 void TracingHandler::OnMemoryDumpFinished(DevToolsCommandId command_id,
170 uint64 dump_guid, 172 uint64 dump_guid,
171 bool success) { 173 bool success) {
172 client_->SendRequestMemoryDumpResponse( 174 client_->SendRequestMemoryDumpResponse(
173 command_id, 175 command_id,
(...skipping 27 matching lines...) Expand all
201 did_initiate_recording_ = false; 203 did_initiate_recording_ = false;
202 } 204 }
203 205
204 bool TracingHandler::IsRecording() const { 206 bool TracingHandler::IsRecording() const {
205 return TracingController::GetInstance()->IsRecording(); 207 return TracingController::GetInstance()->IsRecording();
206 } 208 }
207 209
208 } // namespace tracing 210 } // namespace tracing
209 } // namespace devtools 211 } // namespace devtools
210 } // namespace content 212 } // namespace content
OLDNEW
« no previous file with comments | « components/tracing/tracing_messages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698