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

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

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: Created 3 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 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 <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 blink::WebServiceWorkerRegistrationProxy* 117 blink::WebServiceWorkerRegistrationProxy*
118 WebServiceWorkerRegistrationImpl::proxy() { 118 WebServiceWorkerRegistrationImpl::proxy() {
119 return proxy_; 119 return proxy_;
120 } 120 }
121 121
122 blink::WebURL WebServiceWorkerRegistrationImpl::scope() const { 122 blink::WebURL WebServiceWorkerRegistrationImpl::scope() const {
123 return handle_ref_->scope(); 123 return handle_ref_->scope();
124 } 124 }
125 125
126 bool WebServiceWorkerRegistrationImpl::useCache() const {
127 return handle_ref_->useCache();
128 }
129
126 void WebServiceWorkerRegistrationImpl::update( 130 void WebServiceWorkerRegistrationImpl::update(
127 blink::WebServiceWorkerProvider* provider, 131 blink::WebServiceWorkerProvider* provider,
128 std::unique_ptr<WebServiceWorkerUpdateCallbacks> callbacks) { 132 std::unique_ptr<WebServiceWorkerUpdateCallbacks> callbacks) {
129 WebServiceWorkerProviderImpl* provider_impl = 133 WebServiceWorkerProviderImpl* provider_impl =
130 static_cast<WebServiceWorkerProviderImpl*>(provider); 134 static_cast<WebServiceWorkerProviderImpl*>(provider);
131 ServiceWorkerDispatcher* dispatcher = 135 ServiceWorkerDispatcher* dispatcher =
132 ServiceWorkerDispatcher::GetThreadSpecificInstance(); 136 ServiceWorkerDispatcher::GetThreadSpecificInstance();
133 DCHECK(dispatcher); 137 DCHECK(dispatcher);
134 dispatcher->UpdateServiceWorker(provider_impl->provider_id(), 138 dispatcher->UpdateServiceWorker(provider_impl->provider_id(),
135 registrationId(), std::move(callbacks)); 139 registrationId(), std::move(callbacks));
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 205 }
202 206
203 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() { 207 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() {
204 ServiceWorkerDispatcher* dispatcher = 208 ServiceWorkerDispatcher* dispatcher =
205 ServiceWorkerDispatcher::GetThreadSpecificInstance(); 209 ServiceWorkerDispatcher::GetThreadSpecificInstance();
206 if (dispatcher) 210 if (dispatcher)
207 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id()); 211 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id());
208 } 212 }
209 213
210 } // namespace content 214 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698