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

Side by Side Diff: content/renderer/devtools/devtools_agent.cc

Issue 2864103002: [DevTools] Support multiple DevToolsMessageChunkProcessor instances (Closed)
Patch Set: fix Created 3 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
« no previous file with comments | « content/browser/devtools/worker_devtools_agent_host.cc ('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 (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/renderer/devtools/devtools_agent.h" 5 #include "content/renderer/devtools/devtools_agent.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 chunk.call_id = call_id; 214 chunk.call_id = call_id;
215 chunk.post_state = post_state; 215 chunk.post_state = post_state;
216 chunk.is_last = true; 216 chunk.is_last = true;
217 sender->Send(new DevToolsClientMsg_DispatchOnInspectorFrontend( 217 sender->Send(new DevToolsClientMsg_DispatchOnInspectorFrontend(
218 routing_id, chunk)); 218 routing_id, chunk));
219 return; 219 return;
220 } 220 }
221 221
222 for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) { 222 for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) {
223 chunk.is_last = pos + kMaxMessageChunkSize >= message.length(); 223 chunk.is_last = pos + kMaxMessageChunkSize >= message.length();
224 chunk.session_id = chunk.is_last ? session_id : 0; 224 chunk.session_id = session_id;
225 chunk.call_id = chunk.is_last ? call_id : 0; 225 chunk.call_id = chunk.is_last ? call_id : 0;
226 chunk.post_state = chunk.is_last ? post_state : std::string(); 226 chunk.post_state = chunk.is_last ? post_state : std::string();
227 chunk.data = message.substr(pos, kMaxMessageChunkSize); 227 chunk.data = message.substr(pos, kMaxMessageChunkSize);
228 sender->Send(new DevToolsClientMsg_DispatchOnInspectorFrontend( 228 sender->Send(new DevToolsClientMsg_DispatchOnInspectorFrontend(
229 routing_id, chunk)); 229 routing_id, chunk));
230 chunk.is_first = false; 230 chunk.is_first = false;
231 chunk.message_size = 0; 231 chunk.message_size = 0;
232 } 232 }
233 } 233 }
234 234
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 result->Set("errors", errors.release()); 341 result->Set("errors", errors.release());
342 response->Set("result", result.release()); 342 response->Set("result", result.release());
343 343
344 std::string json_message; 344 std::string json_message;
345 base::JSONWriter::Write(*response, &json_message); 345 base::JSONWriter::Write(*response, &json_message);
346 SendChunkedProtocolMessage(this, routing_id(), session_id, call_id, 346 SendChunkedProtocolMessage(this, routing_id(), session_id, call_id,
347 json_message, std::string()); 347 json_message, std::string());
348 } 348 }
349 349
350 } // namespace content 350 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/worker_devtools_agent_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698