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

Issue 2481093003: Introduce ResourceRequesterInfo to abstract the requester of resource request (Closed)

Created:
4 years, 1 month ago by horo
Modified:
4 years ago
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, serviceworker-reviews, creis+watch_chromium.org, shimazu+serviceworker_chromium.org, nasko+codewatch_chromium.org, jam, Randy Smith (Not in Mondays), nhiroki, kinuko+serviceworker, darin-cc_chromium.org, blink-worker-reviews_chromium.org, loading-reviews_chromium.org, horo+watch_chromium.org, kinuko+watch, tzik, clamy, asanka
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce ResourceRequesterInfo to abstract the requester of resource requests. Currently there are three types of resource request. - Normal resource request from renderer process. - Resource request for browser side navigation. (PlzNavigate). - Download request or Page Save request. In ResourceRequestInfoImpl, these type are distinguished by process_type and the existence of ResourceMessageFilter. But it is a bit confusing. For example: - AsyncRevalidationManager is checking only the existence of the filter to check that "the renderer is gone" or "the request is for PlzNavigate". - service_worker_context field is added for PlzNavigate support. And the field is used only when the filter is not available in HandleServiceWorkerLink(). This CL introduces ResourceRequesterInfo to make it easy to distinguish those requester types. BUG=468227, 649558 TBR=michaeln@chromium.org Committed: https://crrev.com/227286f7cd60cb0ed8756cd1efefb2d694c9734f Cr-Commit-Position: refs/heads/master@{#434957}

Patch Set 1 #

Patch Set 2 #

Total comments: 28

Patch Set 3 : incorporated yhirano & kinuko's comment #

Total comments: 15

Patch Set 4 : incorporated mmemke's comment #

Total comments: 6

Patch Set 5 : rebase #

Patch Set 6 : incorporated kinuko's comment #

Patch Set 7 : fix unittests #

Total comments: 18

Patch Set 8 : incorporated mmenke's comment #

Patch Set 9 : fix URLLoaderFactoryImplTest.CancelFromRenderer #

Total comments: 12

Patch Set 10 : incorporated kinuko's comment #

Total comments: 17

Patch Set 11 : incorporated kinuko's comment #

Total comments: 39

Patch Set 12 : incorporated mmenke's comment #

Patch Set 13 : make ResourceRequestInfoImpl::requester_info() non-const #

Total comments: 4

Patch Set 14 : incorporated mmenke's comment #

Total comments: 2

Patch Set 15 : s/esource/resource/ #

Total comments: 2

Patch Set 16 : incorporated yhirano's comment #

Patch Set 17 : fix test failure #

Patch Set 18 : fix URLLoaderFactoryImplTest/URLLoaderFactoryImplTest.GetFailedResponse2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+759 lines, -506 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/appcache/appcache_interceptor.h View 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/appcache/appcache_interceptor.cc View 3 4 5 6 7 8 9 10 3 chunks +6 lines, -3 lines 0 comments Download
M content/browser/loader/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 11 chunks +16 lines, -7 lines 0 comments Download
M content/browser/loader/async_resource_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 8 chunks +14 lines, -12 lines 0 comments Download
M content/browser/loader/async_resource_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +2 lines, -5 lines 0 comments Download
M content/browser/loader/async_revalidation_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M content/browser/loader/async_revalidation_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +19 lines, -18 lines 0 comments Download
M content/browser/loader/async_revalidation_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +3 lines, -4 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 11 chunks +24 lines, -22 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 50 chunks +161 lines, -153 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 44 chunks +67 lines, -68 lines 0 comments Download
M content/browser/loader/resource_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M content/browser/loader/resource_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/loader/resource_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +16 lines, -42 lines 0 comments Download
M content/browser/loader/resource_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +45 lines, -24 lines 0 comments Download
M content/browser/loader/resource_request_info_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 10 chunks +6 lines, -33 lines 0 comments Download
M content/browser/loader/resource_request_info_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 10 chunks +38 lines, -44 lines 0 comments Download
A content/browser/loader/resource_requester_info.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +152 lines, -0 lines 0 comments Download
A content/browser/loader/resource_requester_info.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +88 lines, -0 lines 0 comments Download
M content/browser/loader/sync_resource_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -3 lines 0 comments Download
M content/browser/loader/url_loader_factory_impl.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +11 lines, -10 lines 0 comments Download
M content/browser/loader/url_loader_factory_impl.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +20 lines, -19 lines 0 comments Download
M content/browser/loader/url_loader_factory_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 9 chunks +41 lines, -11 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/service_worker/link_header_support.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/service_worker/link_header_support.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +8 lines, -13 lines 0 comments Download
M content/browser/service_worker/service_worker_fetch_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +9 lines, -6 lines 0 comments Download

