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 <utility> | 10 #include <utility> |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 pattern, | 266 pattern, |
267 script_url, | 267 script_url, |
268 continuation)); | 268 continuation)); |
269 return; | 269 return; |
270 } | 270 } |
271 if (!context_core_) { | 271 if (!context_core_) { |
272 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 272 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
273 base::Bind(continuation, false)); | 273 base::Bind(continuation, false)); |
274 return; | 274 return; |
275 } | 275 } |
| 276 ServiceWorkerRegistrationOptions options(net::SimplifyUrlForRequest(pattern)); |
276 context()->RegisterServiceWorker( | 277 context()->RegisterServiceWorker( |
277 net::SimplifyUrlForRequest(pattern), | 278 net::SimplifyUrlForRequest(script_url), options, |
278 net::SimplifyUrlForRequest(script_url), NULL /* provider_host */, | 279 nullptr /* provider_host */, |
279 base::Bind(&FinishRegistrationOnIO, continuation)); | 280 base::Bind(&FinishRegistrationOnIO, continuation)); |
280 } | 281 } |
281 | 282 |
282 static void FinishUnregistrationOnIO( | 283 static void FinishUnregistrationOnIO( |
283 const ServiceWorkerContext::ResultCallback& continuation, | 284 const ServiceWorkerContext::ResultCallback& continuation, |
284 ServiceWorkerStatusCode status) { | 285 ServiceWorkerStatusCode status) { |
285 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 286 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
286 BrowserThread::PostTask( | 287 BrowserThread::PostTask( |
287 BrowserThread::UI, | 288 BrowserThread::UI, |
288 FROM_HERE, | 289 FROM_HERE, |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 service_worker_provider_id, | 1006 service_worker_provider_id, |
1006 std::move(client_ptr_info)); | 1007 std::move(client_ptr_info)); |
1007 } | 1008 } |
1008 | 1009 |
1009 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 1010 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
1010 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1011 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1011 return context_core_.get(); | 1012 return context_core_.get(); |
1012 } | 1013 } |
1013 | 1014 |
1014 } // namespace content | 1015 } // namespace content |
OLD | NEW |