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

Side by Side Diff: content/browser/service_worker/service_worker_context_wrapper.cc

Issue 1339623002: Make registration.update() no longer force bypassing the HTTP cache (2/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/service_worker/service_worker_context_wrapper.h" 5 #include "content/browser/service_worker/service_worker_context_wrapper.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 void ServiceWorkerContextWrapper::DidFindRegistrationForUpdate( 414 void ServiceWorkerContextWrapper::DidFindRegistrationForUpdate(
415 ServiceWorkerStatusCode status, 415 ServiceWorkerStatusCode status,
416 const scoped_refptr<ServiceWorkerRegistration>& registration) { 416 const scoped_refptr<ServiceWorkerRegistration>& registration) {
417 DCHECK_CURRENTLY_ON(BrowserThread::IO); 417 DCHECK_CURRENTLY_ON(BrowserThread::IO);
418 418
419 if (status != SERVICE_WORKER_OK) 419 if (status != SERVICE_WORKER_OK)
420 return; 420 return;
421 if (!context_core_) 421 if (!context_core_)
422 return; 422 return;
423 DCHECK(registration); 423 DCHECK(registration);
424 // TODO(jungkees): |force_bypass_cache| is set to true because the call stack
425 // is initiated by an update button on DevTools that expects the cache is
426 // bypassed. However, in order to provide options for callers to choose the
427 // cache bypass mode, plumb |force_bypass_cache| through to
428 // UpdateRegistration().
424 context_core_->UpdateServiceWorker(registration.get(), 429 context_core_->UpdateServiceWorker(registration.get(),
425 true /* force_bypass_cache */); 430 true /* force_bypass_cache */);
426 } 431 }
427 432
428 namespace { 433 namespace {
429 434
430 void StatusCodeToBoolCallbackAdapter( 435 void StatusCodeToBoolCallbackAdapter(
431 const ServiceWorkerContext::ResultCallback& callback, 436 const ServiceWorkerContext::ResultCallback& callback,
432 ServiceWorkerStatusCode code) { 437 ServiceWorkerStatusCode code) {
433 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK); 438 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK);
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 observer_list_->Notify(FROM_HERE, 685 observer_list_->Notify(FROM_HERE,
681 &ServiceWorkerContextObserver::OnStorageWiped); 686 &ServiceWorkerContextObserver::OnStorageWiped);
682 } 687 }
683 688
684 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { 689 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() {
685 DCHECK_CURRENTLY_ON(BrowserThread::IO); 690 DCHECK_CURRENTLY_ON(BrowserThread::IO);
686 return context_core_.get(); 691 return context_core_.get();
687 } 692 }
688 693
689 } // namespace content 694 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698