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/child/service_worker/service_worker_dispatcher.h" | 5 #include "content/child/service_worker/service_worker_dispatcher.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "base/threading/thread_local.h" | 10 #include "base/threading/thread_local.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 request_id, | 388 request_id, |
389 "OnUnregistered"); | 389 "OnUnregistered"); |
390 TRACE_EVENT_ASYNC_END0("ServiceWorker", | 390 TRACE_EVENT_ASYNC_END0("ServiceWorker", |
391 "ServiceWorkerDispatcher::UnregisterServiceWorker", | 391 "ServiceWorkerDispatcher::UnregisterServiceWorker", |
392 request_id); | 392 request_id); |
393 WebServiceWorkerUnregistrationCallbacks* callbacks = | 393 WebServiceWorkerUnregistrationCallbacks* callbacks = |
394 pending_unregistration_callbacks_.Lookup(request_id); | 394 pending_unregistration_callbacks_.Lookup(request_id); |
395 DCHECK(callbacks); | 395 DCHECK(callbacks); |
396 if (!callbacks) | 396 if (!callbacks) |
397 return; | 397 return; |
| 398 #ifdef CRBUG_493531 |
| 399 callbacks->onSuccess(new bool(is_success)); |
| 400 #else |
398 callbacks->onSuccess(&is_success); | 401 callbacks->onSuccess(&is_success); |
| 402 #endif |
399 pending_unregistration_callbacks_.Remove(request_id); | 403 pending_unregistration_callbacks_.Remove(request_id); |
400 } | 404 } |
401 | 405 |
402 void ServiceWorkerDispatcher::OnDidGetRegistration( | 406 void ServiceWorkerDispatcher::OnDidGetRegistration( |
403 int thread_id, | 407 int thread_id, |
404 int request_id, | 408 int request_id, |
405 const ServiceWorkerRegistrationObjectInfo& info, | 409 const ServiceWorkerRegistrationObjectInfo& info, |
406 const ServiceWorkerVersionAttributes& attrs) { | 410 const ServiceWorkerVersionAttributes& attrs) { |
407 TRACE_EVENT_ASYNC_STEP_INTO0( | 411 TRACE_EVENT_ASYNC_STEP_INTO0( |
408 "ServiceWorker", | 412 "ServiceWorker", |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 bool adopt_handle = true; | 760 bool adopt_handle = true; |
757 WebServiceWorkerRegistrationImpl* registration = | 761 WebServiceWorkerRegistrationImpl* registration = |
758 CreateServiceWorkerRegistration(info, adopt_handle); | 762 CreateServiceWorkerRegistration(info, adopt_handle); |
759 registration->SetInstalling(GetServiceWorker(attrs.installing, adopt_handle)); | 763 registration->SetInstalling(GetServiceWorker(attrs.installing, adopt_handle)); |
760 registration->SetWaiting(GetServiceWorker(attrs.waiting, adopt_handle)); | 764 registration->SetWaiting(GetServiceWorker(attrs.waiting, adopt_handle)); |
761 registration->SetActive(GetServiceWorker(attrs.active, adopt_handle)); | 765 registration->SetActive(GetServiceWorker(attrs.active, adopt_handle)); |
762 return registration; | 766 return registration; |
763 } | 767 } |
764 | 768 |
765 } // namespace content | 769 } // namespace content |
OLD | NEW |