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

Side by Side Diff: content/child/service_worker/web_service_worker_registration_impl.cc

Issue 1175823002: ServiceWorker: Implement ServiceWorkerRegistration.update() (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/service_worker/web_service_worker_registration_impl.h" 5 #include "content/child/service_worker/web_service_worker_registration_impl.h"
6 6
7 #include "content/child/service_worker/service_worker_dispatcher.h" 7 #include "content/child/service_worker/service_worker_dispatcher.h"
8 #include "content/child/service_worker/service_worker_registration_handle_refere nce.h" 8 #include "content/child/service_worker/service_worker_registration_handle_refere nce.h"
9 #include "content/child/service_worker/web_service_worker_impl.h" 9 #include "content/child/service_worker/web_service_worker_impl.h"
10 #include "content/child/service_worker/web_service_worker_provider_impl.h"
10 #include "content/common/service_worker/service_worker_types.h" 11 #include "content/common/service_worker/service_worker_types.h"
11 #include "third_party/WebKit/public/platform/WebServiceWorkerRegistrationProxy.h " 12 #include "third_party/WebKit/public/platform/WebServiceWorkerRegistrationProxy.h "
12 13
13 namespace content { 14 namespace content {
14 15
15 WebServiceWorkerRegistrationImpl::QueuedTask::QueuedTask( 16 WebServiceWorkerRegistrationImpl::QueuedTask::QueuedTask(
16 QueuedTaskType type, 17 QueuedTaskType type,
17 blink::WebServiceWorker* worker) 18 blink::WebServiceWorker* worker)
18 : type(type), 19 : type(type),
19 worker(worker) { 20 worker(worker) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 106
106 blink::WebServiceWorkerRegistrationProxy* 107 blink::WebServiceWorkerRegistrationProxy*
107 WebServiceWorkerRegistrationImpl::proxy() { 108 WebServiceWorkerRegistrationImpl::proxy() {
108 return proxy_; 109 return proxy_;
109 } 110 }
110 111
111 blink::WebURL WebServiceWorkerRegistrationImpl::scope() const { 112 blink::WebURL WebServiceWorkerRegistrationImpl::scope() const {
112 return handle_ref_->scope(); 113 return handle_ref_->scope();
113 } 114 }
114 115
116 void WebServiceWorkerRegistrationImpl::update(
117 blink::WebServiceWorkerProvider* provider) {
118 WebServiceWorkerProviderImpl* provider_impl =
119 static_cast<WebServiceWorkerProviderImpl*>(provider);
120 ServiceWorkerDispatcher* dispatcher =
121 ServiceWorkerDispatcher::GetThreadSpecificInstance();
122 DCHECK(dispatcher);
123 dispatcher->UpdateServiceWorker(provider_impl->provider_id(),
124 registration_id());
125 }
126
115 int64 WebServiceWorkerRegistrationImpl::registration_id() const { 127 int64 WebServiceWorkerRegistrationImpl::registration_id() const {
116 return handle_ref_->registration_id(); 128 return handle_ref_->registration_id();
117 } 129 }
118 130
119 } // namespace content 131 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698