|
Stop using ResourceController in ResourceThrottle
The following classes are subclasses of the ResourceController
interface:
- AsyncRevalidationDriver
- DetachableResourceHandler
- InterceptingResourceHandler
- MimeSniffingResourceHandler
- ResourceLoader
- ThrottlingResourceHandler
The following classes out of them sets themselves as the controller for
the next handler:
- DetachableResourceHandler
- InterceptingResourceHandler
- MimeSniffingResourceHandler
- ResourceLoader
Classes implementing LayeredResourceHandler pass the controller given
to SetController() call through to the next handler.
With this mechanism, we can chain handlers, let each handler
communicate defer signal via the ResourceHandler interface methods,
and let the left most handler to propagate cancel/resume signal to the
right most handler (it's ResourceLoader. possibly intercepted by the
4 classes). This is easy to understand.
On the other hand, the AsyncRevalidationDriver and
ThrottlingResourceHandler are diverting the ResourceController
interface for defining their own interface to allow the throttles they
have to resume handlers deferred due to throttling. Not for
communication with the next handler.
Moreover, the ResourceThrottle is exposing the ResourceController
instance to its subclasses and letting them directly operate on the
instance. This is making the ResourceController interface and handler
chain hard to understand e.g. by making the cross reference on
codesearch list a lot of callers.
I'd like to make this cleaner by:
- adding methods on ResourceThrottle that hides the details of
communication with the associated handler,
- introduce a dedicated interface ResourceThrottle::Delegate between
the ResourceThrottle and the handlers than diverting the
ResourceController interface.
Motivation:
- I plan to change AsyncResourceHandler::OnFollowRedirect() to take
more arguments to reflect changes in parameters made by Blink (See
crbug.com/646277 and crbug.com/665766 for the details why we need to
do this).
- I want to construct a path to propagate it to the URLRequest, but
ResourceController::Resume() is used for various kinds of resuming.
I want to separate redirect handling logic in Resume() into a separate
method on ResourceController than adding arguments to Resume().
- Found that ResourceController is used for various purposes. Before
fixing the issue, I wanted to clean it up for readability.
R=reillyg@chromium.org,boliu@chromium.org,jochen@chromium.org
BUG= 646277
Committed: https://crrev.com/64fa092bc4ccdcb1c0cc08b93d6c1bd49363adb0
Cr-Commit-Position: refs/heads/master@{#436889}
Total comments: 4
Total comments: 7
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+156 lines, -153 lines) |
Patch |
|
M |
android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
|
View
|
|
2 chunks |
+2 lines, -3 lines |
0 comments
|
Download
|
|
M |
chrome/browser/chromeos/login/signin/merge_session_resource_throttle.cc
|
View
|
|
2 chunks |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/component_updater/component_updater_resource_throttle.cc
|
View
|
|
2 chunks |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_resource_throttle.cc
|
View
|
|
3 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_resource_throttle_unittest.cc
|
View
|
1
|
6 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/streams_private/streams_private_apitest.cc
|
View
|
|
2 chunks |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
|
View
|
1
2
3
4
5
|
4 chunks |
+3 lines, -6 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/user_script_listener.cc
|
View
|
|
3 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/user_script_listener_unittest.cc
|
View
|
1
2
3
4
5
|
5 chunks |
+9 lines, -12 lines |
0 comments
|
Download
|
|
M |
chrome/browser/loader/data_reduction_proxy_resource_throttle_android.cc
|
View
|
1
2
3
4
5
|
4 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/loader/safe_browsing_resource_throttle.h
|
View
|
1
2
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/loader/safe_browsing_resource_throttle.cc
|
View
|
1
2
|
5 chunks |
+3 lines, -8 lines |
0 comments
|
Download
|
|
M |
chrome/browser/prerender/prerender_contents.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/prerender/prerender_resource_throttle.h
|
View
|
|
1 chunk |
+1 line, -5 lines |
0 comments
|
Download
|
|
M |
chrome/browser/prerender/prerender_resource_throttle.cc
|
View
|
|
4 chunks |
+4 lines, -9 lines |
0 comments
|
Download
|
|
M |
chrome/browser/prerender/prerender_resource_throttle_unittest.cc
|
View
|
1
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/supervised_user/supervised_user_resource_throttle.cc
|
View
|
|
2 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
components/web_restrictions/browser/web_restrictions_resource_throttle.cc
|
View
|
|
2 chunks |
+2 lines, -3 lines |
0 comments
|
Download
|
|
M |
components/web_restrictions/browser/web_restrictions_resource_throttle_unittest.cc
|
View
|
1
|
8 chunks |
+17 lines, -16 lines |
0 comments
|
Download
|
|
M |
content/browser/loader/async_revalidation_driver.h
|
View
|
1
|
3 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/browser/loader/async_revalidation_driver.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
content/browser/loader/async_revalidation_driver_unittest.cc
|
View
|
1
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/loader/cross_site_resource_handler_browsertest.cc
|
View
|
|
3 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/browser/loader/navigation_resource_throttle.cc
|
View
|
1
2
|
2 chunks |
+4 lines, -5 lines |
0 comments
|
Download
|
|
M |
content/browser/loader/resource_dispatcher_host_unittest.cc
|
View
|
1
2
3
4
5
|
5 chunks |
+9 lines, -9 lines |
0 comments
|
Download
|
|
M |
content/browser/loader/resource_scheduler.cc
|
View
|
|
2 chunks |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/loader/resource_scheduler_unittest.cc
|
View
|
1
|
4 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/browser/loader/throttling_resource_handler.h
|
View
|
1
|
4 chunks |
+4 lines, -5 lines |
0 comments
|
Download
|
|
M |
content/browser/loader/throttling_resource_handler.cc
|
View
|
1
|
9 chunks |
+9 lines, -8 lines |
0 comments
|
Download
|
|
M |
content/public/browser/resource_throttle.h
|
View
|
1
2
3
4
|
2 chunks |
+31 lines, -7 lines |
0 comments
|
Download
|
|
M |
content/public/browser/resource_throttle.cc
|
View
|
1
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
M |
extensions/browser/extension_request_limiting_throttle.cc
|
View
|
|
3 chunks |
+2 lines, -3 lines |
0 comments
|
Download
|
Total messages: 76 (59 generated)
|