OLD | NEW |
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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 void ServiceWorkerContextWrapper::DidFindRegistrationForUpdate( | 430 void ServiceWorkerContextWrapper::DidFindRegistrationForUpdate( |
431 ServiceWorkerStatusCode status, | 431 ServiceWorkerStatusCode status, |
432 const scoped_refptr<ServiceWorkerRegistration>& registration) { | 432 const scoped_refptr<ServiceWorkerRegistration>& registration) { |
433 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 433 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
434 | 434 |
435 if (status != SERVICE_WORKER_OK) | 435 if (status != SERVICE_WORKER_OK) |
436 return; | 436 return; |
437 if (!context_core_) | 437 if (!context_core_) |
438 return; | 438 return; |
439 DCHECK(registration); | 439 DCHECK(registration); |
| 440 // TODO(jungkees): |force_bypass_cache| is set to true because the call stack |
| 441 // is initiated by an update button on DevTools that expects the cache is |
| 442 // bypassed. However, in order to provide options for callers to choose the |
| 443 // cache bypass mode, plumb |force_bypass_cache| through to |
| 444 // UpdateRegistration(). |
440 context_core_->UpdateServiceWorker(registration.get(), | 445 context_core_->UpdateServiceWorker(registration.get(), |
441 true /* force_bypass_cache */); | 446 true /* force_bypass_cache */); |
442 } | 447 } |
443 | 448 |
444 namespace { | 449 namespace { |
445 | 450 |
446 void StatusCodeToBoolCallbackAdapter( | 451 void StatusCodeToBoolCallbackAdapter( |
447 const ServiceWorkerContext::ResultCallback& callback, | 452 const ServiceWorkerContext::ResultCallback& callback, |
448 ServiceWorkerStatusCode code) { | 453 ServiceWorkerStatusCode code) { |
449 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK); | 454 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 observer_list_->Notify(FROM_HERE, | 701 observer_list_->Notify(FROM_HERE, |
697 &ServiceWorkerContextObserver::OnStorageWiped); | 702 &ServiceWorkerContextObserver::OnStorageWiped); |
698 } | 703 } |
699 | 704 |
700 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 705 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
701 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 706 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
702 return context_core_.get(); | 707 return context_core_.get(); |
703 } | 708 } |
704 | 709 |
705 } // namespace content | 710 } // namespace content |
OLD | NEW |