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

Side by Side Diff: content/browser/devtools/devtools_tracing_handler.cc

Issue 278953002: DevTools: allow inspecting browsers using custom front-ends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Manually tested end-to-end. Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/devtools_tracing_handler.h" 5 #include "content/browser/devtools/devtools_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/callback.h" 10 #include "base/callback.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 base::Bind(&DevToolsTracingHandler::OnBufferUsage, 164 base::Bind(&DevToolsTracingHandler::OnBufferUsage,
165 weak_factory_.GetWeakPtr())), 165 weak_factory_.GetWeakPtr())),
166 true)); 166 true));
167 buffer_usage_poll_timer_->Reset(); 167 buffer_usage_poll_timer_->Reset();
168 } 168 }
169 } 169 }
170 170
171 TracingController::GetInstance()->EnableRecording( 171 TracingController::GetInstance()->EnableRecording(
172 categories, options, TracingController::EnableRecordingDoneCallback()); 172 categories, options, TracingController::EnableRecordingDoneCallback());
173 173
174 return NULL; 174 return command->SuccessResponse(NULL);
175 } 175 }
176 176
177 void DevToolsTracingHandler::OnBufferUsage(float usage) { 177 void DevToolsTracingHandler::OnBufferUsage(float usage) {
178 base::DictionaryValue* params = new base::DictionaryValue(); 178 base::DictionaryValue* params = new base::DictionaryValue();
179 params->SetDouble(devtools::Tracing::bufferUsage::kParamValue, usage); 179 params->SetDouble(devtools::Tracing::bufferUsage::kParamValue, usage);
180 SendNotification(devtools::Tracing::bufferUsage::kName, params); 180 SendNotification(devtools::Tracing::bufferUsage::kName, params);
181 } 181 }
182 182
183 scoped_refptr<DevToolsProtocol::Response> 183 scoped_refptr<DevToolsProtocol::Response>
184 DevToolsTracingHandler::OnEnd( 184 DevToolsTracingHandler::OnEnd(
185 scoped_refptr<DevToolsProtocol::Command> command) { 185 scoped_refptr<DevToolsProtocol::Command> command) {
186 buffer_usage_poll_timer_.reset(); 186 buffer_usage_poll_timer_.reset();
187 TracingController::GetInstance()->DisableRecording( 187 TracingController::GetInstance()->DisableRecording(
188 base::FilePath(), 188 base::FilePath(),
189 base::Bind(&DevToolsTracingHandler::BeginReadingRecordingResult, 189 base::Bind(&DevToolsTracingHandler::BeginReadingRecordingResult,
190 weak_factory_.GetWeakPtr())); 190 weak_factory_.GetWeakPtr()));
191 return command->SuccessResponse(NULL); 191 return command->SuccessResponse(NULL);
192 } 192 }
193 193
194 } // namespace content 194 } // namespace content
OLDNEW
« chrome/browser/ui/webui/inspect_ui.cc ('K') | « content/browser/devtools/devtools_browser_target.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698