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

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

Issue 1380323002: Make registration.update() no longer force bypassing the HTTP cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 void ServiceWorkerContextWrapper::DidFindRegistrationForUpdate( 409 void ServiceWorkerContextWrapper::DidFindRegistrationForUpdate(
410 ServiceWorkerStatusCode status, 410 ServiceWorkerStatusCode status,
411 const scoped_refptr<ServiceWorkerRegistration>& registration) { 411 const scoped_refptr<ServiceWorkerRegistration>& registration) {
412 DCHECK_CURRENTLY_ON(BrowserThread::IO); 412 DCHECK_CURRENTLY_ON(BrowserThread::IO);
413 413
414 if (status != SERVICE_WORKER_OK) 414 if (status != SERVICE_WORKER_OK)
415 return; 415 return;
416 if (!context_core_) 416 if (!context_core_)
417 return; 417 return;
418 DCHECK(registration); 418 DCHECK(registration);
419 // TODO(jungkees): |force_bypass_cache| is set to true because the call stack
420 // is initiated by an update button on DevTools that expects the cache is
421 // bypassed. However, in order to provide options for callers to choose the
422 // cache bypass mode, plumb |force_bypass_cache| through to
423 // UpdateRegistration().
419 context_core_->UpdateServiceWorker(registration.get(), 424 context_core_->UpdateServiceWorker(registration.get(),
420 true /* force_bypass_cache */); 425 true /* force_bypass_cache */);
421 } 426 }
422 427
423 namespace { 428 namespace {
424 429
425 void StatusCodeToBoolCallbackAdapter( 430 void StatusCodeToBoolCallbackAdapter(
426 const ServiceWorkerContext::ResultCallback& callback, 431 const ServiceWorkerContext::ResultCallback& callback,
427 ServiceWorkerStatusCode code) { 432 ServiceWorkerStatusCode code) {
428 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK); 433 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK);
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 observer_list_->Notify(FROM_HERE, 680 observer_list_->Notify(FROM_HERE,
676 &ServiceWorkerContextObserver::OnStorageWiped); 681 &ServiceWorkerContextObserver::OnStorageWiped);
677 } 682 }
678 683
679 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { 684 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() {
680 DCHECK_CURRENTLY_ON(BrowserThread::IO); 685 DCHECK_CURRENTLY_ON(BrowserThread::IO);
681 return context_core_.get(); 686 return context_core_.get();
682 } 687 }
683 688
684 } // namespace content 689 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698