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

Unified Diff: content/browser/shared_worker/shared_worker_host.h

Issue 182693002: Implement some mothods in SharedWorkerHost and SharedWorkerServiceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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/browser/shared_worker/shared_worker_host.h
diff --git a/content/browser/shared_worker/shared_worker_host.h b/content/browser/shared_worker/shared_worker_host.h
index b12487c7fd392391815f7cab383e4bff60bf1037..984e75de0ccb8781102a2ca0338531b39708e92e 100644
--- a/content/browser/shared_worker/shared_worker_host.h
+++ b/content/browser/shared_worker/shared_worker_host.h
@@ -8,6 +8,13 @@
#include <vector>
#include "base/memory/scoped_ptr.h"
+#include "base/strings/string16.h"
+
+class GURL;
+
+namespace IPC {
+class Message;
+}
namespace content {
class SharedWorkerMessageFilter;
@@ -20,15 +27,57 @@ class SharedWorkerHost {
explicit SharedWorkerHost(SharedWorkerInstance* instance);
~SharedWorkerHost();
+ // Sends the message to the SharedWorker in a renderer process.
kinuko 2014/02/27 11:34:44 nit: message -> |message| for parameters here and
horo 2014/02/28 04:59:14 Done.
+ bool Send(IPC::Message* message);
+
// Starts the SharedWorker in the renderer process which is associated with
// |filter|.
void Init(SharedWorkerMessageFilter* filter);
+ // Returns true iff the given message from a renderer process was forwarded to
+ // the worker.
+ bool FilterMessage(const IPC::Message& message,
+ SharedWorkerMessageFilter* filter);
+
+ // Handles the shutdown of the filter. If the worker has no other client,
+ // sends TerminateWorkerContext message to shut it down.
+ void FilterShutdown(SharedWorkerMessageFilter* filter);
+
+ // Shuts down any shared workers that are no longer referenced by active
+ // documents.
+ void DocumentDetached(SharedWorkerMessageFilter* filter,
+ unsigned long long document_id);
+
+ void WorkerContextClosed();
+ void WorkerScriptLoaded();
+ void WorkerScriptLoadFailed();
+ void WorkerConnected(int message_port_id);
+ void WorkerContextDestroyed();
+ void AllowDatabase(const GURL& url,
+ const base::string16& name,
+ const base::string16& display_name,
+ unsigned long estimated_size,
+ bool* result);
+ void AllowFileSystem(const GURL& url, bool* result);
+ void AllowIndexedDB(const GURL& url,
+ const base::string16& name,
+ bool* result);
+
SharedWorkerInstance* instance() { return instance_.get(); }
+ SharedWorkerMessageFilter* parent_render_filter() const {
+ return parent_render_filter_;
+ }
int worker_route_id() const { return worker_route_id_; }
private:
+ // Relays a message to the given endpoint. Takes care of parsing the message
kinuko 2014/02/27 11:34:44 'given endpoint' is not obvious from the signature
horo 2014/02/28 04:59:14 Done.
+ // if it contains a message port and sending it a valid route id.
+ void RelayMessage(const IPC::Message& message,
+ SharedWorkerMessageFilter* incoming_filter);
+
scoped_ptr<SharedWorkerInstance> instance_;
+ SharedWorkerMessageFilter* parent_render_filter_;
kinuko 2014/02/27 11:34:44 Is this filter to talk to a shared worker, but not
horo 2014/02/28 04:59:14 Done.
+ int parent_render_process_id_;
int worker_route_id_;
DISALLOW_COPY_AND_ASSIGN(SharedWorkerHost);

Powered by Google App Engine
This is Rietveld 408576698