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

Unified Diff: content/browser/message_port_provider.cc

Issue 2375133002: Move MessagePort implementation from android_webview to content (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/message_port_provider.cc
diff --git a/content/browser/message_port_provider.cc b/content/browser/message_port_provider.cc
index b2a44635c16db56ee96da4e8aa3e1a23ca4af247..2f1e37166913418f90b81457879c13581163ec39 100644
--- a/content/browser/message_port_provider.cc
+++ b/content/browser/message_port_provider.cc
@@ -13,6 +13,10 @@
#include "content/common/frame_messages.h"
#include "content/public/browser/message_port_delegate.h"
+#if defined(OS_ANDROID)
sgurun-gerrit only 2016/09/30 23:40:59 this sounds like the code is not well spread betwe
Yusuf 2016/10/04 21:33:14 We still need the PostMessageToFrame since it is u
+#include "content/browser/android/app_web_message_port_service_impl.h"
+#endif
+
namespace content {
// static
@@ -41,68 +45,11 @@ void MessagePortProvider::PostMessageToFrame(
web_contents->GetMainFrame()->GetRoutingID(), params));
}
-// static
-void MessagePortProvider::CreateMessageChannel(MessagePortDelegate* delegate,
- int* port1,
- int* port2) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- *port1 = 0;
- *port2 = 0;
- MessagePortService* msp = MessagePortService::GetInstance();
- msp->Create(MSG_ROUTING_NONE, delegate, port1);
- msp->Create(MSG_ROUTING_NONE, delegate, port2);
- // Update the routing number of the message ports to be equal to the message
- // port numbers.
- msp->UpdateMessagePort(*port1, delegate, *port1);
- msp->UpdateMessagePort(*port2, delegate, *port2);
- msp->Entangle(*port1, *port2);
- msp->Entangle(*port2, *port1);
-}
-
-// static
-void MessagePortProvider::PostMessageToPort(
- int sender_port_id,
- const base::string16& message,
- const std::vector<int>& sent_ports) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- MessagePortService* msp = MessagePortService::GetInstance();
- msp->PostMessage(sender_port_id, message, sent_ports);
-}
-
-// static
-void MessagePortProvider::ClosePort(int message_port_id) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- MessagePortService* msp = MessagePortService::GetInstance();
- msp->ClosePort(message_port_id);
-}
-
-// static
-void MessagePortProvider::HoldMessages(int message_port_id) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- MessagePortService* msp = MessagePortService::GetInstance();
- msp->HoldMessages(message_port_id);
-}
-
-// static
-void MessagePortProvider::ReleaseMessages(int message_port_id) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- MessagePortService* msp = MessagePortService::GetInstance();
- msp->ReleaseMessages(message_port_id);
-}
-
-// static
-void MessagePortProvider::OnMessagePortDelegateClosing(
- MessagePortDelegate* delegate) {
- MessagePortService::GetInstance()->OnMessagePortDelegateClosing(delegate);
-}
-
-// static
-void MessagePortProvider::UpdateMessagePort(int message_port_id,
- MessagePortDelegate* delegate) {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- MessagePortService::GetInstance()->UpdateMessagePort(message_port_id,
- delegate,
- message_port_id);
+#if defined(OS_ANDROID)
+//static
+AppWebMessagePortService* MessagePortProvider::GetAppWebMessagePortService() {
+ return AppWebMessagePortServiceImpl::GetInstance();
}
+#endif
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698