| 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/threading/thread_local.h" | 8 #include "base/threading/thread_local.h" |
| 9 #include "content/child/service_worker/web_service_worker_impl.h" | 9 #include "content/child/service_worker/web_service_worker_impl.h" |
| 10 #include "content/child/thread_safe_sender.h" | 10 #include "content/child/thread_safe_sender.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 return; | 126 return; |
| 127 | 127 |
| 128 callbacks->onSuccess(NULL); | 128 callbacks->onSuccess(NULL); |
| 129 pending_callbacks_.Remove(request_id); | 129 pending_callbacks_.Remove(request_id); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void ServiceWorkerDispatcher::OnRegistrationError( | 132 void ServiceWorkerDispatcher::OnRegistrationError( |
| 133 int32 thread_id, | 133 int32 thread_id, |
| 134 int32 request_id, | 134 int32 request_id, |
| 135 WebServiceWorkerError::ErrorType error_type, | 135 WebServiceWorkerError::ErrorType error_type, |
| 136 const string16& message) { | 136 const base::string16& message) { |
| 137 WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks = | 137 WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks = |
| 138 pending_callbacks_.Lookup(request_id); | 138 pending_callbacks_.Lookup(request_id); |
| 139 DCHECK(callbacks); | 139 DCHECK(callbacks); |
| 140 if (!callbacks) | 140 if (!callbacks) |
| 141 return; | 141 return; |
| 142 | 142 |
| 143 scoped_ptr<WebServiceWorkerError> error( | 143 scoped_ptr<WebServiceWorkerError> error( |
| 144 new WebServiceWorkerError(error_type, message)); | 144 new WebServiceWorkerError(error_type, message)); |
| 145 callbacks->onError(error.release()); | 145 callbacks->onError(error.release()); |
| 146 pending_callbacks_.Remove(request_id); | 146 pending_callbacks_.Remove(request_id); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void ServiceWorkerDispatcher::OnWorkerRunLoopStopped() { delete this; } | 149 void ServiceWorkerDispatcher::OnWorkerRunLoopStopped() { delete this; } |
| 150 | 150 |
| 151 } // namespace content | 151 } // namespace content |
| OLD | NEW |