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

Unified Diff: content/browser/devtools/protocol/tracing_handler.cc

Issue 2180423004: DevTools: update transfer mode in Tracing.start when using start-up tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DevTools: update transfer mode in Tracing.start when using start-up tracing Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/devtools/protocol/tracing_handler.cc
diff --git a/content/browser/devtools/protocol/tracing_handler.cc b/content/browser/devtools/protocol/tracing_handler.cc
index 12f9c1899e8191997da2b1bc5fe26e71ce3e8d5e..38ee2cc3c2d63a53d67ab6442f989e0c4851fdfa 100644
--- a/content/browser/devtools/protocol/tracing_handler.cc
+++ b/content/browser/devtools/protocol/tracing_handler.cc
@@ -179,8 +179,16 @@ Response TracingHandler::Start(
const double* buffer_usage_reporting_interval,
const std::string* transfer_mode,
const std::unique_ptr<base::DictionaryValue>& config) {
- if (IsTracing())
+ if (IsTracing()) {
+ if (!did_initiate_recording_ && IsStartupTracingActive()) {
+ // If tracing is already running because it was initiated by startup
+ // tracing, honor the transfer mode update, as that's the only way
+ // for the client to communicate it.
+ return_as_stream_ =
+ transfer_mode && *transfer_mode == start::kTransferModeReturnAsStream;
+ }
return Response::InternalError("Tracing is already started");
+ }
if (config && (categories || options)) {
return Response::InternalError(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698