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

Unified Diff: content/renderer/render_view_impl.cc

Issue 118553006: Move DidFailProvisionalLoad handling from RenderView(Host) to RenderFrame(Host). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on ToT. Created 6 years, 11 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
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 339cee33b3d6f9eecdcd7c72afdcf2832eff889c..3f5319ebf74cacb12198be56ca31b4779789f52e 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3556,101 +3556,8 @@ void RenderViewImpl::didFailProvisionalLoad(WebFrame* frame,
// SSL manager can react to the provisional load failure before being
// notified the load stopped.
//
- WebDataSource* ds = frame->provisionalDataSource();
- DCHECK(ds);
-
- const WebURLRequest& failed_request = ds->request();
-
FOR_EACH_OBSERVER(
RenderViewObserver, observers_, DidFailProvisionalLoad(frame, error));
-
- bool show_repost_interstitial =
- (error.reason == net::ERR_CACHE_MISS &&
- EqualsASCII(failed_request.httpMethod(), "POST"));
-
- ViewHostMsg_DidFailProvisionalLoadWithError_Params params;
- params.frame_id = frame->identifier();
- params.frame_unique_name = frame->uniqueName();
- params.is_main_frame = !frame->parent();
- params.error_code = error.reason;
- GetContentClient()->renderer()->GetNavigationErrorStrings(
- frame,
- failed_request,
- error,
- renderer_preferences_.accept_languages,
- NULL,
- &params.error_description);
- params.url = error.unreachableURL;
- params.showing_repost_interstitial = show_repost_interstitial;
- Send(new ViewHostMsg_DidFailProvisionalLoadWithError(
- routing_id_, params));
-
- // Don't display an error page if this is simply a cancelled load. Aside
- // from being dumb, WebCore doesn't expect it and it will cause a crash.
- if (error.reason == net::ERR_ABORTED)
- return;
-
- // Don't display "client blocked" error page if browser has asked us not to.
- if (error.reason == net::ERR_BLOCKED_BY_CLIENT &&
- renderer_preferences_.disable_client_blocked_error_page) {
- return;
- }
-
- // Allow the embedder to suppress an error page.
- if (GetContentClient()->renderer()->ShouldSuppressErrorPage(
- error.unreachableURL)) {
- return;
- }
-
- if (RenderThreadImpl::current() &&
- RenderThreadImpl::current()->layout_test_mode()) {
- return;
- }
-
- // Make sure we never show errors in view source mode.
- frame->enableViewSourceMode(false);
-
- DocumentState* document_state = DocumentState::FromDataSource(ds);
- NavigationState* navigation_state = document_state->navigation_state();
-
- // If this is a failed back/forward/reload navigation, then we need to do a
- // 'replace' load. This is necessary to avoid messing up session history.
- // Otherwise, we do a normal load, which simulates a 'go' navigation as far
- // as session history is concerned.
- //
- // AUTO_SUBFRAME loads should always be treated as loads that do not advance
- // the page id.
- //
- // TODO(davidben): This should also take the failed navigation's replacement
- // state into account, if a location.replace() failed.
- bool replace =
- navigation_state->pending_page_id() != -1 ||
- PageTransitionCoreTypeIs(navigation_state->transition_type(),
- PAGE_TRANSITION_AUTO_SUBFRAME);
-
- // If we failed on a browser initiated request, then make sure that our error
- // page load is regarded as the same browser initiated request.
- if (!navigation_state->is_content_initiated()) {
- pending_navigation_params_.reset(new ViewMsg_Navigate_Params);
- pending_navigation_params_->page_id =
- navigation_state->pending_page_id();
- pending_navigation_params_->pending_history_list_offset =
- navigation_state->pending_history_list_offset();
- pending_navigation_params_->should_clear_history_list =
- navigation_state->history_list_was_cleared();
- pending_navigation_params_->transition =
- navigation_state->transition_type();
- pending_navigation_params_->request_time =
- document_state->request_time();
- pending_navigation_params_->should_replace_current_entry = replace;
- }
-
- // Provide the user with a more helpful error page?
- if (MaybeLoadAlternateErrorPage(frame, error, replace))
- return;
-
- // Fallback to a local error page.
- LoadNavigationErrorPage(frame, failed_request, error, std::string(), replace);
}
void RenderViewImpl::didCommitProvisionalLoad(WebFrame* frame,
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698