| 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(int sender_port_id, |
| 84 const base::string16& message, |
| 85 const std::vector<int>& ports) { |
| 86 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 87 MessagePortService* msp = MessagePortService::GetInstance(); |
| 88 msp->PostMessage(sender_port_id, message, ports); |
| 89 } |
| 90 |
| 91 // static |
| 83 void MessagePortProvider::OnMessagePortDelegateClosing( | 92 void MessagePortProvider::OnMessagePortDelegateClosing( |
| 84 MessagePortDelegate* delegate) { | 93 MessagePortDelegate* delegate) { |
| 85 MessagePortService::GetInstance()->OnMessagePortDelegateClosing(delegate); | 94 MessagePortService::GetInstance()->OnMessagePortDelegateClosing(delegate); |
| 86 } | 95 } |
| 87 | 96 |
| 88 } // namespace content | 97 } // namespace content |
| OLD | NEW |