Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(982)

Side by Side Diff: content/browser/message_port_provider.cc

Issue 869133005: Post a Message from Java to JS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: spelling fix Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « android_webview/renderer/aw_message_port_client.cc ('k') | content/public/browser/message_port_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698