Commit 12519ebe authored by Alex Turner's avatar Alex Turner Committed by Commit Bot

Expose IsWaitingToCommit() on NavigationHandle

Currently, it is only defined on NavigationRequests. Defining it on
the handles too will allow for easy determination of when a navigation
has passed through ReadyToCommitNavigation(), i.e. via HasCommitted() ||
IsWaitingToCommit(). Note that some navigations can pass through
ReadyToCommitNavigation() without eventually committing -- e.g. due to a
doc.write. Adding this call will simplify handling of these edge cases.

Bug: 1101584
Change-Id: I7c272ef2768a901b8988bfe8e28ae1a0c3ef2ca9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2536389Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Alex Turner <alexmt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827933}
parent 05ae7ee8
......@@ -325,6 +325,7 @@ class CONTENT_EXPORT NavigationRequest
bool GetIsOverridingUserAgent() override;
void SetSilentlyIgnoreErrors() override;
network::mojom::WebSandboxFlags SandboxFlagsToCommit() override;
bool IsWaitingToCommit() override;
// Called on the UI thread by the Navigator to start the navigation.
// The NavigationRequest can be deleted while BeginNavigation() is called.
......@@ -684,11 +685,6 @@ class CONTENT_EXPORT NavigationRequest
// Returns the coop status information relevant to the current navigation.
CrossOriginOpenerPolicyStatus& coop_status() { return coop_status_; }
// Whether the navigation was sent to be committed in a renderer by the
// RenderFrameHost. This can either be for the commit of a successful
// navigation or an error page.
bool IsWaitingToCommit();
// Returns true if |url| and |base_url| represent a WebView
// loadDataWithBaseUrl navigation.
static bool IsLoadDataWithBaseURL(const GURL& url, const GURL& base_url);
......
......@@ -426,6 +426,11 @@ class CONTENT_EXPORT NavigationHandle {
// directly into the RenderDocumentHost.
virtual network::mojom::WebSandboxFlags SandboxFlagsToCommit() = 0;
// Whether the navigation was sent to be committed in a renderer by the
// RenderFrameHost. This can either be for the commit of a successful
// navigation or an error page.
virtual bool IsWaitingToCommit() = 0;
// Testing methods ----------------------------------------------------------
//
// The following methods should be used exclusively for writing unit tests.
......
......@@ -143,6 +143,7 @@ class MockNavigationHandle : public NavigationHandle {
MOCK_METHOD(bool, GetIsOverridingUserAgent, ());
MOCK_METHOD(void, SetSilentlyIgnoreErrors, ());
MOCK_METHOD(network::mojom::WebSandboxFlags, SandboxFlagsToCommit, ());
MOCK_METHOD(bool, IsWaitingToCommit, ());
void set_url(const GURL& url) { url_ = url; }
void set_previous_url(const GURL& previous_url) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment