Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3195)

Unified Diff: content/worker/webworker_stub.cc

Issue 6990059: DevTools: devtools message plumbing between worker and page processes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_,

Powered by Google App Engine
This is Rietveld 408576698