| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 void ServiceWorkerContextWrapper::DidFindRegistrationForUpdate( | 382 void ServiceWorkerContextWrapper::DidFindRegistrationForUpdate( |
| 383 ServiceWorkerStatusCode status, | 383 ServiceWorkerStatusCode status, |
| 384 const scoped_refptr<ServiceWorkerRegistration>& registration) { | 384 const scoped_refptr<ServiceWorkerRegistration>& registration) { |
| 385 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 385 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 386 | 386 |
| 387 if (status != SERVICE_WORKER_OK) | 387 if (status != SERVICE_WORKER_OK) |
| 388 return; | 388 return; |
| 389 if (!context_core_) | 389 if (!context_core_) |
| 390 return; | 390 return; |
| 391 DCHECK(registration); | 391 DCHECK(registration); |
| 392 // TODO(jungkees): |force_bypass_cache| is set to true because the call stack |
| 393 // is initiated by an update button on DevTools that expects the cache is |
| 394 // bypassed. However, in order to provide options for callers to choose the |
| 395 // cache bypass mode, plumb |force_bypass_cache| through to |
| 396 // UpdateRegistration(). |
| 392 context_core_->UpdateServiceWorker(registration.get(), | 397 context_core_->UpdateServiceWorker(registration.get(), |
| 393 true /* force_bypass_cache */); | 398 true /* force_bypass_cache */); |
| 394 } | 399 } |
| 395 | 400 |
| 396 namespace { | 401 namespace { |
| 397 void StatusCodeToBoolCallbackAdapter( | 402 void StatusCodeToBoolCallbackAdapter( |
| 398 const ServiceWorkerContext::ResultCallback& callback, | 403 const ServiceWorkerContext::ResultCallback& callback, |
| 399 ServiceWorkerStatusCode code) { | 404 ServiceWorkerStatusCode code) { |
| 400 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK); | 405 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK); |
| 401 } | 406 } |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 observer_list_->Notify(FROM_HERE, | 635 observer_list_->Notify(FROM_HERE, |
| 631 &ServiceWorkerContextObserver::OnStorageWiped); | 636 &ServiceWorkerContextObserver::OnStorageWiped); |
| 632 } | 637 } |
| 633 | 638 |
| 634 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 639 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
| 635 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 640 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 636 return context_core_.get(); | 641 return context_core_.get(); |
| 637 } | 642 } |
| 638 | 643 |
| 639 } // namespace content | 644 } // namespace content |
| OLD | NEW |