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): Plumb |force_bypass_cache| through to UpdateRegistration(). | |
falken
2015/09/10 01:29:24
Does not doing this TODO cause a bug? Can you expl
jungkees
2015/09/10 14:54:12
It doesn't. It's just to provide options to caller
| |
392 context_core_->UpdateServiceWorker(registration.get(), | 393 context_core_->UpdateServiceWorker(registration.get(), |
393 true /* force_bypass_cache */); | 394 true /* force_bypass_cache */); |
394 } | 395 } |
395 | 396 |
396 namespace { | 397 namespace { |
397 void StatusCodeToBoolCallbackAdapter( | 398 void StatusCodeToBoolCallbackAdapter( |
398 const ServiceWorkerContext::ResultCallback& callback, | 399 const ServiceWorkerContext::ResultCallback& callback, |
399 ServiceWorkerStatusCode code) { | 400 ServiceWorkerStatusCode code) { |
400 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK); | 401 callback.Run(code == ServiceWorkerStatusCode::SERVICE_WORKER_OK); |
401 } | 402 } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
630 observer_list_->Notify(FROM_HERE, | 631 observer_list_->Notify(FROM_HERE, |
631 &ServiceWorkerContextObserver::OnStorageWiped); | 632 &ServiceWorkerContextObserver::OnStorageWiped); |
632 } | 633 } |
633 | 634 |
634 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 635 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
635 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 636 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
636 return context_core_.get(); | 637 return context_core_.get(); |
637 } | 638 } |
638 | 639 |
639 } // namespace content | 640 } // namespace content |
OLD | NEW |