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

Unified Diff: content/worker/websharedworker_stub.h

Issue 8399007: Removing dedicated worker-related IPC codei (first round). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: CR feedback Created 9 years, 2 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
« no previous file with comments | « content/content_worker.gypi ('k') | content/worker/websharedworker_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/worker/websharedworker_stub.h
diff --git a/content/worker/websharedworker_stub.h b/content/worker/websharedworker_stub.h
index c52813abadb8f6032a30c34833b7de9970703c77..c372fb29fcb7513bb22feed172b60f6207afeb01 100644
--- a/content/worker/websharedworker_stub.h
+++ b/content/worker/websharedworker_stub.h
@@ -6,9 +6,11 @@
#define CONTENT_WORKER_WEBSHAREDWORKER_STUB_H_
#pragma once
-#include "content/worker/webworker_stub_base.h"
+#include "base/memory/scoped_ptr.h"
#include "content/worker/webworkerclient_proxy.h"
+#include "content/worker/worker_webapplicationcachehost_impl.h"
#include "googleurl/src/gurl.h"
+#include "ipc/ipc_channel.h"
namespace WebKit {
class WebSharedWorker;
@@ -18,7 +20,7 @@ class SharedWorkerDevToolsAgent;
// This class creates a WebSharedWorker, and translates incoming IPCs to the
// appropriate WebSharedWorker APIs.
-class WebSharedWorkerStub : public WebWorkerStubBase {
+class WebSharedWorkerStub : public IPC::Channel::Listener {
public:
WebSharedWorkerStub(const string16& name, int route_id,
const WorkerAppCacheInitInfo& appcache_init_info);
@@ -27,7 +29,22 @@ class WebSharedWorkerStub : public WebWorkerStubBase {
virtual bool OnMessageReceived(const IPC::Message& message);
virtual void OnChannelError();
- virtual const GURL& url() const;
+ // Invoked when the WebWorkerClientProxy is shutting down.
+ void Shutdown();
+
+ // Called after terminating the worker context to make sure that the worker
+ // actually terminates (is not stuck in an infinite loop).
+ void EnsureWorkerContextTerminates();
+
+ WebWorkerClientProxy* client() { return &client_; }
+
+ const WorkerAppCacheInitInfo& appcache_init_info() const {
+ return appcache_init_info_;
+ }
+
+ // Returns the script url of this worker.
+ const GURL& url();
+
private:
virtual ~WebSharedWorkerStub();
@@ -37,6 +54,12 @@ class WebSharedWorkerStub : public WebWorkerStubBase {
const GURL& url, const string16& user_agent, const string16& source_code);
void OnTerminateWorkerContext();
+ int route_id_;
+ WorkerAppCacheInitInfo appcache_init_info_;
+
+ // WebWorkerClient that responds to outgoing API calls from the worker object.
+ WebWorkerClientProxy client_;
+
WebKit::WebSharedWorker* impl_;
string16 name_;
bool started_;
« no previous file with comments | « content/content_worker.gypi ('k') | content/worker/websharedworker_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698