OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/public/browser/message_port_provider.h" | 5 #include "content/public/browser/message_port_provider.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "content/browser/browser_thread_impl.h" | 8 #include "content/browser/browser_thread_impl.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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 msp->Create(MSG_ROUTING_NONE, delegate, port2); | 73 msp->Create(MSG_ROUTING_NONE, delegate, port2); |
74 // Update the routing number of the message ports to be equal to the message | 74 // Update the routing number of the message ports to be equal to the message |
75 // port numbers. | 75 // port numbers. |
76 msp->UpdateMessagePort(*port1, delegate, *port1); | 76 msp->UpdateMessagePort(*port1, delegate, *port1); |
77 msp->UpdateMessagePort(*port2, delegate, *port2); | 77 msp->UpdateMessagePort(*port2, delegate, *port2); |
78 msp->Entangle(*port1, *port2); | 78 msp->Entangle(*port1, *port2); |
79 msp->Entangle(*port2, *port1); | 79 msp->Entangle(*port2, *port1); |
80 } | 80 } |
81 | 81 |
82 // static | 82 // static |
| 83 void MessagePortProvider::PostMessageToPort( |
| 84 int sender_port_id, |
| 85 const base::string16& data, |
| 86 const std::vector<int>& sent_ports) { |
| 87 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 88 MessagePortService* msp = MessagePortService::GetInstance(); |
| 89 msp->PostMessage(sender_port_id, data, sent_ports); |
| 90 } |
| 91 |
| 92 // static |
83 void MessagePortProvider::OnMessagePortDelegateClosing( | 93 void MessagePortProvider::OnMessagePortDelegateClosing( |
84 MessagePortDelegate* delegate) { | 94 MessagePortDelegate* delegate) { |
85 MessagePortService::GetInstance()->OnMessagePortDelegateClosing(delegate); | 95 MessagePortService::GetInstance()->OnMessagePortDelegateClosing(delegate); |
86 } | 96 } |
87 | 97 |
88 } // namespace content | 98 } // namespace content |
OLD | NEW |