| 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 "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "content/browser/message_port_message_filter.h" | 10 #include "content/browser/message_port_message_filter.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 OnDecrementServiceWorkerRefCount) | 193 OnDecrementServiceWorkerRefCount) |
| 194 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_IncrementRegistrationRefCount, | 194 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_IncrementRegistrationRefCount, |
| 195 OnIncrementRegistrationRefCount) | 195 OnIncrementRegistrationRefCount) |
| 196 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_DecrementRegistrationRefCount, | 196 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_DecrementRegistrationRefCount, |
| 197 OnDecrementRegistrationRefCount) | 197 OnDecrementRegistrationRefCount) |
| 198 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_TerminateWorker, OnTerminateWorker) | 198 IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_TerminateWorker, OnTerminateWorker) |
| 199 IPC_MESSAGE_UNHANDLED(handled = false) | 199 IPC_MESSAGE_UNHANDLED(handled = false) |
| 200 IPC_END_MESSAGE_MAP() | 200 IPC_END_MESSAGE_MAP() |
| 201 | 201 |
| 202 if (!handled && GetContext()) { | 202 if (!handled && GetContext()) { |
| 203 handled = | 203 handled = GetContext()->embedded_worker_registry()->OnMessageReceived( |
| 204 GetContext()->embedded_worker_registry()->OnMessageReceived(message); | 204 message, render_process_id_); |
| 205 if (!handled) | 205 if (!handled) |
| 206 BadMessageReceived(); | 206 BadMessageReceived(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 return handled; | 209 return handled; |
| 210 } | 210 } |
| 211 | 211 |
| 212 bool ServiceWorkerDispatcherHost::Send(IPC::Message* message) { | 212 bool ServiceWorkerDispatcherHost::Send(IPC::Message* message) { |
| 213 if (channel_ready_) { | 213 if (channel_ready_) { |
| 214 BrowserMessageFilter::Send(message); | 214 BrowserMessageFilter::Send(message); |
| (...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 ServiceWorkerHandle* handle = handles_.Lookup(handle_id); | 954 ServiceWorkerHandle* handle = handles_.Lookup(handle_id); |
| 955 if (!handle) { | 955 if (!handle) { |
| 956 BadMessageReceived(); | 956 BadMessageReceived(); |
| 957 return; | 957 return; |
| 958 } | 958 } |
| 959 handle->version()->StopWorker( | 959 handle->version()->StopWorker( |
| 960 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); | 960 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
| 961 } | 961 } |
| 962 | 962 |
| 963 } // namespace content | 963 } // namespace content |
| OLD | NEW |