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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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( | 83 void MessagePortProvider::PostMessageToPort( |
84 int sender_port_id, | 84 int sender_port_id, |
85 const base::string16& data, | 85 const MessagePortMessage& message, |
86 const std::vector<int>& sent_ports) { | 86 const std::vector<int>& sent_ports) { |
87 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 87 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
88 MessagePortService* msp = MessagePortService::GetInstance(); | 88 MessagePortService* msp = MessagePortService::GetInstance(); |
89 msp->PostMessage(sender_port_id, data, sent_ports); | 89 msp->PostMessage(sender_port_id, message, sent_ports); |
90 } | 90 } |
91 | 91 |
92 // static | 92 // static |
93 void MessagePortProvider::ClosePort(int message_port_id) { | 93 void MessagePortProvider::ClosePort(int message_port_id) { |
94 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 94 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
95 MessagePortService* msp = MessagePortService::GetInstance(); | 95 MessagePortService* msp = MessagePortService::GetInstance(); |
96 msp->ClosePort(message_port_id); | 96 msp->ClosePort(message_port_id); |
97 } | 97 } |
98 | 98 |
99 // static | 99 // static |
100 void MessagePortProvider::OnMessagePortDelegateClosing( | 100 void MessagePortProvider::OnMessagePortDelegateClosing( |
101 MessagePortDelegate* delegate) { | 101 MessagePortDelegate* delegate) { |
102 MessagePortService::GetInstance()->OnMessagePortDelegateClosing(delegate); | 102 MessagePortService::GetInstance()->OnMessagePortDelegateClosing(delegate); |
103 } | 103 } |
104 | 104 |
105 } // namespace content | 105 } // namespace content |
OLD | NEW |