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

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

Issue 23615009: Stub out initial NavigationController browser implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update to ToT Created 7 years, 3 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/service_worker_dispatcher_host.cc
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c531e915e888504b1396aa27dab35bf4db51b7a3
--- /dev/null
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -0,0 +1,50 @@
+// Copyright 2013 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/browser/service_worker/service_worker_dispatcher_host.h"
+
+#include "content/browser/service_worker/service_worker_context.h"
+#include "content/common/service_worker_messages.h"
+#include "ipc/ipc_message_macros.h"
+#include "url/gurl.h"
+
+namespace content {
+
+ServiceWorkerDispatcherHost::ServiceWorkerDispatcherHost(
+ ServiceWorkerContext* context)
+ : context_(context) {}
+
+ServiceWorkerDispatcherHost::~ServiceWorkerDispatcherHost() {}
+
+bool ServiceWorkerDispatcherHost::OnMessageReceived(const IPC::Message& message,
+ bool* message_was_ok) {
+
+ if (IPC_MESSAGE_CLASS(message) != ServiceWorkerMsgStart)
+ return false;
+
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP_EX(
+ ServiceWorkerDispatcherHost, message, *message_was_ok)
+ IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_RegisterServiceWorker,
+ OnRegisterServiceWorker)
+ IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_UnregisterServiceWorker,
+ OnUnregisterServiceWorker)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+
+ return handled;
+}
+
+void ServiceWorkerDispatcherHost::OnRegisterServiceWorker(int32 registry_id,
+ const string16& scope,
+ const GURL& script_url) {
+ // TODO(alecflett): Enforce that script_url must have the same
+ // origin as the registering document.
+}
+
+void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker(
+ int32 registry_id,
+ const string16& scope) {}
+
+} // namespace content
« no previous file with comments | « content/browser/service_worker/service_worker_dispatcher_host.h ('k') | content/browser/storage_partition_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698