| Index: content/worker/webworker_stub.cc
|
| diff --git a/content/worker/webworker_stub.cc b/content/worker/webworker_stub.cc
|
| index 1cf7fdb4431c52783a083030288d89a8cf4698a0..3d67f8d93ed39defdf6c37057fdd43eb5b06fbbd 100644
|
| --- a/content/worker/webworker_stub.cc
|
| +++ b/content/worker/webworker_stub.cc
|
| @@ -6,9 +6,11 @@
|
|
|
| #include "base/command_line.h"
|
| #include "content/common/child_thread.h"
|
| +#include "content/common/content_client.h"
|
| #include "content/common/file_system/file_system_dispatcher.h"
|
| #include "content/common/webmessageportchannel_impl.h"
|
| #include "content/common/worker_messages.h"
|
| +#include "content/worker/content_worker_client.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebWorker.h"
|
| @@ -19,11 +21,16 @@ WebWorkerStub::WebWorkerStub(const GURL& url, int route_id,
|
| const WorkerAppCacheInitInfo& appcache_init_info)
|
| : WebWorkerStubBase(route_id, appcache_init_info),
|
| ALLOW_THIS_IN_INITIALIZER_LIST(impl_(WebWorker::create(client()))),
|
| - url_(url) {
|
| + url_(url),
|
| + devtools_delegate_(NULL) {
|
| + content::GetContentClient()->worker()->WebWorkerStubCreated(this, impl_,
|
| + route_id);
|
| }
|
|
|
| WebWorkerStub::~WebWorkerStub() {
|
| impl_->clientDestroyed();
|
| + if (devtools_delegate_)
|
| + devtools_delegate_->WebWorkerStubDestroyed();
|
| }
|
|
|
| void WebWorkerStub::OnChannelError() {
|
| @@ -34,10 +41,18 @@ const GURL& WebWorkerStub::url() const {
|
| return url_;
|
| }
|
|
|
| +void WebWorkerStub::set_devtools_delegate(DevToolsDelegate* delegate) {
|
| + devtools_delegate_ = delegate;
|
| +}
|
| +
|
| bool WebWorkerStub::OnMessageReceived(const IPC::Message& message) {
|
| if (!impl_)
|
| return false;
|
|
|
| + if (devtools_delegate_ &&
|
| + devtools_delegate_->OnMessageReceived(message))
|
| + return true;
|
| +
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP(WebWorkerStub, message)
|
| IPC_MESSAGE_FORWARD(WorkerMsg_StartWorkerContext, impl_,
|
|
|