| 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_dispatcher_host.h" | 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/message_port_message_filter.h" | 10 #include "content/browser/message_port_message_filter.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 } | 202 } |
| 203 | 203 |
| 204 scoped_ptr<ServiceWorkerRegistrationHandle> new_handle( | 204 scoped_ptr<ServiceWorkerRegistrationHandle> new_handle( |
| 205 new ServiceWorkerRegistrationHandle( | 205 new ServiceWorkerRegistrationHandle( |
| 206 GetContext()->AsWeakPtr(), this, provider_id, registration)); | 206 GetContext()->AsWeakPtr(), this, provider_id, registration)); |
| 207 handle = new_handle.get(); | 207 handle = new_handle.get(); |
| 208 RegisterServiceWorkerRegistrationHandle(new_handle.Pass()); | 208 RegisterServiceWorkerRegistrationHandle(new_handle.Pass()); |
| 209 return handle; | 209 return handle; |
| 210 } | 210 } |
| 211 | 211 |
| 212 ServiceWorkerRegistrationHandle* |
| 213 ServiceWorkerDispatcherHost::GetRegistrationHandle(int registration_handle_id) { |
| 214 return registration_handles_.Lookup(registration_handle_id); |
| 215 } |
| 216 |
| 212 void ServiceWorkerDispatcherHost::RegisterServiceWorkerHandle( | 217 void ServiceWorkerDispatcherHost::RegisterServiceWorkerHandle( |
| 213 scoped_ptr<ServiceWorkerHandle> handle) { | 218 scoped_ptr<ServiceWorkerHandle> handle) { |
| 214 int handle_id = handle->handle_id(); | 219 int handle_id = handle->handle_id(); |
| 215 handles_.AddWithID(handle.release(), handle_id); | 220 handles_.AddWithID(handle.release(), handle_id); |
| 216 } | 221 } |
| 217 | 222 |
| 218 void ServiceWorkerDispatcherHost::RegisterServiceWorkerRegistrationHandle( | 223 void ServiceWorkerDispatcherHost::RegisterServiceWorkerRegistrationHandle( |
| 219 scoped_ptr<ServiceWorkerRegistrationHandle> handle) { | 224 scoped_ptr<ServiceWorkerRegistrationHandle> handle) { |
| 220 int handle_id = handle->handle_id(); | 225 int handle_id = handle->handle_id(); |
| 221 registration_handles_.AddWithID(handle.release(), handle_id); | 226 registration_handles_.AddWithID(handle.release(), handle_id); |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 status, &error_type, &error_message); | 767 status, &error_type, &error_message); |
| 763 Send(new ServiceWorkerMsg_ServiceWorkerGetRegistrationError( | 768 Send(new ServiceWorkerMsg_ServiceWorkerGetRegistrationError( |
| 764 thread_id, request_id, error_type, error_message)); | 769 thread_id, request_id, error_type, error_message)); |
| 765 } | 770 } |
| 766 | 771 |
| 767 ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() { | 772 ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() { |
| 768 return context_wrapper_->context(); | 773 return context_wrapper_->context(); |
| 769 } | 774 } |
| 770 | 775 |
| 771 } // namespace content | 776 } // namespace content |
| OLD | NEW |