OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/worker_host/message_port_dispatcher.h" | 5 #include "chrome/browser/worker_host/message_port_dispatcher.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/singleton.h" | 8 #include "base/singleton.h" |
9 #include "chrome/browser/browser_thread.h" | |
10 #include "chrome/browser/renderer_host/resource_message_filter.h" | 9 #include "chrome/browser/renderer_host/resource_message_filter.h" |
11 #include "chrome/browser/worker_host/worker_process_host.h" | 10 #include "chrome/browser/worker_host/worker_process_host.h" |
12 #include "chrome/common/notification_service.h" | 11 #include "chrome/common/notification_service.h" |
13 #include "chrome/common/worker_messages.h" | 12 #include "chrome/common/worker_messages.h" |
14 | 13 |
15 struct MessagePortDispatcher::MessagePort { | 14 struct MessagePortDispatcher::MessagePort { |
16 // sender and route_id are what we need to send messages to the port. | 15 // sender and route_id are what we need to send messages to the port. |
17 IPC::Message::Sender* sender; | 16 IPC::Message::Sender* sender; |
18 int route_id; | 17 int route_id; |
19 // A function pointer to generate a new route id for the sender above. | 18 // A function pointer to generate a new route id for the sender above. |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 int entangled_id = erase_item->second.entangled_message_port_id; | 282 int entangled_id = erase_item->second.entangled_message_port_id; |
284 if (entangled_id != MSG_ROUTING_NONE) { | 283 if (entangled_id != MSG_ROUTING_NONE) { |
285 // Do the disentanglement (and be paranoid about the other side existing | 284 // Do the disentanglement (and be paranoid about the other side existing |
286 // just in case something unusual happened during entanglement). | 285 // just in case something unusual happened during entanglement). |
287 if (message_ports_.count(entangled_id)) { | 286 if (message_ports_.count(entangled_id)) { |
288 message_ports_[entangled_id].entangled_message_port_id = MSG_ROUTING_NONE; | 287 message_ports_[entangled_id].entangled_message_port_id = MSG_ROUTING_NONE; |
289 } | 288 } |
290 } | 289 } |
291 message_ports_.erase(erase_item); | 290 message_ports_.erase(erase_item); |
292 } | 291 } |
OLD | NEW |