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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 11193051: To fix the cross-site post submission bug. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New OpenURL function and DataType Test Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 load_url_type); 546 load_url_type);
547 params.transition_type = PageTransitionFromInt(transition_type); 547 params.transition_type = PageTransitionFromInt(transition_type);
548 params.override_user_agent = 548 params.override_user_agent =
549 static_cast<NavigationController::UserAgentOverrideOption>( 549 static_cast<NavigationController::UserAgentOverrideOption>(
550 ua_override_option); 550 ua_override_option);
551 551
552 if (extra_headers) 552 if (extra_headers)
553 params.extra_headers = ConvertJavaStringToUTF8(env, extra_headers); 553 params.extra_headers = ConvertJavaStringToUTF8(env, extra_headers);
554 554
555 if (post_data) { 555 if (post_data) {
556 scoped_refptr<webkit_glue::ResourceRequestBody> http_body =
557 new webkit_glue::ResourceRequestBody();
556 std::vector<uint8> http_body_vector; 558 std::vector<uint8> http_body_vector;
557 JavaByteArrayToByteVector(env, post_data, &http_body_vector); 559 JavaByteArrayToByteVector(env, post_data, &http_body_vector);
558 params.browser_initiated_post_data = 560 std::string temp_;
559 base::RefCountedBytes::TakeVector(&http_body_vector); 561 temp_ = ConvertByteVectorToString(*value);
562 http_body->AppendBytes(temp_.data(), temp_.size());
563
564 params.browser_initiated_post_data = http_body;
560 } 565 }
561 566
562 if (base_url_for_data_url) { 567 if (base_url_for_data_url) {
563 params.base_url_for_data_url = 568 params.base_url_for_data_url =
564 GURL(ConvertJavaStringToUTF8(env, base_url_for_data_url)); 569 GURL(ConvertJavaStringToUTF8(env, base_url_for_data_url));
565 } 570 }
566 571
567 if (virtual_url_for_data_url) { 572 if (virtual_url_for_data_url) {
568 params.virtual_url_for_data_url = 573 params.virtual_url_for_data_url =
569 GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url)); 574 GURL(ConvertJavaStringToUTF8(env, virtual_url_for_data_url));
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { 1101 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) {
1097 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; 1102 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!";
1098 return false; 1103 return false;
1099 } 1104 }
1100 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); 1105 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I");
1101 1106
1102 return RegisterNativesImpl(env) >= 0; 1107 return RegisterNativesImpl(env) >= 0;
1103 } 1108 }
1104 1109
1105 } // namespace content 1110 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698