| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 73 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
| 74 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 74 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 75 return context_core_.get(); | 75 return context_core_.get(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 static void FinishRegistrationOnIO( | 78 static void FinishRegistrationOnIO( |
| 79 const ServiceWorkerContext::ResultCallback& continuation, | 79 const ServiceWorkerContext::ResultCallback& continuation, |
| 80 ServiceWorkerStatusCode status, | 80 ServiceWorkerStatusCode status, |
| 81 int64 registration_id, | 81 int64 registration_id) { |
| 82 int64 version_id) { | |
| 83 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 82 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 84 BrowserThread::PostTask( | 83 BrowserThread::PostTask( |
| 85 BrowserThread::UI, | 84 BrowserThread::UI, |
| 86 FROM_HERE, | 85 FROM_HERE, |
| 87 base::Bind(continuation, status == SERVICE_WORKER_OK)); | 86 base::Bind(continuation, status == SERVICE_WORKER_OK)); |
| 88 } | 87 } |
| 89 | 88 |
| 90 void ServiceWorkerContextWrapper::RegisterServiceWorker( | 89 void ServiceWorkerContextWrapper::RegisterServiceWorker( |
| 91 const GURL& pattern, | 90 const GURL& pattern, |
| 92 const GURL& script_url, | 91 const GURL& script_url, |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 275 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 277 if (status != SERVICE_WORKER_OK) { | 276 if (status != SERVICE_WORKER_OK) { |
| 278 context_core_.reset(); | 277 context_core_.reset(); |
| 279 return; | 278 return; |
| 280 } | 279 } |
| 281 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this)); | 280 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this)); |
| 282 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully."; | 281 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully."; |
| 283 } | 282 } |
| 284 | 283 |
| 285 } // namespace content | 284 } // namespace content |
| OLD | NEW |