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

Issue 10825073: Stop using ScopedAllowIO in content::ResourceDispatcherHostImpl (Closed)

Created:
8 years, 4 months ago by hashimoto
Modified:
8 years, 3 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Visibility:
Public.

Description

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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=154286

Patch Set 1 : _ #

Patch Set 2 : Move Blob resolve and abort check to PrepareToBeginRequest() #

Patch Set 3 : Move abort check back to BeginRequest() #

Total comments: 1

Patch Set 4 : Use URLRequest::Delegate to communicate the upload data size #

Patch Set 5 : WIP: chrome frame #

Patch Set 6 : Chrome Frame fix #

Total comments: 1

Patch Set 7 : Use URLRequest::GetUploadProgress instead of URLRequest::Delegate::OnRequestBodyInitialization #

Patch Set 8 : rebase #

Total comments: 6

Patch Set 9 : Rebased to the latest patch set of Issue 10834178 #

Patch Set 10 : Remove const #

Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -115 lines) Patch
M chrome/browser/automation/url_request_automation_job.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/automation/url_request_automation_job.cc View 1 2 3 4 5 6 7 3 chunks +6 lines, -6 lines 0 comments Download
M chrome/common/automation_messages.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome_frame/chrome_frame_automation.h View 1 2 3 4 1 chunk +5 lines, -4 lines 0 comments Download
M chrome_frame/chrome_frame_automation.cc View 1 2 3 4 5 2 chunks +5 lines, -3 lines 0 comments Download
M chrome_frame/plugin_url_request.h View 1 2 3 4 5 2 chunks +5 lines, -9 lines 0 comments Download
M chrome_frame/test/automation_client_mock.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome_frame/test/url_request_test.cc View 1 2 3 4 5 6 7 7 chunks +10 lines, -8 lines 0 comments Download
M chrome_frame/urlmon_url_request.h View 1 2 3 4 1 chunk +5 lines, -6 lines 0 comments Download
M chrome_frame/urlmon_url_request.cc View 1 2 3 4 5 6 7 3 chunks +15 lines, -12 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 9 8 chunks +5 lines, -11 lines 0 comments Download
M content/browser/renderer_host/resource_loader.cc View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -9 lines 0 comments Download
M content/browser/renderer_host/resource_request_info_impl.h View 1 2 3 4 chunks +0 lines, -5 lines 0 comments Download
M content/browser/renderer_host/resource_request_info_impl.cc View 1 2 3 4 chunks +0 lines, -7 lines 0 comments Download
M content/public/browser/resource_request_info.h View 1 2 3 1 chunk +0 lines, -4 lines 0 comments Download
M net/url_request/url_fetcher_core.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request.h View 1 2 3 4 5 6 7 3 chunks +3 lines, -2 lines 0 comments Download
M net/url_request/url_request.cc View 1 2 3 4 5 6 7 8 4 chunks +4 lines, -6 lines 0 comments Download
M net/url_request/url_request_ftp_job.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_ftp_job.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M net/url_request/url_request_http_job.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_http_job.cc View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -2 lines 0 comments Download
M net/url_request/url_request_job.h View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M net/url_request/url_request_job.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M webkit/tools/test_shell/simple_resource_loader_bridge.cc View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -11 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
hashimoto
jam, Could you review this change?
8 years, 4 months ago (2012-07-30 08:47:31 UTC) #1
jam
redirecting to Darin since he's more familiar with this code
8 years, 4 months ago (2012-07-30 15:25:09 UTC) #2
darin (slow to review)
I'm not sure this is the best change. It is adding another asynchronous stage to ...
8 years, 4 months ago (2012-07-31 19:29:46 UTC) #3
hashimoto
On 2012/07/31 19:29:46, darin wrote: > I'm not sure this is the best change. It ...
8 years, 4 months ago (2012-08-06 13:29:37 UTC) #4
darin (slow to review)
On Mon, Aug 6, 2012 at 6:29 AM, <hashimoto@chromium.org> wrote: > On 2012/07/31 19:29:46, darin ...
8 years, 4 months ago (2012-08-06 22:48:51 UTC) #5
hashimoto
Added URLRequest::Delegate::OnRequestBodyInitialized to get the upload data size. This change is still not finished, there ...
8 years, 4 months ago (2012-08-07 10:38:50 UTC) #6
hashimoto
New patch set, now Chrome Frame works well. PTAL
8 years, 4 months ago (2012-08-08 09:36:02 UTC) #7
hashimoto
On 2012/08/08 09:36:02, hashimoto wrote: > New patch set, now Chrome Frame works well. > ...
8 years, 4 months ago (2012-08-14 00:34:42 UTC) #8
darin (slow to review)
http://codereview.chromium.org/10825073/diff/17001/net/url_request/url_request.h File net/url_request/url_request.h (right): http://codereview.chromium.org/10825073/diff/17001/net/url_request/url_request.h#newcode239 net/url_request/url_request.h:239: virtual void OnRequestBodyInitialized(URLRequest* request, uint64 size); Does this really ...
8 years, 4 months ago (2012-08-14 18:24:26 UTC) #9
darin (slow to review)
On 2012/08/14 18:24:26, darin wrote: > http://codereview.chromium.org/10825073/diff/17001/net/url_request/url_request.h > File net/url_request/url_request.h (right): > > http://codereview.chromium.org/10825073/diff/17001/net/url_request/url_request.h#newcode239 > ...
8 years, 4 months ago (2012-08-14 18:27:37 UTC) #10
darin (slow to review)
Yes, upon further reflection, I think GetUploadProgress that reports both progress and total byte counts ...
8 years, 4 months ago (2012-08-14 18:34:02 UTC) #11
hashimoto
On 2012/08/14 18:27:37, darin wrote: > On 2012/08/14 18:24:26, darin wrote: > > > http://codereview.chromium.org/10825073/diff/17001/net/url_request/url_request.h ...
8 years, 4 months ago (2012-08-16 11:46:13 UTC) #12
hashimoto
willchan@, Do changes for net/ looks good to you? HttpTransaction change is split as http://codereview.chromium.org/10834178/ ...
8 years, 4 months ago (2012-08-16 11:47:28 UTC) #13
willchan no longer on Chromium
Can you update the changelist description with what's going on here? How are we avoiding ...
8 years, 4 months ago (2012-08-16 19:27:15 UTC) #14
hashimoto
On 2012/08/16 19:27:15, willchan wrote: > Can you update the changelist description with what's going ...
8 years, 4 months ago (2012-08-17 05:36:45 UTC) #15
willchan no longer on Chromium
lgtm
8 years, 4 months ago (2012-08-17 14:12:29 UTC) #16
hashimoto
darin, Could you take another look on this change?
8 years, 3 months ago (2012-08-27 18:27:04 UTC) #17
darin (slow to review)
Is this CL missing net/base/upload_progress.h?
8 years, 3 months ago (2012-08-29 21:47:56 UTC) #18
hashimoto
On 2012/08/29 21:47:56, darin wrote: > Is this CL missing net/base/upload_progress.h? It's split to another ...
8 years, 3 months ago (2012-08-29 21:49:38 UTC) #19
darin (slow to review)
I'm assuming that UploadProgress can become a class that only provides methods to read progress ...
8 years, 3 months ago (2012-08-29 22:36:16 UTC) #20
hashimoto
Rebased onto the latest patch set of http://codereview.chromium.org/10834178/ http://codereview.chromium.org/10825073/diff/22001/content/browser/renderer_host/resource_dispatcher_host_impl.cc File content/browser/renderer_host/resource_dispatcher_host_impl.cc (right): http://codereview.chromium.org/10825073/diff/22001/content/browser/renderer_host/resource_dispatcher_host_impl.cc#newcode1600 content/browser/renderer_host/resource_dispatcher_host_impl.cc:1600: const ...
8 years, 3 months ago (2012-08-29 22:48:55 UTC) #21
darin (slow to review)
LGTM!
8 years, 3 months ago (2012-08-29 22:55:27 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hashimoto@chromium.org/10825073/36001
8 years, 3 months ago (2012-08-30 03:54:07 UTC) #23
commit-bot: I haz the power
Try job failure for 10825073-36001 (retry) on win for step "compile" (clobber build). It's a ...
8 years, 3 months ago (2012-08-30 05:19:53 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hashimoto@chromium.org/10825073/36001
8 years, 3 months ago (2012-08-30 07:27:59 UTC) #25
commit-bot: I haz the power
Try job failure for 10825073-36001 (retry) on linux_rel for step "interactive_ui_tests". It's a second try, ...
8 years, 3 months ago (2012-08-30 09:22:11 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hashimoto@chromium.org/10825073/36001
8 years, 3 months ago (2012-08-30 18:11:03 UTC) #27
commit-bot: I haz the power
8 years, 3 months ago (2012-08-30 22:30:53 UTC) #28
Change committed as 154286

Powered by Google App Engine
This is Rietveld 408576698