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

Issue 1439953006: Reland: URLRequestJob: change ReadRawData contract (Closed)

Created:
5 years, 1 month ago by xunjieli
Modified:
5 years, 1 month ago
CC:
chromium-reviews, qsr+mojo_chromium.org, tzik, yzshen+watch_chromium.org, kinuko+watch, ben+mojo_chromium.org, jsbell+serviceworker_chromium.org, cbentzel+watch_chromium.org, gavinp+disk_chromium.org, viettrungluu+watch_chromium.org, jam, abarth-chromium, darin-cc_chromium.org, android-webview-reviews_chromium.org, blink-worker-reviews_chromium.org, nhiroki, oshima+watch_chromium.org, zork+watch_chromium.org, michaeln, serviceworker-reviews, Aaron Boodman, kinuko+serviceworker, Paweł Hajdan Jr., horo+watch_chromium.org, darin (slow to review), kinuko+fileapi, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reland: URLRequestJob: change ReadRawData contract This CL is to reland crrev.com/1410643007 which was reverted in crrev.com/1437523002. Previously, the interface for URLRequestJob::ReadRawData was as follows: bool ReadRawData(IOBuffer*, int, int*) Subclasses were expected to signal completion of the ReadRawData call by calling NotifyDone, SetStatus, or maybe one of the other Notify* functions on URLRequestJob, most of which do internal housekeeping and also drive the URLRequest's state machine. This made it difficult to reason about the URLRequestJob's state machine and needlessly complicated most of URLRequestJob. The new interface is as follows: int ReadRawData(IOBuffer*, int) Subclasses are required to either: a) Return ERR_IO_PENDING, and call ReadRawDataComplete when the read completes in any way, or b) Return a count of bytes read >= 0, indicating synchronous success, or c) Return another error code < 0, indicating synchronous failure. This substantially narrows the interface between URLRequestJob and its subclasses and moves the logic for the URLRequest state machine largely into URLRequestJob. Also, the signature of URLRequestJob::ReadFilteredData and some other internal URLRequestJob helpers changes to propagate detailed error codes instead of coercing all errors to FAILED. TBR=michaeln@chromium.org,mtomasz@chromium.org,jianli@chromium.org,zork@chromium.org BUG=474859 BUG=329902 Committed: https://crrev.com/d77911ac82186d65a8f11555a7a6b1678c769ba2 Cr-Commit-Position: refs/heads/master@{#360327}

Patch Set 1 : Revert of crrev.com/1437523002 #

Patch Set 2 : Fix #

Total comments: 6

Patch Set 3 : Rename test method per Matt's comment #

Patch Set 4 : Rebased #

