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)); | 398 callbacks->onSuccess(new bool(is_success)); |
400 #else | |
401 callbacks->onSuccess(&is_success); | |
402 #endif | |
403 pending_unregistration_callbacks_.Remove(request_id); | 399 pending_unregistration_callbacks_.Remove(request_id); |
404 } | 400 } |
405 | 401 |
406 void ServiceWorkerDispatcher::OnDidGetRegistration( | 402 void ServiceWorkerDispatcher::OnDidGetRegistration( |
407 int thread_id, | 403 int thread_id, |
408 int request_id, | 404 int request_id, |
409 const ServiceWorkerRegistrationObjectInfo& info, | 405 const ServiceWorkerRegistrationObjectInfo& info, |
410 const ServiceWorkerVersionAttributes& attrs) { | 406 const ServiceWorkerVersionAttributes& attrs) { |
411 TRACE_EVENT_ASYNC_STEP_INTO0( | 407 TRACE_EVENT_ASYNC_STEP_INTO0( |
412 "ServiceWorker", | 408 "ServiceWorker", |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 bool adopt_handle = true; | 756 bool adopt_handle = true; |
761 WebServiceWorkerRegistrationImpl* registration = | 757 WebServiceWorkerRegistrationImpl* registration = |
762 CreateServiceWorkerRegistration(info, adopt_handle); | 758 CreateServiceWorkerRegistration(info, adopt_handle); |
763 registration->SetInstalling(GetServiceWorker(attrs.installing, adopt_handle)); | 759 registration->SetInstalling(GetServiceWorker(attrs.installing, adopt_handle)); |
764 registration->SetWaiting(GetServiceWorker(attrs.waiting, adopt_handle)); | 760 registration->SetWaiting(GetServiceWorker(attrs.waiting, adopt_handle)); |
765 registration->SetActive(GetServiceWorker(attrs.active, adopt_handle)); | 761 registration->SetActive(GetServiceWorker(attrs.active, adopt_handle)); |
766 return registration; | 762 return registration; |
767 } | 763 } |
768 | 764 |
769 } // namespace content | 765 } // namespace content |
OLD | NEW |