| 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 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 this, | 99 this, |
| 100 pattern, | 100 pattern, |
| 101 script_url, | 101 script_url, |
| 102 continuation)); | 102 continuation)); |
| 103 return; | 103 return; |
| 104 } | 104 } |
| 105 | 105 |
| 106 context()->RegisterServiceWorker( | 106 context()->RegisterServiceWorker( |
| 107 pattern, | 107 pattern, |
| 108 script_url, | 108 script_url, |
| 109 -1, | |
| 110 NULL /* provider_host */, | 109 NULL /* provider_host */, |
| 111 base::Bind(&FinishRegistrationOnIO, continuation)); | 110 base::Bind(&FinishRegistrationOnIO, continuation)); |
| 112 } | 111 } |
| 113 | 112 |
| 114 static void FinishUnregistrationOnIO( | 113 static void FinishUnregistrationOnIO( |
| 115 const ServiceWorkerContext::ResultCallback& continuation, | 114 const ServiceWorkerContext::ResultCallback& continuation, |
| 116 ServiceWorkerStatusCode status) { | 115 ServiceWorkerStatusCode status) { |
| 117 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 116 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 118 BrowserThread::PostTask( | 117 BrowserThread::PostTask( |
| 119 BrowserThread::UI, | 118 BrowserThread::UI, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 276 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 278 if (status != SERVICE_WORKER_OK) { | 277 if (status != SERVICE_WORKER_OK) { |
| 279 context_core_.reset(); | 278 context_core_.reset(); |
| 280 return; | 279 return; |
| 281 } | 280 } |
| 282 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this)); | 281 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this)); |
| 283 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully."; | 282 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully."; |
| 284 } | 283 } |
| 285 | 284 |
| 286 } // namespace content | 285 } // namespace content |
| OLD | NEW |