| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |