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

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 Android API, Helper Function and Include_rules 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
« no previous file with comments | « chrome/browser/ui/browser_navigator.cc ('k') | content/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3dee35f6509312c71324d4dbffacb8c86b40c241..d72784783e10cb17c2c316242ff452d40f86fa4c 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -673,8 +673,17 @@ void ContentViewCoreImpl::LoadUrl(
if (post_data) {
std::vector<uint8> http_body_vector;
JavaByteArrayToByteVector(env, post_data, &http_body_vector);
- params.browser_initiated_post_data =
+ scoped_refptr<base::RefCountedBytes> data =
base::RefCountedBytes::TakeVector(&http_body_vector);
+ std::vector<unsigned char> post_data_char_vector;
+ post_data_char_vector.assign(data->front(),
+ data->front() + data->size());
+ scoped_refptr<webkit_glue::ResourceRequestBody> http_body =
+ new webkit_glue::ResourceRequestBody();
+ const unsigned char* post_data_char = &post_data_char_vector[0];
+ http_body->AppendBytes(reinterpret_cast<const char*>(post_data_char),
+ post_data_char_vector.size());
+ params.browser_initiated_post_data = http_body;
}
if (base_url_for_data_url) {
« no previous file with comments | « chrome/browser/ui/browser_navigator.cc ('k') | content/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698