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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 1048963002: Fix incorrect creation of duplicate navigation entries for repeated page load failures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@committype3
Patch Set: works Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 failed_request, 2512 failed_request,
2513 error, 2513 error,
2514 NULL, 2514 NULL,
2515 &params.error_description); 2515 &params.error_description);
2516 params.url = error.unreachableURL; 2516 params.url = error.unreachableURL;
2517 params.showing_repost_interstitial = show_repost_interstitial; 2517 params.showing_repost_interstitial = show_repost_interstitial;
2518 Send(new FrameHostMsg_DidFailProvisionalLoadWithError( 2518 Send(new FrameHostMsg_DidFailProvisionalLoadWithError(
2519 routing_id_, params)); 2519 routing_id_, params));
2520 2520
2521 // Don't display an error page if this is simply a cancelled load. Aside 2521 // Don't display an error page if this is simply a cancelled load. Aside
2522 // from being dumb, WebCore doesn't expect it and it will cause a crash. 2522 // from being dumb, Blink doesn't expect it and it will cause a crash.
2523 if (error.reason == net::ERR_ABORTED) 2523 if (error.reason == net::ERR_ABORTED)
2524 return; 2524 return;
2525 2525
2526 // Don't display "client blocked" error page if browser has asked us not to. 2526 // Don't display "client blocked" error page if browser has asked us not to.
2527 if (error.reason == net::ERR_BLOCKED_BY_CLIENT && 2527 if (error.reason == net::ERR_BLOCKED_BY_CLIENT &&
2528 render_view_->renderer_preferences_.disable_client_blocked_error_page) { 2528 render_view_->renderer_preferences_.disable_client_blocked_error_page) {
2529 return; 2529 return;
2530 } 2530 }
2531 2531
2532 // Allow the embedder to suppress an error page. 2532 // Allow the embedder to suppress an error page.
(...skipping 11 matching lines...) Expand all
2544 frame->enableViewSourceMode(false); 2544 frame->enableViewSourceMode(false);
2545 2545
2546 DocumentState* document_state = DocumentState::FromDataSource(ds); 2546 DocumentState* document_state = DocumentState::FromDataSource(ds);
2547 NavigationStateImpl* navigation_state = 2547 NavigationStateImpl* navigation_state =
2548 static_cast<NavigationStateImpl*>(document_state->navigation_state()); 2548 static_cast<NavigationStateImpl*>(document_state->navigation_state());
2549 2549
2550 // If this is a failed back/forward/reload navigation, then we need to do a 2550 // If this is a failed back/forward/reload navigation, then we need to do a
2551 // 'replace' load. This is necessary to avoid messing up session history. 2551 // 'replace' load. This is necessary to avoid messing up session history.
2552 // Otherwise, we do a normal load, which simulates a 'go' navigation as far 2552 // Otherwise, we do a normal load, which simulates a 'go' navigation as far
2553 // as session history is concerned. 2553 // as session history is concerned.
2554 // 2554 bool replace = commit_type != blink::WebStandardCommit;
2555 // AUTO_SUBFRAME loads should always be treated as loads that do not advance
2556 // the page id.
2557 //
2558 // TODO(davidben): This should also take the failed navigation's replacement
2559 // state into account, if a location.replace() failed.
2560 bool replace =
2561 navigation_state->request_params().page_id != -1 ||
2562 ui::PageTransitionCoreTypeIs(navigation_state->GetTransitionType(),
2563 ui::PAGE_TRANSITION_AUTO_SUBFRAME);
2564 2555
2565 // If we failed on a browser initiated request, then make sure that our error 2556 // If we failed on a browser initiated request, then make sure that our error
2566 // page load is regarded as the same browser initiated request. 2557 // page load is regarded as the same browser initiated request.
2567 if (!navigation_state->IsContentInitiated()) { 2558 if (!navigation_state->IsContentInitiated()) {
2568 pending_navigation_params_.reset(new NavigationParams( 2559 pending_navigation_params_.reset(new NavigationParams(
2569 navigation_state->common_params(), navigation_state->start_params(), 2560 navigation_state->common_params(), navigation_state->start_params(),
2570 navigation_state->request_params())); 2561 navigation_state->request_params()));
2571 pending_navigation_params_->request_params.request_time = 2562 pending_navigation_params_->request_params.request_time =
2572 document_state->request_time(); 2563 document_state->request_time();
2573 } 2564 }
(...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after
4691 4682
4692 #if defined(ENABLE_BROWSER_CDMS) 4683 #if defined(ENABLE_BROWSER_CDMS)
4693 RendererCdmManager* RenderFrameImpl::GetCdmManager() { 4684 RendererCdmManager* RenderFrameImpl::GetCdmManager() {
4694 if (!cdm_manager_) 4685 if (!cdm_manager_)
4695 cdm_manager_ = new RendererCdmManager(this); 4686 cdm_manager_ = new RendererCdmManager(this);
4696 return cdm_manager_; 4687 return cdm_manager_;
4697 } 4688 }
4698 #endif // defined(ENABLE_BROWSER_CDMS) 4689 #endif // defined(ENABLE_BROWSER_CDMS)
4699 4690
4700 } // namespace content 4691 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698