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

Unified Diff: android_webview/native/aw_contents.cc

Issue 923913004: Use an empty origin as source origin when posting messages from android_webview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index efa20b2724c0ff55520a5fe9d384684e7425bcb4..be09dc7cfd7bd6e1a38604c8c3e6a7447c87b18f 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -1093,10 +1093,11 @@ void AwContents::TrimMemory(JNIEnv* env,
// TODO(sgurun) add support for posting a frame whose name is known (only
// main frame is supported at this time, see crbug.com/389721)
void AwContents::PostMessageToFrame(JNIEnv* env, jobject obj,
- jstring frame_name, jstring message, jstring source_origin,
- jstring target_origin, jintArray sent_ports) {
+ jstring frame_name, jstring message, jstring target_origin,
+ jintArray sent_ports) {
- base::string16 j_source_origin(ConvertJavaStringToUTF16(env, source_origin));
+ // 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;
@@ -1111,7 +1112,7 @@ void AwContents::PostMessageToFrame(JNIEnv* env, jobject obj,
j_ports));
}
content::MessagePortProvider::PostMessageToFrame(web_contents_.get(),
- j_source_origin,
+ source_origin,
j_target_origin,
j_message,
j_ports);
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698