| 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 2533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 2555 navigation_state->start_params().should_replace_current_entry; |
| 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 | 2556 |
| 2565 // If we failed on a browser initiated request, then make sure that our error | 2557 // 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. | 2558 // page load is regarded as the same browser initiated request. |
| 2567 if (!navigation_state->IsContentInitiated()) { | 2559 if (!navigation_state->IsContentInitiated()) { |
| 2568 pending_navigation_params_.reset(new NavigationParams( | 2560 pending_navigation_params_.reset(new NavigationParams( |
| 2569 navigation_state->common_params(), navigation_state->start_params(), | 2561 navigation_state->common_params(), navigation_state->start_params(), |
| 2570 navigation_state->request_params())); | 2562 navigation_state->request_params())); |
| 2571 pending_navigation_params_->request_params.request_time = | 2563 pending_navigation_params_->request_params.request_time = |
| 2572 document_state->request_time(); | 2564 document_state->request_time(); |
| 2573 } | 2565 } |
| (...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4691 | 4683 |
| 4692 #if defined(ENABLE_BROWSER_CDMS) | 4684 #if defined(ENABLE_BROWSER_CDMS) |
| 4693 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4685 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
| 4694 if (!cdm_manager_) | 4686 if (!cdm_manager_) |
| 4695 cdm_manager_ = new RendererCdmManager(this); | 4687 cdm_manager_ = new RendererCdmManager(this); |
| 4696 return cdm_manager_; | 4688 return cdm_manager_; |
| 4697 } | 4689 } |
| 4698 #endif // defined(ENABLE_BROWSER_CDMS) | 4690 #endif // defined(ENABLE_BROWSER_CDMS) |
| 4699 | 4691 |
| 4700 } // namespace content | 4692 } // namespace content |
| OLD | NEW |