| 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/renderer/service_worker/embedded_worker_devtools_agent.h" | 5 #include "content/renderer/service_worker/embedded_worker_devtools_agent.h" |
| 6 | 6 |
| 7 #include "content/child/child_thread.h" | 7 #include "content/child/child_thread.h" |
| 8 #include "content/common/devtools_messages.h" | 8 #include "content/common/devtools_messages.h" |
| 9 #include "content/renderer/render_thread_impl.h" | 9 #include "content/renderer/render_thread_impl.h" |
| 10 #include "third_party/WebKit/public/platform/WebCString.h" | 10 #include "third_party/WebKit/public/platform/WebCString.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 bool EmbeddedWorkerDevToolsAgent::OnMessageReceived( | 30 bool EmbeddedWorkerDevToolsAgent::OnMessageReceived( |
| 31 const IPC::Message& message) { | 31 const IPC::Message& message) { |
| 32 bool handled = true; | 32 bool handled = true; |
| 33 IPC_BEGIN_MESSAGE_MAP(EmbeddedWorkerDevToolsAgent, message) | 33 IPC_BEGIN_MESSAGE_MAP(EmbeddedWorkerDevToolsAgent, message) |
| 34 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_Attach, OnAttach) | 34 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_Attach, OnAttach) |
| 35 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_Reattach, OnReattach) | 35 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_Reattach, OnReattach) |
| 36 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_Detach, OnDetach) | 36 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_Detach, OnDetach) |
| 37 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DispatchOnInspectorBackend, | 37 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DispatchOnInspectorBackend, |
| 38 OnDispatchOnInspectorBackend) | 38 OnDispatchOnInspectorBackend) |
| 39 IPC_MESSAGE_HANDLER(DevToolsAgentMsg_ResumeWorkerContext, | |
| 40 OnResumeWorkerContext) | |
| 41 IPC_MESSAGE_UNHANDLED(handled = false) | 39 IPC_MESSAGE_UNHANDLED(handled = false) |
| 42 IPC_END_MESSAGE_MAP() | 40 IPC_END_MESSAGE_MAP() |
| 43 return handled; | 41 return handled; |
| 44 } | 42 } |
| 45 | 43 |
| 46 void EmbeddedWorkerDevToolsAgent::OnAttach(const std::string& host_id) { | 44 void EmbeddedWorkerDevToolsAgent::OnAttach(const std::string& host_id) { |
| 47 webworker_->attachDevTools(WebString::fromUTF8(host_id)); | 45 webworker_->attachDevTools(WebString::fromUTF8(host_id)); |
| 48 } | 46 } |
| 49 | 47 |
| 50 void EmbeddedWorkerDevToolsAgent::OnReattach(const std::string& host_id, | 48 void EmbeddedWorkerDevToolsAgent::OnReattach(const std::string& host_id, |
| 51 const std::string& state) { | 49 const std::string& state) { |
| 52 webworker_->reattachDevTools(WebString::fromUTF8(host_id), | 50 webworker_->reattachDevTools(WebString::fromUTF8(host_id), |
| 53 WebString::fromUTF8(state)); | 51 WebString::fromUTF8(state)); |
| 54 } | 52 } |
| 55 | 53 |
| 56 void EmbeddedWorkerDevToolsAgent::OnDetach() { | 54 void EmbeddedWorkerDevToolsAgent::OnDetach() { |
| 57 webworker_->detachDevTools(); | 55 webworker_->detachDevTools(); |
| 58 } | 56 } |
| 59 | 57 |
| 60 void EmbeddedWorkerDevToolsAgent::OnDispatchOnInspectorBackend( | 58 void EmbeddedWorkerDevToolsAgent::OnDispatchOnInspectorBackend( |
| 61 const std::string& message) { | 59 const std::string& message) { |
| 62 webworker_->dispatchDevToolsMessage(WebString::fromUTF8(message)); | 60 webworker_->dispatchDevToolsMessage(WebString::fromUTF8(message)); |
| 63 } | 61 } |
| 64 | 62 |
| 65 void EmbeddedWorkerDevToolsAgent::OnResumeWorkerContext() { | |
| 66 webworker_->resumeWorkerContext(); | |
| 67 } | |
| 68 | |
| 69 } // namespace content | 63 } // namespace content |
| OLD | NEW |