| OLD | NEW |
| 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/child/shared_worker_devtools_agent.h" | 5 #include "content/child/shared_worker_devtools_agent.h" |
| 6 | 6 |
| 7 #include "content/child/child_thread_impl.h" | 7 #include "content/child/child_thread_impl.h" |
| 8 #include "content/common/devtools_messages.h" | 8 #include "content/common/devtools_messages.h" |
| 9 #include "ipc/ipc_channel.h" | 9 #include "ipc/ipc_channel.h" |
| 10 #include "third_party/WebKit/public/platform/WebCString.h" | 10 #include "third_party/WebKit/public/platform/WebCString.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 chunk.call_id = chunk.is_last ? call_id : 0; | 68 chunk.call_id = chunk.is_last ? call_id : 0; |
| 69 chunk.post_state = chunk.is_last ? post_state : std::string(); | 69 chunk.post_state = chunk.is_last ? post_state : std::string(); |
| 70 chunk.data = message.substr(pos, kMaxMessageChunkSize); | 70 chunk.data = message.substr(pos, kMaxMessageChunkSize); |
| 71 Send(new DevToolsClientMsg_DispatchOnInspectorFrontend( | 71 Send(new DevToolsClientMsg_DispatchOnInspectorFrontend( |
| 72 route_id_, chunk)); | 72 route_id_, chunk)); |
| 73 chunk.is_first = false; | 73 chunk.is_first = false; |
| 74 chunk.message_size = 0; | 74 chunk.message_size = 0; |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 void SharedWorkerDevToolsAgent::OnAttach(const std::string& host_id) { | 78 void SharedWorkerDevToolsAgent::OnAttach(const std::string& host_id, |
| 79 webworker_->attachDevTools(WebString::fromUTF8(host_id)); | 79 int session_id) { |
| 80 webworker_->attachDevTools(WebString::fromUTF8(host_id), session_id); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void SharedWorkerDevToolsAgent::OnReattach(const std::string& host_id, | 83 void SharedWorkerDevToolsAgent::OnReattach(const std::string& host_id, |
| 84 int session_id, |
| 83 const std::string& state) { | 85 const std::string& state) { |
| 84 webworker_->reattachDevTools(WebString::fromUTF8(host_id), | 86 webworker_->reattachDevTools(WebString::fromUTF8(host_id), session_id, |
| 85 WebString::fromUTF8(state)); | 87 WebString::fromUTF8(state)); |
| 86 } | 88 } |
| 87 | 89 |
| 88 void SharedWorkerDevToolsAgent::OnDetach() { | 90 void SharedWorkerDevToolsAgent::OnDetach() { |
| 89 webworker_->detachDevTools(); | 91 webworker_->detachDevTools(); |
| 90 } | 92 } |
| 91 | 93 |
| 92 void SharedWorkerDevToolsAgent::OnDispatchOnInspectorBackend( | 94 void SharedWorkerDevToolsAgent::OnDispatchOnInspectorBackend( |
| 95 int session_id, |
| 93 const std::string& message) { | 96 const std::string& message) { |
| 94 webworker_->dispatchDevToolsMessage(WebString::fromUTF8(message)); | 97 webworker_->dispatchDevToolsMessage(session_id, WebString::fromUTF8(message)); |
| 95 } | 98 } |
| 96 | 99 |
| 97 bool SharedWorkerDevToolsAgent::Send(IPC::Message* message) { | 100 bool SharedWorkerDevToolsAgent::Send(IPC::Message* message) { |
| 98 return ChildThreadImpl::current()->Send(message); | 101 return ChildThreadImpl::current()->Send(message); |
| 99 } | 102 } |
| 100 | 103 |
| 101 } // namespace content | 104 } // namespace content |
| OLD | NEW |