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

Unified Diff: content/child/service_worker/embedded_worker_dispatcher.cc

Issue 54573002: Initial child-process side plumbing for starting an embedded ServiceWorker context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated Created 7 years, 1 month 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/child/service_worker/embedded_worker_dispatcher.cc
diff --git a/content/child/service_worker/embedded_worker_dispatcher.cc b/content/child/service_worker/embedded_worker_dispatcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ad662dcf4b31ac7379ad81082c28d0af238c98e6
--- /dev/null
+++ b/content/child/service_worker/embedded_worker_dispatcher.cc
@@ -0,0 +1,32 @@
+// 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/child/service_worker/embedded_worker_dispatcher.h"
+
+#include "content/child/service_worker/embedded_worker_stub.h"
+#include "content/common/service_worker_messages.h"
+
+namespace content {
+
+EmbeddedWorkerDispatcher::EmbeddedWorkerDispatcher() {}
+EmbeddedWorkerDispatcher::~EmbeddedWorkerDispatcher() {}
+
+bool EmbeddedWorkerDispatcher::OnMessageReceived(
+ const IPC::Message& message) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(EmbeddedWorkerDispatcher, message)
+ IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CreateWorker, OnCreateWorker)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
+}
+
+void EmbeddedWorkerDispatcher::OnCreateWorker(
+ const GURL& script_url,
+ int route_id) {
+ // The stub owns itself and manages its lifetime.
+ new EmbeddedWorkerStub(script_url, route_id);
michaeln 2013/11/04 22:04:51 Its odd to see something newed and the ptr value n
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698