| OLD | NEW |
| 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 2511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2522 failed_request, | 2522 failed_request, |
| 2523 error, | 2523 error, |
| 2524 NULL, | 2524 NULL, |
| 2525 ¶ms.error_description); | 2525 ¶ms.error_description); |
| 2526 params.url = error.unreachableURL; | 2526 params.url = error.unreachableURL; |
| 2527 params.showing_repost_interstitial = show_repost_interstitial; | 2527 params.showing_repost_interstitial = show_repost_interstitial; |
| 2528 Send(new FrameHostMsg_DidFailProvisionalLoadWithError( | 2528 Send(new FrameHostMsg_DidFailProvisionalLoadWithError( |
| 2529 routing_id_, params)); | 2529 routing_id_, params)); |
| 2530 | 2530 |
| 2531 // Don't display an error page if this is simply a cancelled load. Aside | 2531 // Don't display an error page if this is simply a cancelled load. Aside |
| 2532 // from being dumb, WebCore doesn't expect it and it will cause a crash. | 2532 // from being dumb, Blink doesn't expect it and it will cause a crash. |
| 2533 if (error.reason == net::ERR_ABORTED) | 2533 if (error.reason == net::ERR_ABORTED) |
| 2534 return; | 2534 return; |
| 2535 | 2535 |
| 2536 // Don't display "client blocked" error page if browser has asked us not to. | 2536 // Don't display "client blocked" error page if browser has asked us not to. |
| 2537 if (error.reason == net::ERR_BLOCKED_BY_CLIENT && | 2537 if (error.reason == net::ERR_BLOCKED_BY_CLIENT && |
| 2538 render_view_->renderer_preferences_.disable_client_blocked_error_page) { | 2538 render_view_->renderer_preferences_.disable_client_blocked_error_page) { |
| 2539 return; | 2539 return; |
| 2540 } | 2540 } |
| 2541 | 2541 |
| 2542 // Allow the embedder to suppress an error page. | 2542 // Allow the embedder to suppress an error page. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2554 frame->enableViewSourceMode(false); | 2554 frame->enableViewSourceMode(false); |
| 2555 | 2555 |
| 2556 DocumentState* document_state = DocumentState::FromDataSource(ds); | 2556 DocumentState* document_state = DocumentState::FromDataSource(ds); |
| 2557 NavigationStateImpl* navigation_state = | 2557 NavigationStateImpl* navigation_state = |
| 2558 static_cast<NavigationStateImpl*>(document_state->navigation_state()); | 2558 static_cast<NavigationStateImpl*>(document_state->navigation_state()); |
| 2559 | 2559 |
| 2560 // If this is a failed back/forward/reload navigation, then we need to do a | 2560 // If this is a failed back/forward/reload navigation, then we need to do a |
| 2561 // 'replace' load. This is necessary to avoid messing up session history. | 2561 // 'replace' load. This is necessary to avoid messing up session history. |
| 2562 // Otherwise, we do a normal load, which simulates a 'go' navigation as far | 2562 // Otherwise, we do a normal load, which simulates a 'go' navigation as far |
| 2563 // as session history is concerned. | 2563 // as session history is concerned. |
| 2564 // | 2564 bool replace = commit_type != blink::WebStandardCommit; |
| 2565 // AUTO_SUBFRAME loads should always be treated as loads that do not advance | |
| 2566 // the page id. | |
| 2567 // | |
| 2568 // TODO(davidben): This should also take the failed navigation's replacement | |
| 2569 // state into account, if a location.replace() failed. | |
| 2570 bool replace = | |
| 2571 navigation_state->request_params().page_id != -1 || | |
| 2572 ui::PageTransitionCoreTypeIs(navigation_state->GetTransitionType(), | |
| 2573 ui::PAGE_TRANSITION_AUTO_SUBFRAME); | |
| 2574 | 2565 |
| 2575 // If we failed on a browser initiated request, then make sure that our error | 2566 // If we failed on a browser initiated request, then make sure that our error |
| 2576 // page load is regarded as the same browser initiated request. | 2567 // page load is regarded as the same browser initiated request. |
| 2577 if (!navigation_state->IsContentInitiated()) { | 2568 if (!navigation_state->IsContentInitiated()) { |
| 2578 pending_navigation_params_.reset(new NavigationParams( | 2569 pending_navigation_params_.reset(new NavigationParams( |
| 2579 navigation_state->common_params(), navigation_state->start_params(), | 2570 navigation_state->common_params(), navigation_state->start_params(), |
| 2580 navigation_state->request_params())); | 2571 navigation_state->request_params())); |
| 2581 pending_navigation_params_->request_params.request_time = | 2572 pending_navigation_params_->request_params.request_time = |
| 2582 document_state->request_time(); | 2573 document_state->request_time(); |
| 2583 } | 2574 } |
| (...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4705 #elif defined(ENABLE_BROWSER_CDMS) | 4696 #elif defined(ENABLE_BROWSER_CDMS) |
| 4706 cdm_manager_, | 4697 cdm_manager_, |
| 4707 #endif | 4698 #endif |
| 4708 this); | 4699 this); |
| 4709 } | 4700 } |
| 4710 | 4701 |
| 4711 return cdm_factory_; | 4702 return cdm_factory_; |
| 4712 } | 4703 } |
| 4713 | 4704 |
| 4714 } // namespace content | 4705 } // namespace content |
| OLD | NEW |