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

Unified 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: Fix Comments 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 02e4c2b673ca6c383996989c5f5122dcd7a4c698..419d64a4eb00fca9f169919e0ea56d0b4a25a8e3 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -672,8 +672,16 @@ void ContentViewCoreImpl::LoadUrl(
if (post_data) {
std::vector<uint8> http_body_vector;
JavaByteArrayToByteVector(env, post_data, &http_body_vector);
- params.browser_initiated_post_data =
- base::RefCountedBytes::TakeVector(&http_body_vector);
+ scoped_refptr<base::RefCountedBytes> data =
+ base::RefCountedBytes::TakeVector(&post_data_vector);
Charlie Reis 2012/11/20 05:46:03 nit: Indent 2 more spaces.
irobert 2012/11/22 01:37:00 Done.
+ std::vector<unsigned char> post_data_char;
+ post_data_char.assign(data->front(),
+ data->front() + data->size());
+ scoped_refptr<webkit_glue::ResourceRequestBody> http_body =
+ new webkit_glue::ResourceRequestBody();
+ http_body->AppendBytes(reinterpret_cast<const char*>(post_data_char),
+ post_data_char.size());
+ params.browser_initiated_post_data = http_body;
}
if (base_url_for_data_url) {

Powered by Google App Engine
This is Rietveld 408576698