
Currently, NavigationThrottles attach only when a URLRequest will be created, allowing throttles to participate in the network request portion of a navigation. However, for navigations that will immedaitely commit because no URLRequest is needed, it is impossible to throttle the navigation. Navigations that immediately commit include about:blank, about:srcdoc, and most* (see below) same document navigations. This CL introduces a new NavigationThrottle callback, WillCommitWithoutUrlLoader. WillCommitWithoutUrlLoader is called only in the immediate commit case (when no other NavigationThrottle callbacks will be called), and allows the NavigationThrottle to defer or cancel the navigation, as any other callback does. Currently, no NavigationThrottles use WillCommitWithoutUrlLoader, but it will be used by a new throttle that will be introduced in https://chromium-review.googlesource.com/c/chromium/src/+/4092862. * Some same document navigations are committed synchronously in the renderer process, and the browser process is only told about the navigation after the fact, so we can't throttle them. Those navigations are renderer-initiated non-back-forward same-document navigations. WillCommitWithoutUrlLoader can intercept all browser-initiated same-document navigations, as well as renderer-initiated back-forward same-document navigations. Bug: 1067613, 1371580 Change-Id: I7066e69bee5e891c9aec1b79c8c266e011f726ea Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4210858 Commit-Queue: Nate Chapin <japhet@chromium.org> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: Alex Moshchuk <alexmos@chromium.org> Cr-Commit-Position: refs/heads/main@{#1102862}
19 lines
1.2 KiB
Plaintext
19 lines
1.2 KiB
Plaintext
// Generated with https://crrev.com/c/2220116 and:
|
|
// python3 tools/state_transitions/state_graph.py content/browser/renderer_host/navigation_request.cc NavigationState
|
|
//
|
|
// See tools/state_transitions/README.md
|
|
digraph createflow {
|
|
NOT_STARTED -> {WAITING_FOR_RENDERER_RESPONSE, WILL_START_NAVIGATION, WILL_START_REQUEST};
|
|
WAITING_FOR_RENDERER_RESPONSE -> {WILL_START_NAVIGATION, WILL_START_REQUEST};
|
|
WILL_START_NAVIGATION -> {WILL_START_REQUEST, WILL_FAIL_REQUEST};
|
|
WILL_START_REQUEST -> {WILL_REDIRECT_REQUEST, WILL_PROCESS_RESPONSE, WILL_COMMIT_WITHOUT_URL_LOADER, READY_TO_COMMIT, DID_COMMIT, CANCELING, WILL_FAIL_REQUEST, DID_COMMIT_ERROR_PAGE};
|
|
WILL_REDIRECT_REQUEST -> {WILL_REDIRECT_REQUEST, WILL_PROCESS_RESPONSE, CANCELING, WILL_FAIL_REQUEST};
|
|
WILL_PROCESS_RESPONSE -> {READY_TO_COMMIT, CANCELING, WILL_FAIL_REQUEST};
|
|
WILL_COMMIT_WITHOUT_URL_LOADER -> {READY_TO_COMMIT, CANCELING, WILL_FAIL_REQUEST};
|
|
READY_TO_COMMIT -> {NOT_STARTED, DID_COMMIT, DID_COMMIT_ERROR_PAGE};
|
|
CANCELING -> {READY_TO_COMMIT, WILL_FAIL_REQUEST};
|
|
WILL_FAIL_REQUEST -> {READY_TO_COMMIT, CANCELING, WILL_FAIL_REQUEST};
|
|
DID_COMMIT -> {};
|
|
DID_COMMIT_ERROR_PAGE -> {};
|
|
}
|