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

Unified Diff: android_webview/native/aw_contents.cc

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Eliminate unnecessary PostTask Created 3 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 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 050d71524defc95b328635441c0b7e8dba53a1b7..78d8d1de0e1817272b460182efc01c9ec7796d1e 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -56,7 +56,6 @@
#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"
@@ -1334,28 +1333,14 @@ void AwContents::PostMessageToFrame(JNIEnv* env,
const JavaParamRef<jstring>& frame_name,
const JavaParamRef<jstring>& message,
const JavaParamRef<jstring>& target_origin,
- const JavaParamRef<jintArray>& sent_ports) {
+ const JavaParamRef<jobjectArray>& ports) {
// Use an empty source origin for android webview.
- base::string16 source_origin;
- base::string16 j_target_origin(ConvertJavaStringToUTF16(env, target_origin));
- base::string16 j_message(ConvertJavaStringToUTF16(env, message));
- std::vector<int> j_ports;
-
- if (sent_ports != nullptr)
- base::android::JavaIntArrayToIntVector(env, sent_ports, &j_ports);
-
content::MessagePortProvider::PostMessageToFrame(web_contents_.get(),
- source_origin,
- j_target_origin,
- j_message,
- j_ports);
-}
-
-void AwContents::CreateMessageChannel(JNIEnv* env,
- const JavaParamRef<jobject>& obj,
- const JavaParamRef<jobjectArray>& ports) {
- content::MessagePortProvider::GetAppWebMessagePortService()
- ->CreateMessageChannel(env, ports, web_contents_.get());
+ env,
+ nullptr,
+ target_origin,
+ message,
+ ports);
}
void AwContents::GrantFileSchemeAccesstoChildProcess(

Powered by Google App Engine
This is Rietveld 408576698