Chromium Code Reviews| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 // ChildProcessSecurityImpl. See http://crbug.com/311631. | 177 // ChildProcessSecurityImpl. See http://crbug.com/311631. |
| 178 if (!context_ || !ServiceWorkerUtils::IsFeatureEnabled()) { | 178 if (!context_ || !ServiceWorkerUtils::IsFeatureEnabled()) { |
| 179 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError( | 179 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError( |
| 180 thread_id, | 180 thread_id, |
| 181 request_id, | 181 request_id, |
| 182 blink::WebServiceWorkerError::DisabledError, | 182 blink::WebServiceWorkerError::DisabledError, |
| 183 base::ASCIIToUTF16(kDisabledErrorMessage))); | 183 base::ASCIIToUTF16(kDisabledErrorMessage))); |
| 184 return; | 184 return; |
| 185 } | 185 } |
| 186 | 186 |
| 187 ServiceWorkerProviderHost* provider_host = context_->GetProviderHost( | 187 ServiceWorkerProviderHost* provider_host = context_->GetProviderHost( |
|
Jeffrey Yasskin
2014/04/29 00:37:09
I left this lookup alone because it looks like the
| |
| 188 render_process_id_, provider_id); | 188 render_process_id_, provider_id); |
| 189 if (!provider_host) { | 189 if (!provider_host) { |
| 190 BadMessageReceived(); | 190 BadMessageReceived(); |
| 191 return; | 191 return; |
| 192 } | 192 } |
| 193 | 193 |
| 194 context_->UnregisterServiceWorker( | 194 context_->UnregisterServiceWorker( |
| 195 pattern, | 195 pattern, |
| 196 render_process_id_, | |
| 197 provider_host, | |
| 198 base::Bind(&ServiceWorkerDispatcherHost::UnregistrationComplete, | 196 base::Bind(&ServiceWorkerDispatcherHost::UnregistrationComplete, |
| 199 this, | 197 this, |
| 200 thread_id, | 198 thread_id, |
| 201 request_id)); | 199 request_id)); |
| 202 } | 200 } |
| 203 | 201 |
| 204 void ServiceWorkerDispatcherHost::OnPostMessage( | 202 void ServiceWorkerDispatcherHost::OnPostMessage( |
| 205 int handle_id, | 203 int handle_id, |
| 206 const base::string16& message, | 204 const base::string16& message, |
| 207 const std::vector<int>& sent_message_port_ids) { | 205 const std::vector<int>& sent_message_port_ids) { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 ServiceWorkerStatusCode status) { | 374 ServiceWorkerStatusCode status) { |
| 377 base::string16 error_message; | 375 base::string16 error_message; |
| 378 blink::WebServiceWorkerError::ErrorType error_type; | 376 blink::WebServiceWorkerError::ErrorType error_type; |
| 379 GetServiceWorkerRegistrationStatusResponse( | 377 GetServiceWorkerRegistrationStatusResponse( |
| 380 status, &error_type, &error_message); | 378 status, &error_type, &error_message); |
| 381 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError( | 379 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError( |
| 382 thread_id, request_id, error_type, error_message)); | 380 thread_id, request_id, error_type, error_message)); |
| 383 } | 381 } |
| 384 | 382 |
| 385 } // namespace content | 383 } // namespace content |
| OLD | NEW |