| 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 "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "content/browser/service_worker/service_worker_context_core.h" | 8 #include "content/browser/service_worker/service_worker_context_core.h" |
| 9 #include "content/browser/service_worker/service_worker_context_observer.h" | 9 #include "content/browser/service_worker/service_worker_context_observer.h" |
| 10 #include "content/browser/service_worker/service_worker_process_manager.h" | 10 #include "content/browser/service_worker/service_worker_process_manager.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 ServiceWorkerStatusCode status) { | 102 ServiceWorkerStatusCode status) { |
| 103 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 103 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 104 BrowserThread::PostTask( | 104 BrowserThread::PostTask( |
| 105 BrowserThread::UI, | 105 BrowserThread::UI, |
| 106 FROM_HERE, | 106 FROM_HERE, |
| 107 base::Bind(continuation, status == SERVICE_WORKER_OK)); | 107 base::Bind(continuation, status == SERVICE_WORKER_OK)); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void ServiceWorkerContextWrapper::UnregisterServiceWorker( | 110 void ServiceWorkerContextWrapper::UnregisterServiceWorker( |
| 111 const GURL& pattern, | 111 const GURL& pattern, |
| 112 int source_process_id, | |
| 113 const ResultCallback& continuation) { | 112 const ResultCallback& continuation) { |
| 114 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { | 113 if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
| 115 BrowserThread::PostTask( | 114 BrowserThread::PostTask( |
| 116 BrowserThread::IO, | 115 BrowserThread::IO, |
| 117 FROM_HERE, | 116 FROM_HERE, |
| 118 base::Bind(&ServiceWorkerContextWrapper::UnregisterServiceWorker, | 117 base::Bind(&ServiceWorkerContextWrapper::UnregisterServiceWorker, |
| 119 this, | 118 this, |
| 120 pattern, | 119 pattern, |
| 121 source_process_id, | |
| 122 continuation)); | 120 continuation)); |
| 123 return; | 121 return; |
| 124 } | 122 } |
| 125 | 123 |
| 126 context()->UnregisterServiceWorker( | 124 context()->UnregisterServiceWorker( |
| 127 pattern, | 125 pattern, |
| 128 source_process_id, | |
| 129 NULL /* provider_host */, | |
| 130 base::Bind(&FinishUnregistrationOnIO, continuation)); | 126 base::Bind(&FinishUnregistrationOnIO, continuation)); |
| 131 } | 127 } |
| 132 | 128 |
| 133 void ServiceWorkerContextWrapper::AddObserver( | 129 void ServiceWorkerContextWrapper::AddObserver( |
| 134 ServiceWorkerContextObserver* observer) { | 130 ServiceWorkerContextObserver* observer) { |
| 135 observer_list_->AddObserver(observer); | 131 observer_list_->AddObserver(observer); |
| 136 } | 132 } |
| 137 | 133 |
| 138 void ServiceWorkerContextWrapper::RemoveObserver( | 134 void ServiceWorkerContextWrapper::RemoveObserver( |
| 139 ServiceWorkerContextObserver* observer) { | 135 ServiceWorkerContextObserver* observer) { |
| 140 observer_list_->RemoveObserver(observer); | 136 observer_list_->RemoveObserver(observer); |
| 141 } | 137 } |
| 142 | 138 |
| 143 } // namespace content | 139 } // namespace content |
| OLD | NEW |