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

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

Issue 140893002: Adding slightly clearer separation between SW and EmbeddedWorker (still incomplete) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added TODO to filter messages on the browser side 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.cc
diff --git a/content/browser/service_worker/embedded_worker_instance.cc b/content/browser/service_worker/embedded_worker_instance.cc
index a376562913c51b7794f2be651eafa1826f256004..7cfd5cbbac994c693026549af6e21e7730739e33 100644
--- a/content/browser/service_worker/embedded_worker_instance.cc
+++ b/content/browser/service_worker/embedded_worker_instance.cc
@@ -6,6 +6,7 @@
#include "content/browser/service_worker/embedded_worker_registry.h"
#include "content/common/service_worker/embedded_worker_messages.h"
+#include "ipc/ipc_message.h"
#include "url/gurl.h"
namespace content {
@@ -41,14 +42,11 @@ bool EmbeddedWorkerInstance::Stop() {
return success;
}
-bool EmbeddedWorkerInstance::SendFetchRequest(
- const ServiceWorkerFetchRequest& request) {
+bool EmbeddedWorkerInstance::SendMessage(const IPC::Message& message) {
DCHECK(status_ == RUNNING);
- // TODO: Refine this code, the code around FetchEvent is currently very
- // rough, mainly just for a placeholder for now.
return registry_->Send(process_id_,
- new EmbeddedWorkerContextMsg_FetchEvent(
- thread_id_, embedded_worker_id_, request));
+ new EmbeddedWorkerContextMsg_SendMessageToWorker(
+ thread_id_, embedded_worker_id_, message));
}
void EmbeddedWorkerInstance::AddProcessReference(int process_id) {
@@ -95,6 +93,10 @@ void EmbeddedWorkerInstance::OnStopped() {
FOR_EACH_OBSERVER(Observer, observer_list_, OnStopped());
}
+void EmbeddedWorkerInstance::OnMessageReceived(const IPC::Message& message) {
+ FOR_EACH_OBSERVER(Observer, observer_list_, OnMessageReceived(message));
+}
+
void EmbeddedWorkerInstance::AddObserver(Observer* observer) {
observer_list_.AddObserver(observer);
}
« no previous file with comments | « content/browser/service_worker/embedded_worker_instance.h ('k') | content/browser/service_worker/embedded_worker_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698