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

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

Issue 25008006: Flush out initial [un]registerServiceWorker roundtrip (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/child/service_worker/web_service_worker_registry_proxy.cc
diff --git a/content/child/service_worker/web_service_worker_registry_proxy.cc b/content/child/service_worker/web_service_worker_registry_proxy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2f1e89851bff523e23e5a5daba3cb13364a2d434
--- /dev/null
+++ b/content/child/service_worker/web_service_worker_registry_proxy.cc
@@ -0,0 +1,37 @@
+// 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/web_service_worker_registry_proxy.h"
+
+#include "base/logging.h"
+#include "content/child/child_thread.h"
+#include "content/child/service_worker/service_worker_dispatcher.h"
+#include "content/common/service_worker_messages.h"
+#include "ipc/ipc_sender.h"
+#include "third_party/WebKit/public/platform/WebString.h"
+#include "third_party/WebKit/public/platform/WebURL.h"
+
+using WebKit::WebString;
+using WebKit::WebURL;
+
+namespace content {
+
+WebServiceWorkerRegistryImpl::~WebServiceWorkerRegistryImpl() {}
+
+void WebServiceWorkerRegistryImpl::registerServiceWorker(
+ const WebString& pattern,
+ const WebURL& scriptUrl,
+ WebServiceWorkerCallbacks* callbacks) {
+ ChildThread::current()->service_worker_dispatcher()->RegisterServiceWorker(
+ pattern, scriptUrl, callbacks);
kinuko 2013/09/30 12:41:17 So we start with an assumption that we call this o
alecflett 2013/10/01 00:17:04 Well my intention was to support any main or worke
kinuko 2013/10/01 07:48:11 ChildThread::current() returns null on non-main th
+}
+
+void WebServiceWorkerRegistryImpl::unregisterServiceWorker(
+ const WebString& pattern,
+ WebServiceWorkerCallbacks* callbacks) {
+ ChildThread::current()->service_worker_dispatcher()->UnregisterServiceWorker(
+ pattern, callbacks);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698