In between two web_tests, Chrome may reuse the current process.
It requests the renderer to reset some state and navigate
to about:blank.
The current flow is:
┌───────┐ ┌────────┐
│browser│ │renderer│
└───┬───┘ └───┬────┘
(end of previous test) │
│ │
│ ResetRendererAfterWebTest() │
│──────────────────────────────────────>│ Store the callback
│BeginNavigation(blank,opaque initiator)│
│<──────────────────────────────────────│
│ │
│ CommitNavigation │
│──────────────────────────────────────>│ call the callback.
│ Callback │
│<──────────────────────────────────────│
(start new test) │
┌───┴───┐ ┌───┴────┐
│browser│ │renderer│
└───────┘ └────────┘
It has two problems:
1. Navigation is implemented in the browser process. There are no need
to request the renderer process to navigate. This is a pure waste of
time.
2. The navigations to about:blank can commit in a different process,
which will cause a failure when it happens.
After this patch, the browser initiates the navigation and it doesn't wait on
ResetRendererAfterWebTest() callback anymore.
┌───────┐ ┌────────────┐
│browser│ │new renderer│
└───┬───┘ └───┬────────┘
(end of previous test) │
│ │
│ CommitNavigation(about:blank) │
│──────────────────────────────────────>│
│ DidCommitNavigation() │
│<──────────────────────────────────────│
│ │
│ ResetRendererAfterWebTest() │
│──────────────────────────────────────>│
(start new test) │
┌───┴───┐ ┌───┴───────┐
│browser│ │renderer │
└───────┘ └───────────┘
Bug: 1190842
Change-Id: Ie5f18d1f338f6fb80a11a8c18df71b0f786edfdf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2784821
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#868604}