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

Unified Diff: content/renderer/service_worker/service_worker_script_context.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: nit fixes 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
« no previous file with comments | « content/renderer/service_worker/service_worker_script_context.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/service_worker/service_worker_script_context.cc
diff --git a/content/renderer/service_worker/service_worker_script_context.cc b/content/renderer/service_worker/service_worker_script_context.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e29dd3233f5c352bec277de2c8ee61a90750afa2
--- /dev/null
+++ b/content/renderer/service_worker/service_worker_script_context.cc
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/renderer/service_worker/service_worker_script_context.h"
+
+#include "base/logging.h"
+#include "content/common/service_worker/service_worker_messages.h"
+#include "content/renderer/service_worker/embedded_worker_context_client.h"
+#include "ipc/ipc_message.h"
+#include "third_party/WebKit/public/web/WebServiceWorkerContextProxy.h"
+
+namespace content {
+
+ServiceWorkerScriptContext::ServiceWorkerScriptContext(
+ EmbeddedWorkerContextClient* embedded_context,
+ blink::WebServiceWorkerContextProxy* proxy)
+ : embedded_context_(embedded_context),
+ proxy_(proxy) {
+}
+
+ServiceWorkerScriptContext::~ServiceWorkerScriptContext() {}
+
+void ServiceWorkerScriptContext::OnMessageReceived(
+ const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(ServiceWorkerScriptContext, message)
+ IPC_MESSAGE_HANDLER(ServiceWorkerMsg_FetchEvent, OnFetchEvent)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ DCHECK(handled);
+}
+
+void ServiceWorkerScriptContext::Send(const IPC::Message& message) {
+ embedded_context_->SendMessageToBrowser(message);
+}
+
+void ServiceWorkerScriptContext::OnFetchEvent(
+ const ServiceWorkerFetchRequest& request) {
+ NOTIMPLEMENTED();
+}
+
+} // namespace content
« no previous file with comments | « content/renderer/service_worker/service_worker_script_context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698