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

Unified Diff: content/child/service_worker/embedded_worker_stub.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_stub.cc
diff --git a/content/child/service_worker/embedded_worker_stub.cc b/content/child/service_worker/embedded_worker_stub.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8c8e706acc728e51a4fb1324e0905cf1ec8ae2f5
--- /dev/null
+++ b/content/child/service_worker/embedded_worker_stub.cc
@@ -0,0 +1,36 @@
+// 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_stub.h"
+
+#include "content/child/child_process.h"
+#include "content/child/child_thread.h"
+
+namespace content {
+
+EmbeddedWorkerStub::EmbeddedWorkerStub(
+ const GURL& script_url,
+ int route_id)
+ : script_url_(script_url),
+ route_id_(route_id) {
+ ChildThread::current()->AddRoute(route_id, this);
michaeln 2013/11/04 22:04:51 The 'routed message' infrastructure is great for d
kinuko 2013/11/05 01:01:51 I expected having each worker's own routing might
+ ChildProcess::current()->AddRefProcess();
+
+ // TODO(kinuko): Initialize DevTools agent.
+ NOTIMPLEMENTED();
+}
+
+EmbeddedWorkerStub::~EmbeddedWorkerStub() {
+ ChildThread::current()->RemoveRoute(route_id_);
+ ChildProcess::current()->ReleaseProcess();
+}
+
+bool EmbeddedWorkerStub::OnMessageReceived(const IPC::Message& message) {
+ // TODO(kinuko): Add IPC messages for start, stop, load scripts etc.
+ bool handled = true;
+ NOTIMPLEMENTED();
+ return handled;
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698