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

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

Issue 25008006: Flush out initial [un]registerServiceWorker roundtrip (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use int64 for workers, remove policy check Created 7 years, 2 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_provider_impl.cc
diff --git a/content/child/service_worker/web_service_worker_provider_impl.cc b/content/child/service_worker/web_service_worker_provider_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ce053f599426c40238d8262a2fcfcac9998a801f
--- /dev/null
+++ b/content/child/service_worker/web_service_worker_provider_impl.cc
@@ -0,0 +1,46 @@
+// 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_provider_impl.h"
+
+#include "base/logging.h"
+#include "content/child/child_thread.h"
+#include "content/child/service_worker/service_worker_dispatcher.h"
+#include "content/child/service_worker/service_worker_message_filter.h"
+#include "content/child/thread_safe_sender.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 {
+
+WebServiceWorkerProviderImpl::WebServiceWorkerProviderImpl(
+ ThreadSafeSender* thread_safe_sender,
+ ServiceWorkerMessageFilter* message_filter,
+ const WebKit::WebURL& origin,
+ scoped_ptr<WebKit::WebServiceWorkerProviderClient> client)
+ : thread_safe_sender_(thread_safe_sender), client_(client.release()) {}
+
+WebServiceWorkerProviderImpl::~WebServiceWorkerProviderImpl() {}
+
+void WebServiceWorkerProviderImpl::registerServiceWorker(
+ const WebURL& pattern,
+ const WebURL& scriptUrl,
+ WebServiceWorkerCallbacks* callbacks) {
+ ServiceWorkerDispatcher::ThreadSpecificInstance(thread_safe_sender_)
+ ->RegisterServiceWorker(pattern, scriptUrl, callbacks);
+}
+
+void WebServiceWorkerProviderImpl::unregisterServiceWorker(
+ const WebURL& pattern,
+ WebServiceWorkerCallbacks* callbacks) {
+ ServiceWorkerDispatcher::ThreadSpecificInstance(thread_safe_sender_)
+ ->UnregisterServiceWorker(pattern, callbacks);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698