Patch Set 5 : Address David's comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+825 lines, -925 lines) Patch
M android_webview/browser/net/android_stream_reader_url_request_job.h View 3 chunks +3 lines, -1 line 0 comments Download
M android_webview/browser/net/android_stream_reader_url_request_job.cc View 8 chunks +28 lines, -38 lines 0 comments Download
M chrome/browser/chromeos/fileapi/external_file_url_request_job.h View 2 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/chromeos/fileapi/external_file_url_request_job.cc View 6 chunks +31 lines, -33 lines 0 comments Download
M content/browser/android/url_request_content_job.h View 4 chunks +4 lines, -2 lines 0 comments Download
M content/browser/android/url_request_content_job.cc View 7 chunks +33 lines, -48 lines 0 comments Download
M content/browser/appcache/appcache_url_request_job.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/appcache/appcache_url_request_job.cc View 3 chunks +3 lines, -11 lines 0 comments Download
M content/browser/fileapi/file_writer_delegate_unittest.cc View 1 chunk +3 lines, -5 lines 0 comments Download
M content/browser/net/view_http_cache_job_factory.cc View 1 2 3 4 3 chunks +6 lines, -17 lines 0 comments Download
M content/browser/service_worker/service_worker_read_from_cache_job.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_read_from_cache_job.cc View 5 chunks +38 lines, -33 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/service_worker_url_request_job.cc View 6 chunks +29 lines, -47 lines 0 comments Download
M content/browser/service_worker/service_worker_write_to_cache_job.h View 4 chunks +19 lines, -13 lines 0 comments Download
M content/browser/service_worker/service_worker_write_to_cache_job.cc View 1 2 3 15 chunks +95 lines, -110 lines 0 comments Download
M content/browser/streams/stream_url_request_job.h View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/streams/stream_url_request_job.cc View 5 chunks +26 lines, -37 lines 0 comments Download
M content/browser/webui/url_data_manager_backend.cc View 5 chunks +13 lines, -24 lines 0 comments Download
M content/test/net/url_request_abort_on_end_job.h View 1 chunk +1 line, -1 line 0 comments Download
M content/test/net/url_request_abort_on_end_job.cc View 2 chunks +7 lines, -10 lines 0 comments Download
M ios/web/webui/url_data_manager_ios_backend.cc View 3 chunks +12 lines, -24 lines 0 comments Download
M mojo/services/network/url_loader_impl_apptest.cc View 1 chunk +6 lines, -10 lines 0 comments Download
M net/test/url_request/url_request_failed_job.h View 2 chunks +2 lines, -1 line 0 comments Download
M net/test/url_request/url_request_failed_job.cc View 2 chunks +22 lines, -29 lines 0 comments Download
M net/test/url_request/url_request_mock_data_job.h View 1 chunk +1 line, -1 line 0 comments Download
M net/test/url_request/url_request_mock_data_job.cc View 1 chunk +6 lines, -9 lines 0 comments Download
M net/test/url_request/url_request_slow_download_job.h View 1 chunk +1 line, -1 line 0 comments Download
M net/test/url_request/url_request_slow_download_job.cc View 2 chunks +10 lines, -17 lines 0 comments Download
M net/url_request/url_request_file_dir_job.h View 4 chunks +4 lines, -2 lines 0 comments Download
M net/url_request/url_request_file_dir_job.cc View 3 chunks +27 lines, -28 lines 0 comments Download
M net/url_request/url_request_file_job.h View 3 chunks +5 lines, -1 line 0 comments Download
M net/url_request/url_request_file_job.cc View 10 chunks +24 lines, -37 lines 0 comments Download
M net/url_request/url_request_ftp_job.h View 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_ftp_job.cc View 4 chunks +6 lines, -25 lines 0 comments Download
M net/url_request/url_request_http_job.h View 2 chunks +1 line, -4 lines 0 comments Download
M net/url_request/url_request_http_job.cc View 4 chunks +12 lines, -31 lines 0 comments Download
M net/url_request/url_request_job.h View 7 chunks +53 lines, -40 lines 0 comments Download
M net/url_request/url_request_job.cc View 1 16 chunks +132 lines, -99 lines 0 comments Download
M net/url_request/url_request_job_unittest.cc View 1 2 2 chunks +44 lines, -0 lines 0 comments Download
M net/url_request/url_request_simple_job.h View 2 chunks +1 line, -2 lines 0 comments Download
M net/url_request/url_request_simple_job.cc View 3 chunks +11 lines, -24 lines 0 comments Download
M net/url_request/url_request_status.h View 2 chunks +8 lines, -0 lines 0 comments Download
M net/url_request/url_request_status.cc View 1 chunk +15 lines, -0 lines 0 comments Download
M net/url_request/url_request_test_job.h View 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_test_job.cc View 4 chunks +11 lines, -19 lines 0 comments Download
M storage/browser/blob/blob_url_request_job.h View 1 chunk +1 line, -1 line 0 comments Download
M storage/browser/blob/blob_url_request_job.cc View 3 chunks +14 lines, -28 lines 0 comments Download
M storage/browser/fileapi/file_system_dir_url_request_job.h View 1 1 chunk +1 line, -1 line 0 comments Download
M storage/browser/fileapi/file_system_dir_url_request_job.cc View 1 6 chunks +8 lines, -13 lines 0 comments Download
M storage/browser/fileapi/file_system_url_request_job.h View 4 chunks +3 lines, -2 lines 0 comments Download
M storage/browser/fileapi/file_system_url_request_job.cc View 10 chunks +31 lines, -39 lines 0 comments Download

Messages