Messages

Total messages: 193 (156 generated)
horo
yhirano@ Could you please review this?
4 years, 1 month ago (2016-11-09 04:55:12 UTC) #70
yhirano
https://codereview.chromium.org/2481093003/diff/320001/content/browser/appcache/appcache_interceptor.cc File content/browser/appcache/appcache_interceptor.cc (right): https://codereview.chromium.org/2481093003/diff/320001/content/browser/appcache/appcache_interceptor.cc#newcode15 content/browser/appcache/appcache_interceptor.cc:15: #include "content/browser/loader/resource_message_filter.h" Note needed? https://codereview.chromium.org/2481093003/diff/320001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/2481093003/diff/320001/content/browser/loader/async_resource_handler.cc#newcode23 ...
4 years, 1 month ago (2016-11-10 06:42:30 UTC) #74
kinuko
Drive-by... I feel this could be a good cleanup but feels a bit rough. It ...
4 years, 1 month ago (2016-11-10 08:17:57 UTC) #76
horo
https://codereview.chromium.org/2481093003/diff/320001/content/browser/appcache/appcache_interceptor.cc File content/browser/appcache/appcache_interceptor.cc (right): https://codereview.chromium.org/2481093003/diff/320001/content/browser/appcache/appcache_interceptor.cc#newcode15 content/browser/appcache/appcache_interceptor.cc:15: #include "content/browser/loader/resource_message_filter.h" On 2016/11/10 06:42:29, yhirano wrote: > Note ...
4 years, 1 month ago (2016-11-10 14:46:33 UTC) #79
mmenke
Preliminary comments, sorry for the delay. https://codereview.chromium.org/2481093003/diff/340001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/2481093003/diff/340001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode1064 content/browser/loader/resource_dispatcher_host_impl.cc:1064: DCHECK(requester_info->IsRenderer()); Is ResourceDispatcher ...
4 years, 1 month ago (2016-11-11 21:19:59 UTC) #82
kinuko
(response only, no new review comments) https://codereview.chromium.org/2481093003/diff/320001/content/browser/loader/resource_message_filter.h File content/browser/loader/resource_message_filter.h (right): https://codereview.chromium.org/2481093003/diff/320001/content/browser/loader/resource_message_filter.h#newcode119 content/browser/loader/resource_message_filter.h:119: scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; On ...
4 years, 1 month ago (2016-11-14 07:04:13 UTC) #92
horo
https://codereview.chromium.org/2481093003/diff/340001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/2481093003/diff/340001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode1064 content/browser/loader/resource_dispatcher_host_impl.cc:1064: DCHECK(requester_info->IsRenderer()); On 2016/11/11 21:19:59, mmenke wrote: > Is ResourceDispatcher ...
4 years, 1 month ago (2016-11-14 08:28:50 UTC) #95
kinuko
https://codereview.chromium.org/2481093003/diff/380001/content/browser/loader/resource_message_filter.h File content/browser/loader/resource_message_filter.h (right): https://codereview.chromium.org/2481093003/diff/380001/content/browser/loader/resource_message_filter.h#newcode119 content/browser/loader/resource_message_filter.h:119: scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; I still feel having these fields is ...
4 years, 1 month ago (2016-11-14 16:29:41 UTC) #98
horo
https://codereview.chromium.org/2481093003/diff/380001/content/browser/loader/resource_message_filter.h File content/browser/loader/resource_message_filter.h (right): https://codereview.chromium.org/2481093003/diff/380001/content/browser/loader/resource_message_filter.h#newcode119 content/browser/loader/resource_message_filter.h:119: scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; On 2016/11/14 16:29:41, kinuko wrote: > I ...
4 years, 1 month ago (2016-11-17 11:57:06 UTC) #101
Randy Smith (Not in Mondays)
[+Asanka for DownloadManagerImpl involvement mentioned in last comment.]
4 years, 1 month ago (2016-11-17 15:33:04 UTC) #105
mmenke
Beyond working towards fixing the bug, I think this is a good CL - love ...
4 years, 1 month ago (2016-11-17 16:27:20 UTC) #108
horo
https://codereview.chromium.org/2481093003/diff/440001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/2481093003/diff/440001/content/browser/loader/async_resource_handler.cc#newcode220 content/browser/loader/async_resource_handler.cc:220: DCHECK(GetRequestInfo()->requester_info().IsRenderer()); On 2016/11/17 16:27:19, mmenke wrote: > include base/logging.h ...
4 years, 1 month ago (2016-11-17 17:50:27 UTC) #114
kinuko
Thanks, I like the new code much better now! Almost looking good for the part ...
4 years, 1 month ago (2016-11-18 01:29:21 UTC) #121
horo
https://codereview.chromium.org/2481093003/diff/500001/content/browser/loader/async_resource_handler_unittest.cc File content/browser/loader/async_resource_handler_unittest.cc (right): https://codereview.chromium.org/2481093003/diff/500001/content/browser/loader/async_resource_handler_unittest.cc#newcode102 content/browser/loader/async_resource_handler_unittest.cc:102: OnFilterAdded(nullptr); On 2016/11/18 01:29:21, kinuko wrote: > Needing to ...
4 years, 1 month ago (2016-11-18 02:02:52 UTC) #128
kinuko
Thanks, lgtm for the part I care about % some more nits https://codereview.chromium.org/2481093003/diff/560001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc ...
4 years, 1 month ago (2016-11-21 13:36:26 UTC) #137
horo
https://codereview.chromium.org/2481093003/diff/560001/content/browser/loader/resource_dispatcher_host_impl.cc File content/browser/loader/resource_dispatcher_host_impl.cc (right): https://codereview.chromium.org/2481093003/diff/560001/content/browser/loader/resource_dispatcher_host_impl.cc#newcode231 content/browser/loader/resource_dispatcher_host_impl.cc:231: IPC::Sender* filter, On 2016/11/21 13:36:25, kinuko wrote: > nit: ...
4 years, 1 month ago (2016-11-21 14:58:00 UTC) #144
mmenke
Just a bunch of nits. Want to do a careful once over of RDH, but ...
4 years, 1 month ago (2016-11-21 19:51:56 UTC) #147
horo
https://codereview.chromium.org/2481093003/diff/600001/content/browser/loader/async_resource_handler.cc File content/browser/loader/async_resource_handler.cc (right): https://codereview.chromium.org/2481093003/diff/600001/content/browser/loader/async_resource_handler.cc#newcode335 content/browser/loader/async_resource_handler.cc:335: const ResourceRequestInfoImpl* info = GetRequestInfo(); On 2016/11/21 19:51:55, mmenke ...
4 years, 1 month ago (2016-11-22 01:12:08 UTC) #150
kinuko
https://codereview.chromium.org/2481093003/diff/600001/content/browser/loader/resource_request_info_impl.h File content/browser/loader/resource_request_info_impl.h (right): https://codereview.chromium.org/2481093003/diff/600001/content/browser/loader/resource_request_info_impl.h#newcode111 content/browser/loader/resource_request_info_impl.h:111: ResourceRequesterInfo& requester_info() const { return *requester_info_; } On 2016/11/22 ...
4 years, 1 month ago (2016-11-22 02:44:47 UTC) #151
horo
On 2016/11/22 02:44:47, kinuko wrote: > https://codereview.chromium.org/2481093003/diff/600001/content/browser/loader/resource_request_info_impl.h > File content/browser/loader/resource_request_info_impl.h (right): > > https://codereview.chromium.org/2481093003/diff/600001/content/browser/loader/resource_request_info_impl.h#newcode111 > ...
4 years, 1 month ago (2016-11-22 03:52:10 UTC) #154
horo
On 2016/11/22 02:44:47, kinuko wrote: > https://codereview.chromium.org/2481093003/diff/600001/content/browser/loader/resource_request_info_impl.h > File content/browser/loader/resource_request_info_impl.h (right): > > https://codereview.chromium.org/2481093003/diff/600001/content/browser/loader/resource_request_info_impl.h#newcode111 > ...
4 years, 1 month ago (2016-11-22 03:52:16 UTC) #156
mmenke
Just two things, and I've ready to sign off (Not signig off now due to ...
4 years, 1 month ago (2016-11-22 17:44:13 UTC) #157
horo
https://codereview.chromium.org/2481093003/diff/640001/content/browser/loader/DEPS File content/browser/loader/DEPS (right): https://codereview.chromium.org/2481093003/diff/640001/content/browser/loader/DEPS#newcode145 content/browser/loader/DEPS:145: "+content/browser/loader/resource_requester_info.h", On 2016/11/22 17:44:12, mmenke wrote: > Need to ...
4 years ago (2016-11-24 04:07:11 UTC) #160
horo
michaeln@ Could you please review this CL from the appcache point of view? falken@ Could ...
4 years ago (2016-11-24 04:10:35 UTC) #162
falken
service worker lgtm https://codereview.chromium.org/2481093003/diff/660001/content/browser/loader/resource_requester_info.h File content/browser/loader/resource_requester_info.h (right): https://codereview.chromium.org/2481093003/diff/660001/content/browser/loader/resource_requester_info.h#newcode32 content/browser/loader/resource_requester_info.h:32: // This class represents the type ...
4 years ago (2016-11-24 07:34:44 UTC) #165
horo
Thank you. https://codereview.chromium.org/2481093003/diff/660001/content/browser/loader/resource_requester_info.h File content/browser/loader/resource_requester_info.h (right): https://codereview.chromium.org/2481093003/diff/660001/content/browser/loader/resource_requester_info.h#newcode32 content/browser/loader/resource_requester_info.h:32: // This class represents the type of ...
4 years ago (2016-11-25 10:25:11 UTC) #166
mmenke
loader/ LGTM!
4 years ago (2016-11-28 18:47:24 UTC) #167
yhirano
https://codereview.chromium.org/2481093003/diff/680001/content/browser/loader/async_revalidation_manager.h File content/browser/loader/async_revalidation_manager.h (right): https://codereview.chromium.org/2481093003/diff/680001/content/browser/loader/async_revalidation_manager.h#newcode40 content/browser/loader/async_revalidation_manager.h:40: void BeginAsyncRevalidation(net::URLRequest& for_request, Google C++ style guide requires a ...
4 years ago (2016-11-29 03:51:51 UTC) #168
horo
https://codereview.chromium.org/2481093003/diff/680001/content/browser/loader/async_revalidation_manager.h File content/browser/loader/async_revalidation_manager.h (right): https://codereview.chromium.org/2481093003/diff/680001/content/browser/loader/async_revalidation_manager.h#newcode40 content/browser/loader/async_revalidation_manager.h:40: void BeginAsyncRevalidation(net::URLRequest& for_request, On 2016/11/29 03:51:51, yhirano wrote: > ...
4 years ago (2016-11-29 04:38:32 UTC) #169
yhirano
lgtm
4 years ago (2016-11-29 04:40:20 UTC) #172
horo
michaeln@ is ooo, and the change in appcache_interceptor is trivial. So I'd like to add ...
4 years ago (2016-11-29 06:40:01 UTC) #176
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2481093003/720001
4 years ago (2016-11-29 06:41:08 UTC) #181
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/346088)
4 years ago (2016-11-29 08:37:43 UTC) #183
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2481093003/720001
4 years ago (2016-11-29 09:36:11 UTC) #185
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2481093003/740001
4 years ago (2016-11-29 09:47:36 UTC) #188
commit-bot: I haz the power
Committed patchset #18 (id:740001)
4 years ago (2016-11-29 11:11:11 UTC) #191
commit-bot: I haz the power
4 years ago (2016-11-29 11:13:14 UTC) #193
Message was sent while issue was closed.
Patchset 18 (id:??) landed as
https://crrev.com/227286f7cd60cb0ed8756cd1efefb2d694c9734f
Cr-Commit-Position: refs/heads/master@{#434957}

Powered by Google App Engine
This is Rietveld 408576698