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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 394 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
395 | 395 |
396 if (status != SERVICE_WORKER_OK) | 396 if (status != SERVICE_WORKER_OK) |
397 return; | 397 return; |
398 if (!context_core_.get()) { | 398 if (!context_core_.get()) { |
399 LOG(ERROR) << "ServiceWorkerContextCore is no longer alive."; | 399 LOG(ERROR) << "ServiceWorkerContextCore is no longer alive."; |
400 return; | 400 return; |
401 } | 401 } |
402 DCHECK(registration); | 402 DCHECK(registration); |
403 context_core_->UpdateServiceWorker(registration.get(), | 403 context_core_->UpdateServiceWorker(registration.get(), |
404 true /* force_bypass_cache */); | 404 false /* force_bypass_cache */); |
405 } | 405 } |
406 | 406 |
407 namespace { | 407 namespace { |
408 void StatusCodeToBoolCallbackAdapter( | 408 void StatusCodeToBoolCallbackAdapter( |
409 const ServiceWorkerContext::ResultCallback& callback, | 409 const ServiceWorkerContext::ResultCallback& callback, |
410 ServiceWorkerStatusCode code) { | 410 ServiceWorkerStatusCode code) { |
411 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK); | 411 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK); |
412 } | 412 } |
413 | 413 |
414 void EmptySuccessCallback(bool success) { | 414 void EmptySuccessCallback(bool success) { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 observer_list_->Notify(FROM_HERE, | 643 observer_list_->Notify(FROM_HERE, |
644 &ServiceWorkerContextObserver::OnStorageWiped); | 644 &ServiceWorkerContextObserver::OnStorageWiped); |
645 } | 645 } |
646 | 646 |
647 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 647 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
648 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 648 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
649 return context_core_.get(); | 649 return context_core_.get(); |
650 } | 650 } |
651 | 651 |
652 } // namespace content | 652 } // namespace content |
OLD | NEW |