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

Unified Diff: android_webview/native/aw_contents.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: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 335886a2bfa4fb091a07535e41ac3dfdf59725fd..538742dc1c82d7f937fcbd9e8908ce02b6309272 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -26,7 +26,6 @@
#include "android_webview/native/aw_contents_io_thread_client_impl.h"
#include "android_webview/native/aw_contents_lifecycle_notifier.h"
#include "android_webview/native/aw_gl_functor.h"
-#include "android_webview/native/aw_message_port_service_impl.h"
#include "android_webview/native/aw_pdf_exporter.h"
#include "android_webview/native/aw_picture.h"
#include "android_webview/native/aw_web_contents_delegate.h"
@@ -57,6 +56,7 @@
#include "components/autofill/core/browser/autofill_manager.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/navigation_interception/intercept_navigation_delegate.h"
+#include "content/public/browser/android/app_web_message_port_service.h"
#include "content/public/browser/android/content_view_core.h"
#include "content/public/browser/android/synchronous_compositor.h"
#include "content/public/browser/browser_thread.h"
@@ -1229,9 +1229,11 @@ void AwContents::PostMessageToFrame(JNIEnv* env,
BrowserThread::PostTask(
BrowserThread::IO,
FROM_HERE,
- base::Bind(&AwMessagePortServiceImpl::RemoveSentPorts,
- base::Unretained(AwMessagePortServiceImpl::GetInstance()),
- j_ports));
+ base::Bind(
+ &content::AppWebMessagePortService::RemoveSentPorts,
sgurun-gerrit only 2016/09/30 23:40:59 as webmessageportservice is now in content, you sh
Yusuf 2016/10/04 21:33:14 Done.
+ base::Unretained(
+ content::MessagePortProvider::GetAppWebMessagePortService()),
+ j_ports));
}
content::MessagePortProvider::PostMessageToFrame(web_contents_.get(),
source_origin,
@@ -1240,24 +1242,11 @@ void AwContents::PostMessageToFrame(JNIEnv* env,
j_ports);
}
-scoped_refptr<AwMessagePortMessageFilter>
-AwContents::GetMessagePortMessageFilter() {
- // Create a message port message filter if necessary
- if (message_port_message_filter_.get() == nullptr) {
- message_port_message_filter_ =
- new AwMessagePortMessageFilter(
- web_contents_->GetMainFrame()->GetRoutingID());
- web_contents_->GetRenderProcessHost()->AddFilter(
- message_port_message_filter_.get());
- }
- return message_port_message_filter_;
-}
-
void AwContents::CreateMessageChannel(JNIEnv* env,
const JavaParamRef<jobject>& obj,
const JavaParamRef<jobjectArray>& ports) {
- AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, ports,
- GetMessagePortMessageFilter());
+ content::MessagePortProvider::GetAppWebMessagePortService()->
+ CreateMessageChannel(env, ports, web_contents_.get());
}
void AwContents::GrantFileSchemeAccesstoChildProcess(

Powered by Google App Engine
This is Rietveld 408576698