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

Side by Side Diff: content/browser/devtools/protocol/tracing_handler.cc

Issue 1408363004: [DevTools] Filter any messages from previous sessions in DevToolsAgentHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 void TracingHandler::OnTraceDataCollected(const std::string& trace_fragment) { 107 void TracingHandler::OnTraceDataCollected(const std::string& trace_fragment) {
108 // Hand-craft protocol notification message so we can substitute JSON 108 // Hand-craft protocol notification message so we can substitute JSON
109 // that we already got as string as a bare object, not a quoted string. 109 // that we already got as string as a bare object, not a quoted string.
110 std::string message( 110 std::string message(
111 "{ \"method\": \"Tracing.dataCollected\", \"params\": { \"value\": ["); 111 "{ \"method\": \"Tracing.dataCollected\", \"params\": { \"value\": [");
112 const size_t messageSuffixSize = 10; 112 const size_t messageSuffixSize = 10;
113 message.reserve(message.size() + trace_fragment.size() + messageSuffixSize); 113 message.reserve(message.size() + trace_fragment.size() + messageSuffixSize);
114 message += trace_fragment; 114 message += trace_fragment;
115 message += "] } }"; 115 message += "] } }";
116 client_->SendRawMessage(message); 116 client_->SendRawNotification(message);
117 } 117 }
118 118
119 void TracingHandler::OnTraceComplete() { 119 void TracingHandler::OnTraceComplete() {
120 client_->TracingComplete(TracingCompleteParams::Create()); 120 client_->TracingComplete(TracingCompleteParams::Create());
121 } 121 }
122 122
123 void TracingHandler::OnTraceToStreamComplete(const std::string& stream_handle) { 123 void TracingHandler::OnTraceToStreamComplete(const std::string& stream_handle) {
124 client_->TracingComplete( 124 client_->TracingComplete(
125 TracingCompleteParams::Create()->set_stream(stream_handle)); 125 TracingCompleteParams::Create()->set_stream(stream_handle));
126 } 126 }
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()->IsRecording(); 267 TracingController::GetInstance()->IsRecording();
268 } 268 }
269 269
270 } // namespace tracing 270 } // namespace tracing
271 } // namespace devtools 271 } // namespace devtools
272 } // namespace content 272 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/input_handler.cc ('k') | content/browser/devtools/render_frame_devtools_agent_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698