Total messages: 33 (12 generated)
xunjieli
Hi Randy and Matt, I am trying to reland the refactoring CL. In addition to ...
5 years, 1 month ago (2015-11-16 16:27:56 UTC) #2
xunjieli
This is to reland the refactoring CL which was reverted because there was an issue ...
5 years, 1 month ago (2015-11-17 18:09:35 UTC) #7
Eugene But (OOO till 7-30)
On 2015/11/17 18:09:35, xunjieli wrote: > This is to reland the refactoring CL which was ...
5 years, 1 month ago (2015-11-17 18:13:00 UTC) #8
mnaganov (inactive)
android_webview/ LGTM
5 years, 1 month ago (2015-11-17 18:14:48 UTC) #9
xunjieli
On 2015/11/17 18:13:00, eugenebut wrote: > On 2015/11/17 18:09:35, xunjieli wrote: > > This is ...
5 years, 1 month ago (2015-11-17 18:17:47 UTC) #12
Sami
content/browser/android/ lgtm.
5 years, 1 month ago (2015-11-17 18:20:48 UTC) #13
Eugene But (OOO till 7-30)
Thanks for updating CL. Please make sure that CL description fits 72 symbols, otherwise lgtm.
5 years, 1 month ago (2015-11-17 18:22:40 UTC) #14
sky
mojo LGTM
5 years, 1 month ago (2015-11-17 18:42:00 UTC) #15
mmenke
On 2015/11/17 18:42:00, sky wrote: > mojo LGTM LGTM. Helen: You can generally just TBR ...
5 years, 1 month ago (2015-11-17 18:57:15 UTC) #16
mmenke
https://codereview.chromium.org/1439953006/diff/60001/net/url_request/url_request_job_unittest.cc File net/url_request/url_request_job_unittest.cc (right): https://codereview.chromium.org/1439953006/diff/60001/net/url_request/url_request_job_unittest.cc#newcode79 net/url_request/url_request_job_unittest.cc:79: const MockTransaction kEmptyBody_Transaction = { Maybe kEmptyBodyGzip_Transaction?
5 years, 1 month ago (2015-11-17 18:57:32 UTC) #17
Randy Smith (Not in Mondays)
LGTM.
5 years, 1 month ago (2015-11-17 19:04:12 UTC) #18
davidben
lgtm with comment https://codereview.chromium.org/1439953006/diff/60001/content/browser/net/view_http_cache_job_factory.cc File content/browser/net/view_http_cache_job_factory.cc (right): https://codereview.chromium.org/1439953006/diff/60001/content/browser/net/view_http_cache_job_factory.cc#newcode169 content/browser/net/view_http_cache_job_factory.cc:169: int remaining = base::checked_cast<int>(data_.size()) - data_offset_; ...
5 years, 1 month ago (2015-11-17 19:54:07 UTC) #20
davidben
https://codereview.chromium.org/1439953006/diff/60001/content/browser/net/view_http_cache_job_factory.cc File content/browser/net/view_http_cache_job_factory.cc (right): https://codereview.chromium.org/1439953006/diff/60001/content/browser/net/view_http_cache_job_factory.cc#newcode169 content/browser/net/view_http_cache_job_factory.cc:169: int remaining = base::checked_cast<int>(data_.size()) - data_offset_; On 2015/11/17 19:54:06, ...
5 years, 1 month ago (2015-11-17 19:55:02 UTC) #21
xunjieli
Hi michaeln, tzik, jianli, falken, mtomasz, zork, Since this is a pretty mechanical re-landing of ...
5 years, 1 month ago (2015-11-17 20:28:36 UTC) #22
xunjieli
https://codereview.chromium.org/1439953006/diff/60001/content/browser/net/view_http_cache_job_factory.cc File content/browser/net/view_http_cache_job_factory.cc (right): https://codereview.chromium.org/1439953006/diff/60001/content/browser/net/view_http_cache_job_factory.cc#newcode169 content/browser/net/view_http_cache_job_factory.cc:169: int remaining = base::checked_cast<int>(data_.size()) - data_offset_; On 2015/11/17 19:55:02, ...
5 years, 1 month ago (2015-11-17 20:37:55 UTC) #23
falken
service worker lgtm
5 years, 1 month ago (2015-11-18 01:16:01 UTC) #24
tzik
fileapi LGTM
5 years, 1 month ago (2015-11-18 03:46:46 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1439953006/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1439953006/140001
5 years, 1 month ago (2015-11-18 14:27:58 UTC) #30
xunjieli
I have stamps for files (url_request_job, mojo, service worker, fileapi) that have changed since last ...
5 years, 1 month ago (2015-11-18 14:31:11 UTC) #31
commit-bot: I haz the power
Committed patchset #5 (id:140001)
5 years, 1 month ago (2015-11-18 14:34:15 UTC) #32
commit-bot: I haz the power
5 years, 1 month ago (2015-11-18 14:35:03 UTC) #33
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/d77911ac82186d65a8f11555a7a6b1678c769ba2
Cr-Commit-Position: refs/heads/master@{#360327}

Powered by Google App Engine
This is Rietveld 408576698