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/message_port_service.h" | 5 #include "content/browser/message_port_service.h" |
6 | 6 |
7 #include "content/browser/message_port_delegate.h" | 7 #include "content/browser/message_port_delegate.h" |
8 #include "content/common/message_port_messages.h" | 8 #include "content/common/message_port_messages.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 | 10 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 std::make_pair(message, sent_message_port_ids)); | 182 std::make_pair(message, sent_message_port_ids)); |
183 return; | 183 return; |
184 } | 184 } |
185 | 185 |
186 if (!entangled_port.delegate) { | 186 if (!entangled_port.delegate) { |
187 NOTREACHED(); | 187 NOTREACHED(); |
188 return; | 188 return; |
189 } | 189 } |
190 | 190 |
191 // Now send the message to the entangled port. | 191 // Now send the message to the entangled port. |
192 entangled_port.delegate->SendMessage(entangled_port.route_id, message, | 192 entangled_port.delegate->SendMessageToPort(entangled_port.route_id, message, |
193 sent_message_port_ids); | 193 sent_message_port_ids); |
194 } | 194 } |
195 | 195 |
196 void MessagePortService::QueueMessages(int message_port_id) { | 196 void MessagePortService::QueueMessages(int message_port_id) { |
197 if (!message_ports_.count(message_port_id)) { | 197 if (!message_ports_.count(message_port_id)) { |
198 NOTREACHED(); | 198 NOTREACHED(); |
199 return; | 199 return; |
200 } | 200 } |
201 | 201 |
202 MessagePort& port = message_ports_[message_port_id]; | 202 MessagePort& port = message_ports_[message_port_id]; |
203 if (port.delegate) { | 203 if (port.delegate) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // Do the disentanglement (and be paranoid about the other side existing | 307 // Do the disentanglement (and be paranoid about the other side existing |
308 // just in case something unusual happened during entanglement). | 308 // just in case something unusual happened during entanglement). |
309 if (message_ports_.count(entangled_id)) { | 309 if (message_ports_.count(entangled_id)) { |
310 message_ports_[entangled_id].entangled_message_port_id = MSG_ROUTING_NONE; | 310 message_ports_[entangled_id].entangled_message_port_id = MSG_ROUTING_NONE; |
311 } | 311 } |
312 } | 312 } |
313 message_ports_.erase(erase_item); | 313 message_ports_.erase(erase_item); |
314 } | 314 } |
315 | 315 |
316 } // namespace content | 316 } // namespace content |
OLD | NEW |