summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request_ftp_job.h
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 22:30:42 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 22:30:42 +0000
commit7335ab0c8b9afb8a3c702d97925c1a0278a45ab7 (patch)
tree164f7ba73256cd36ab67ed1f02992eb740428e87 /net/url_request/url_request_ftp_job.h
parent07e666801f64a26dd1c68ec3dc64fdd0f16603f7 (diff)
downloadchromium_src-7335ab0c8b9afb8a3c702d97925c1a0278a45ab7.zip
chromium_src-7335ab0c8b9afb8a3c702d97925c1a0278a45ab7.tar.gz
chromium_src-7335ab0c8b9afb8a3c702d97925c1a0278a45ab7.tar.bz2
Stop using ScopedAllowIO in content::ResourceDispatcherHostImpl
Summary: UploadData::GetContentLengthSync() call is removed from ResourceDispatcherHostImpl. The return type of net::URLRequest::GetUploadProgress() is changed from uint64 to net::UploadProgress. A new member 'upload_size' is added to AutomationURLResponse for Chrome Frame. content::ResourceDispatcherHostImpl has been using UploadData::GetContentLengthSync() which needs ScopedAllowIO. To stop using ScopedAllowIO, there were three options considered. 1. Use asynchronous version UploadData::GetContentLength() which does not need ScopedAllowIO. pros: Changes would be minimal and straight-forward. cons: GetContentLength() is also called in UploadDataStream::Init(). If we start reusing the value, there is no need to call the same method here. 2. Communicate the upload data size to ResourceDispatcherHost by adding an event OnRequestBodyInitialized() to URLRequest::Delegate. pros: No duplicated GetContentLength() call here and in UploadDataStream::Init(). cons: Complicated interface. 3. Return upload data size as well as upload progress from URLRequest::GetUploadProgress(). pros: No duplicated GetContentLength() call here and in UploadDataStream::Init(). Simple interface. Making sense because upload progress and upload size are almost always used together (see ResourceHandler::OnUploadProgress and DOM ProgressEvent as examples). cons: Polling upload data size may imply that the size may change. We've decided to go with #3. The return type of net::URLRequest::GetUploadProgress() is changed from uint64 to net::UploadProgress, and URLRequest::GetUploadProgress() is used to get the upload size from ResourceDispatcherHostImpl instead of UploadData::GetContentLengthSync(). In Chrome Frame, URLRequestAutomationJob is used instead of URLRequestHttpJob and UploadDataStream is not initialized in the browser process. This is problematic since we cannot know the size of upload data without UploadDataStream. To deal with this, a new member 'upload_size' is added to AutomationURLResponse and the value is used to implement URLRequestAutomationJob::GetUploadProgress(). BUG=112607 TEST=Can upload files Review URL: https://chromiumcodereview.appspot.com/10825073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154286 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request_ftp_job.h')
-rw-r--r--net/url_request/url_request_ftp_job.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/url_request/url_request_ftp_job.h b/net/url_request/url_request_ftp_job.h
index 6deaf0a..d05e3d8 100644
--- a/net/url_request/url_request_ftp_job.h
+++ b/net/url_request/url_request_ftp_job.h
@@ -61,7 +61,7 @@ class URLRequestFtpJob : public URLRequestJob {
virtual void CancelAuth() OVERRIDE;
// TODO(ibrar): Yet to give another look at this function.
- virtual uint64 GetUploadProgress() const OVERRIDE;
+ virtual UploadProgress GetUploadProgress() const OVERRIDE;
virtual bool ReadRawData(IOBuffer* buf,
int buf_size,
int *bytes_read) OVERRIDE;