| 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/browser/message_port_message_filter.h" | 9 #include "content/browser/message_port_message_filter.h" |
| 10 #include "content/browser/message_port_service.h" | 10 #include "content/browser/message_port_service.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 209 } |
| 210 | 210 |
| 211 if (!CanRegisterServiceWorker( | 211 if (!CanRegisterServiceWorker( |
| 212 provider_host->document_url(), pattern, script_url)) { | 212 provider_host->document_url(), pattern, script_url)) { |
| 213 BadMessageReceived(); | 213 BadMessageReceived(); |
| 214 return; | 214 return; |
| 215 } | 215 } |
| 216 GetContext()->RegisterServiceWorker( | 216 GetContext()->RegisterServiceWorker( |
| 217 pattern, | 217 pattern, |
| 218 script_url, | 218 script_url, |
| 219 render_process_id_, | |
| 220 provider_host, | 219 provider_host, |
| 221 base::Bind(&ServiceWorkerDispatcherHost::RegistrationComplete, | 220 base::Bind(&ServiceWorkerDispatcherHost::RegistrationComplete, |
| 222 this, | 221 this, |
| 223 thread_id, | 222 thread_id, |
| 224 provider_id, | 223 provider_id, |
| 225 request_id)); | 224 request_id)); |
| 226 } | 225 } |
| 227 | 226 |
| 228 void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker( | 227 void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker( |
| 229 int thread_id, | 228 int thread_id, |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 status, &error_type, &error_message); | 542 status, &error_type, &error_message); |
| 544 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError( | 543 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError( |
| 545 thread_id, request_id, error_type, error_message)); | 544 thread_id, request_id, error_type, error_message)); |
| 546 } | 545 } |
| 547 | 546 |
| 548 ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() { | 547 ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() { |
| 549 return context_wrapper_->context(); | 548 return context_wrapper_->context(); |
| 550 } | 549 } |
| 551 | 550 |
| 552 } // namespace content | 551 } // namespace content |
| OLD | NEW |