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

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

Issue 182863004: Wire provider_id into scriptable API provider to start listening events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
index 8b375adf31cc63baee5d88d9a956b5a2e019c68c..470760dbd8a822b8b377d8489f91420313687b75 100644
--- a/content/child/service_worker/web_service_worker_provider_impl.cc
+++ b/content/child/service_worker/web_service_worker_provider_impl.cc
@@ -9,8 +9,6 @@
#include "content/child/child_thread.h"
#include "content/child/service_worker/service_worker_dispatcher.h"
#include "content/child/thread_safe_sender.h"
-#include "content/common/service_worker/service_worker_messages.h"
-#include "third_party/WebKit/public/platform/WebServiceWorkerProviderClient.h"
#include "third_party/WebKit/public/platform/WebURL.h"
using blink::WebURL;
@@ -18,9 +16,10 @@ using blink::WebURL;
namespace content {
WebServiceWorkerProviderImpl::WebServiceWorkerProviderImpl(
- ThreadSafeSender* thread_safe_sender)
+ ThreadSafeSender* thread_safe_sender,
+ int provider_id)
: thread_safe_sender_(thread_safe_sender),
- client_(NULL) {
+ provider_id_(provider_id) {
}
WebServiceWorkerProviderImpl::~WebServiceWorkerProviderImpl() {
michaeln 2014/03/07 01:26:23 Do we need to send the reset message here to get t
kinuko 2014/03/07 02:02:17 Done. Would be better to ensure that.
@@ -28,24 +27,24 @@ WebServiceWorkerProviderImpl::~WebServiceWorkerProviderImpl() {
void WebServiceWorkerProviderImpl::setClient(
blink::WebServiceWorkerProviderClient* client) {
- // TODO(kinuko): We should register the client with provider_id
- // so that the client can start listening events for the provider.
- client_ = client;
+ GetDispatcher()->SetScriptClient(provider_id_, client);
}
void WebServiceWorkerProviderImpl::registerServiceWorker(
const WebURL& pattern,
const WebURL& script_url,
WebServiceWorkerCallbacks* callbacks) {
- ServiceWorkerDispatcher::ThreadSpecificInstance(thread_safe_sender_)
- ->RegisterServiceWorker(pattern, script_url, callbacks);
+ GetDispatcher()->RegisterServiceWorker(pattern, script_url, callbacks);
}
void WebServiceWorkerProviderImpl::unregisterServiceWorker(
const WebURL& pattern,
WebServiceWorkerCallbacks* callbacks) {
- ServiceWorkerDispatcher::ThreadSpecificInstance(thread_safe_sender_)
- ->UnregisterServiceWorker(pattern, callbacks);
+ GetDispatcher()->UnregisterServiceWorker(pattern, callbacks);
+}
+
+ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() {
+ return ServiceWorkerDispatcher::ThreadSpecificInstance(thread_safe_sender_);
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698