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

Unified Diff: content/browser/service_worker/embedded_worker_instance.h

Issue 140893002: Adding slightly clearer separation between SW and EmbeddedWorker (still incomplete) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/service_worker/embedded_worker_instance.h
diff --git a/content/browser/service_worker/embedded_worker_instance.h b/content/browser/service_worker/embedded_worker_instance.h
index fcc2c3481996bc273182379c35b2a4e51ab476ae..00ed7027555b333d47474bcb20b76f4269eb06ba 100644
--- a/content/browser/service_worker/embedded_worker_instance.h
+++ b/content/browser/service_worker/embedded_worker_instance.h
@@ -17,6 +17,10 @@
class GURL;
+namespace IPC {
+class Message;
+}
+
namespace content {
class EmbeddedWorkerRegistry;
@@ -39,6 +43,7 @@ class CONTENT_EXPORT EmbeddedWorkerInstance {
virtual ~Observer() {}
virtual void OnStarted() = 0;
virtual void OnStopped() = 0;
+ virtual void OnMessageReceived(const IPC::Message& message) = 0;
};
~EmbeddedWorkerInstance();
@@ -56,10 +61,10 @@ class CONTENT_EXPORT EmbeddedWorkerInstance {
// IPC couldn't be sent to the worker.
bool Stop();
- // Sends |request| to the embedded worker running in the child process.
+ // Sends |message| to the embedded worker running in the child process.
// This returns false if sending IPC fails.
// It is invalid to call this while the worker is not in RUNNING status.
- bool SendFetchRequest(const ServiceWorkerFetchRequest& request);
+ bool SendMessage(const IPC::Message& message);
// Add or remove |process_id| to the internal process set where this
// worker can be started.
@@ -97,6 +102,10 @@ class CONTENT_EXPORT EmbeddedWorkerInstance {
// STOPPED.
void OnStopped();
+ // Called back from Registry when the worker instance sends message
+ // to the browser (i.e. EmbeddedWorker observers).
+ void OnMessageReceived(const IPC::Message& message);
+
// Chooses a process to start this worker and populate process_id_.
// Returns false when no process is available.
bool ChooseProcess();

Powered by Google App Engine
This is Rietveld 408576698