Index: content/worker/websharedworker_stub.cc |
diff --git a/content/worker/websharedworker_stub.cc b/content/worker/websharedworker_stub.cc |
index 3ecf598fd6b8fc570b69a4ca678e4e08f31817dc..da16b158e56562b9170665c7c539cc2dfb4a43a2 100644 |
--- a/content/worker/websharedworker_stub.cc |
+++ b/content/worker/websharedworker_stub.cc |
@@ -8,6 +8,7 @@ |
#include "content/common/file_system/file_system_dispatcher.h" |
#include "content/common/webmessageportchannel_impl.h" |
#include "content/common/worker_messages.h" |
+#include "content/worker/worker_devtools_agent.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSharedWorker.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" |
@@ -17,9 +18,13 @@ WebSharedWorkerStub::WebSharedWorkerStub( |
const WorkerAppCacheInitInfo& appcache_init_info) |
: WebWorkerStubBase(route_id, appcache_init_info), |
name_(name), |
- started_(false) { |
+ started_(false), |
+ worker_devtools_agent_(NULL) { |
// TODO(atwilson): Add support for NaCl when they support MessagePorts. |
impl_ = WebKit::WebSharedWorker::create(client()); |
+ worker_devtools_agent_.reset(WorkerDevToolsAgent::CreateForSharedWorker( |
+ route_id, impl_)); |
+ client()->set_devtools_agent(worker_devtools_agent_.get()); |
} |
WebSharedWorkerStub::~WebSharedWorkerStub() { |
@@ -27,6 +32,9 @@ WebSharedWorkerStub::~WebSharedWorkerStub() { |
} |
bool WebSharedWorkerStub::OnMessageReceived(const IPC::Message& message) { |
+ if (worker_devtools_agent_->OnMessageReceived(message)) |
+ return true; |
+ |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP(WebSharedWorkerStub, message) |
IPC_MESSAGE_HANDLER(WorkerMsg_StartWorkerContext, OnStartWorkerContext) |