summaryrefslogtreecommitdiffstats
path: root/chrome_frame/plugin_url_request.cc
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-29 03:57:23 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-29 03:57:23 +0000
commitc5a83288e55153c3ebfdfbb79157ee7804184a4a (patch)
tree19b7c0cf85c33ff6111f5d52a7ad84afb89f3e97 /chrome_frame/plugin_url_request.cc
parent9cb79c01841c4820fc35ab70cfc8daf61ee7405b (diff)
downloadchromium_src-c5a83288e55153c3ebfdfbb79157ee7804184a4a.zip
chromium_src-c5a83288e55153c3ebfdfbb79157ee7804184a4a.tar.gz
chromium_src-c5a83288e55153c3ebfdfbb79157ee7804184a4a.tar.bz2
Using thread safe reference counting to wrap the UploadData instance.Moving the post_data_len_ member variable to the PluginUrlRequest class.TEST=This is a tentative fix for bug 25531.BUG=25531
Review URL: http://codereview.chromium.org/340006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30432 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/plugin_url_request.cc')
-rw-r--r--chrome_frame/plugin_url_request.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/chrome_frame/plugin_url_request.cc b/chrome_frame/plugin_url_request.cc
index 1d34b0c..62a13f5 100644
--- a/chrome_frame/plugin_url_request.cc
+++ b/chrome_frame/plugin_url_request.cc
@@ -8,7 +8,7 @@
#include "chrome_frame/np_browser_functions.h"
PluginUrlRequest::PluginUrlRequest()
- : request_handler_(NULL), tab_(0), remote_request_id_(0),
+ : request_handler_(NULL), tab_(0), remote_request_id_(0), post_data_len_(0),
status_(URLRequestStatus::IO_PENDING),
frame_busting_enabled_(false) {
}
@@ -28,8 +28,26 @@ bool PluginUrlRequest::Initialize(PluginRequestHandler* request_handler,
method_ = method;
referrer_ = referrer;
extra_headers_ = extra_headers;
- upload_data_ = upload_data;
+
+ 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);
+ }
+ }
+
frame_busting_enabled_ = enable_frame_busting;
+
return true;
}