summaryrefslogtreecommitdiffstats
path: root/chrome_frame/plugin_url_request.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 05:18:43 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 05:18:43 +0000
commit04ac6e874adc7e00269b7f3bab879d3d93530184 (patch)
tree47b31b00716c3d0b9b7ce838568537b8fbaefc4a /chrome_frame/plugin_url_request.cc
parent3358a3dc6df4a18cf36288b40c6777ed9fba4204 (diff)
downloadchromium_src-04ac6e874adc7e00269b7f3bab879d3d93530184.zip
chromium_src-04ac6e874adc7e00269b7f3bab879d3d93530184.tar.gz
chromium_src-04ac6e874adc7e00269b7f3bab879d3d93530184.tar.bz2
ChromeFrame would fail to upload POST data to the server if the webserver requested NTLM
authentication. This is due to a bug in urlmon on IE6 and IE7 which manifests itself when the post data is passed to urlmon as an IStream. Fix is to pass in the uploaded data as a HGLOBAL. We always pass in a copy of the HGLOBAL which points to the posted data to urlmon. This is to have it accessible for reissuing navigation requests which target downloads. Fixes bug http://code.google.com/p/chromium/issues/detail?id=62687 BUG=62687 TEST=manually at this point. As we need a server which supports NTLM authentication like IIS. Review URL: http://codereview.chromium.org/6603006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76880 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/plugin_url_request.cc')
-rw-r--r--chrome_frame/plugin_url_request.cc34
1 files changed, 16 insertions, 18 deletions
diff --git a/chrome_frame/plugin_url_request.cc b/chrome_frame/plugin_url_request.cc
index e0166bc..8af3e1e 100644
--- a/chrome_frame/plugin_url_request.cc
+++ b/chrome_frame/plugin_url_request.cc
@@ -14,7 +14,8 @@ PluginUrlRequest::PluginUrlRequest()
enable_frame_busting_(false),
resource_type_(ResourceType::MAIN_FRAME),
load_flags_(0),
- is_chunked_upload_(false) {
+ is_chunked_upload_(false),
+ upload_data_(NULL) {
}
PluginUrlRequest::~PluginUrlRequest() {
@@ -34,25 +35,22 @@ bool PluginUrlRequest::Initialize(PluginUrlRequestDelegate* delegate,
resource_type_ = resource_type;
load_flags_ = load_flags;
- if (upload_data) {
- // We store a pointer to UrlmonUploadDataStream and not net::UploadData
- // since UrlmonUploadDataStream implements thread safe ref counting and
- // UploadData does not.
- CComObject<UrlmonUploadDataStream>* upload_stream = NULL;
- HRESULT hr = CComObject<UrlmonUploadDataStream>::CreateInstance(
- &upload_stream);
- if (FAILED(hr)) {
- NOTREACHED();
- } else {
- post_data_len_ = upload_data->GetContentLength();
- upload_stream->AddRef();
- upload_stream->Initialize(upload_data);
- upload_data_.Attach(upload_stream);
- is_chunked_upload_ = upload_data->is_chunked();
+ if (upload_data && upload_data->GetContentLength()) {
+ post_data_len_ = upload_data->GetContentLength();
+ is_chunked_upload_ = upload_data->is_chunked();
+
+#pragma warning(disable:4244)
+ upload_data_.reserve(post_data_len_);
+#pragma warning(default:4244)
+
+ std::vector<net::UploadData::Element>::iterator element_index;
+ for (element_index = upload_data->elements()->begin();
+ element_index != upload_data->elements()->end();
+ ++element_index) {
+ std::copy(element_index->bytes().begin(), element_index->bytes().end(),
+ std::back_inserter(upload_data_));
}
}
-
enable_frame_busting_ = enable_frame_busting;
-
return true;
}