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/common/message_port_messages.h" | 7 #include "content/common/message_port_messages.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/message_port_delegate.h" | 9 #include "content/public/browser/message_port_delegate.h" |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 MessagePortService::MessagePortService() | 56 MessagePortService::MessagePortService() |
57 : next_message_port_id_(0) { | 57 : next_message_port_id_(0) { |
58 } | 58 } |
59 | 59 |
60 MessagePortService::~MessagePortService() { | 60 MessagePortService::~MessagePortService() { |
61 } | 61 } |
62 | 62 |
63 void MessagePortService::UpdateMessagePort(int message_port_id, | 63 void MessagePortService::UpdateMessagePort(int message_port_id, |
64 MessagePortDelegate* delegate, | 64 MessagePortDelegate* delegate, |
65 int routing_id) { | 65 int routing_id) { |
| 66 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
66 if (!message_ports_.count(message_port_id)) { | 67 if (!message_ports_.count(message_port_id)) { |
67 NOTREACHED(); | 68 NOTREACHED(); |
68 return; | 69 return; |
69 } | 70 } |
70 | 71 |
71 MessagePort& port = message_ports_[message_port_id]; | 72 MessagePort& port = message_ports_[message_port_id]; |
72 port.delegate = delegate; | 73 port.delegate = delegate; |
73 port.route_id = routing_id; | 74 port.route_id = routing_id; |
74 } | 75 } |
75 | 76 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // Do the disentanglement (and be paranoid about the other side existing | 308 // Do the disentanglement (and be paranoid about the other side existing |
308 // just in case something unusual happened during entanglement). | 309 // just in case something unusual happened during entanglement). |
309 if (message_ports_.count(entangled_id)) { | 310 if (message_ports_.count(entangled_id)) { |
310 message_ports_[entangled_id].entangled_message_port_id = MSG_ROUTING_NONE; | 311 message_ports_[entangled_id].entangled_message_port_id = MSG_ROUTING_NONE; |
311 } | 312 } |
312 } | 313 } |
313 message_ports_.erase(erase_item); | 314 message_ports_.erase(erase_item); |
314 } | 315 } |
315 | 316 |
316 } // namespace content | 317 } // namespace content |
OLD | NEW |