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

Unified Diff: content/public/browser/navigation_handle.cc

Issue 2345913002: Fix NetErrorTabHelper with PlzNavigate. (Closed)
Patch Set: fix NavigationHandle::IsErrorPage for reloads of error pages Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/browser/navigation_handle.cc
diff --git a/content/public/browser/navigation_handle.cc b/content/public/browser/navigation_handle.cc
index 723593a78b95ca12122003d5cd25bd44c8b8ccd9..c8d2496d056a2d56138f57fe93e63443bfdc2943 100644
--- a/content/public/browser/navigation_handle.cc
+++ b/content/public/browser/navigation_handle.cc
@@ -24,7 +24,9 @@ WebContents* NavigationHandle::GetWebContents() {
std::unique_ptr<NavigationHandle>
NavigationHandle::CreateNavigationHandleForTesting(
const GURL& url,
- RenderFrameHost* render_frame_host) {
+ RenderFrameHost* render_frame_host,
+ bool committed,
+ net::Error error) {
std::unique_ptr<NavigationHandleImpl> handle_impl =
NavigationHandleImpl::Create(
url, static_cast<RenderFrameHostImpl*>(render_frame_host)
@@ -33,6 +35,12 @@ NavigationHandle::CreateNavigationHandleForTesting(
false, // is_synchronous
false, // is_srcdoc
base::TimeTicks::Now(), 0);
+ handle_impl->set_render_frame_host(
+ static_cast<RenderFrameHostImpl*>(render_frame_host));
+ if (error != net::OK)
+ handle_impl->set_net_error_code(error);
+ if (committed)
+ handle_impl->CallDidCommitNavigationForTesting(url);
return std::unique_ptr<NavigationHandle>(std::move(handle_impl));
}

Powered by Google App Engine
This is Rietveld 408576698