diff options
Diffstat (limited to 'content/child')
-rw-r--r-- | content/child/shared_worker_devtools_agent.cc | 14 | ||||
-rw-r--r-- | content/child/shared_worker_devtools_agent.h | 11 |
2 files changed, 17 insertions, 8 deletions
diff --git a/content/child/shared_worker_devtools_agent.cc b/content/child/shared_worker_devtools_agent.cc index 26a51ed..9b1996f 100644 --- a/content/child/shared_worker_devtools_agent.cc +++ b/content/child/shared_worker_devtools_agent.cc @@ -44,6 +44,7 @@ bool SharedWorkerDevToolsAgent::OnMessageReceived(const IPC::Message& message) { } void SharedWorkerDevToolsAgent::SendDevToolsMessage( + int session_id, int call_id, const blink::WebString& msg, const blink::WebString& state) { @@ -55,6 +56,7 @@ void SharedWorkerDevToolsAgent::SendDevToolsMessage( if (message.length() < kMaxMessageChunkSize) { chunk.data.swap(message); + chunk.session_id = session_id; chunk.call_id = call_id; chunk.post_state = post_state; chunk.is_last = true; @@ -65,6 +67,7 @@ void SharedWorkerDevToolsAgent::SendDevToolsMessage( for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) { chunk.is_last = pos + kMaxMessageChunkSize >= message.length(); + chunk.session_id = chunk.is_last ? session_id : 0; chunk.call_id = chunk.is_last ? call_id : 0; chunk.post_state = chunk.is_last ? post_state : std::string(); chunk.data = message.substr(pos, kMaxMessageChunkSize); @@ -75,13 +78,15 @@ void SharedWorkerDevToolsAgent::SendDevToolsMessage( } } -void SharedWorkerDevToolsAgent::OnAttach(const std::string& host_id) { - webworker_->attachDevTools(WebString::fromUTF8(host_id)); +void SharedWorkerDevToolsAgent::OnAttach(const std::string& host_id, + int session_id) { + webworker_->attachDevTools(WebString::fromUTF8(host_id), session_id); } void SharedWorkerDevToolsAgent::OnReattach(const std::string& host_id, + int session_id, const std::string& state) { - webworker_->reattachDevTools(WebString::fromUTF8(host_id), + webworker_->reattachDevTools(WebString::fromUTF8(host_id), session_id, WebString::fromUTF8(state)); } @@ -90,8 +95,9 @@ void SharedWorkerDevToolsAgent::OnDetach() { } void SharedWorkerDevToolsAgent::OnDispatchOnInspectorBackend( + int session_id, const std::string& message) { - webworker_->dispatchDevToolsMessage(WebString::fromUTF8(message)); + webworker_->dispatchDevToolsMessage(session_id, WebString::fromUTF8(message)); } bool SharedWorkerDevToolsAgent::Send(IPC::Message* message) { diff --git a/content/child/shared_worker_devtools_agent.h b/content/child/shared_worker_devtools_agent.h index 2d6a732..19b1ea9 100644 --- a/content/child/shared_worker_devtools_agent.h +++ b/content/child/shared_worker_devtools_agent.h @@ -27,15 +27,18 @@ class SharedWorkerDevToolsAgent { // Called on the Worker thread. bool OnMessageReceived(const IPC::Message& message); - void SendDevToolsMessage(int call_id, + void SendDevToolsMessage(int session_id, + int call_id, const blink::WebString& message, const blink::WebString& post_state); private: - void OnAttach(const std::string& host_id); - void OnReattach(const std::string& host_id, const std::string& state); + void OnAttach(const std::string& host_id, int session_id); + void OnReattach(const std::string& host_id, + int session_id, + const std::string& state); void OnDetach(); - void OnDispatchOnInspectorBackend(const std::string& message); + void OnDispatchOnInspectorBackend(int session_id, const std::string& message); bool Send(IPC::Message* message); const int route_id_; |