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 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2683 !navigation_state->start_params().should_replace_current_entry) { | 2683 !navigation_state->start_params().should_replace_current_entry) { |
2684 // Advance our offset in session history, applying the length limit. | 2684 // Advance our offset in session history, applying the length limit. |
2685 // There is now no forward history. | 2685 // There is now no forward history. |
2686 render_view_->history_list_offset_++; | 2686 render_view_->history_list_offset_++; |
2687 if (render_view_->history_list_offset_ >= kMaxSessionHistoryEntries) | 2687 if (render_view_->history_list_offset_ >= kMaxSessionHistoryEntries) |
2688 render_view_->history_list_offset_ = kMaxSessionHistoryEntries - 1; | 2688 render_view_->history_list_offset_ = kMaxSessionHistoryEntries - 1; |
2689 render_view_->history_list_length_ = | 2689 render_view_->history_list_length_ = |
2690 render_view_->history_list_offset_ + 1; | 2690 render_view_->history_list_offset_ + 1; |
2691 } | 2691 } |
2692 } else { | 2692 } else { |
2693 if (navigation_state->request_params().page_id != -1) { | 2693 const RequestNavigationParams& request_params = |
| 2694 navigation_state->request_params(); |
| 2695 if (request_params.page_id != -1) { |
2694 // This is a successful session history navigation! | 2696 // This is a successful session history navigation! |
2695 render_view_->page_id_ = navigation_state->request_params().page_id; | 2697 render_view_->page_id_ = request_params.page_id; |
2696 | 2698 |
2697 render_view_->history_list_offset_ = | 2699 render_view_->history_list_offset_ = |
2698 navigation_state->request_params().pending_history_list_offset; | 2700 request_params.pending_history_list_offset; |
2699 } | 2701 } |
| 2702 // Page id is going away (http://crbug.com/369661); ensure that a |
| 2703 // replacement that doesn't use page id is equivalent in all cases. |
| 2704 CHECK_EQ(request_params.page_id != -1, |
| 2705 request_params.nav_entry_id != 0 && |
| 2706 !request_params.intended_as_new_entry); |
2700 } | 2707 } |
2701 | 2708 |
2702 bool sent = Send( | 2709 bool sent = Send( |
2703 new FrameHostMsg_DidAssignPageId(routing_id_, render_view_->page_id_)); | 2710 new FrameHostMsg_DidAssignPageId(routing_id_, render_view_->page_id_)); |
2704 CHECK(sent); // http://crbug.com/407376 | 2711 CHECK(sent); // http://crbug.com/407376 |
2705 | 2712 |
2706 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers_, | 2713 FOR_EACH_OBSERVER(RenderViewObserver, render_view_->observers_, |
2707 DidCommitProvisionalLoad(frame, is_new_navigation)); | 2714 DidCommitProvisionalLoad(frame, is_new_navigation)); |
2708 FOR_EACH_OBSERVER( | 2715 FOR_EACH_OBSERVER( |
2709 RenderFrameObserver, observers_, | 2716 RenderFrameObserver, observers_, |
(...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4934 #elif defined(ENABLE_BROWSER_CDMS) | 4941 #elif defined(ENABLE_BROWSER_CDMS) |
4935 cdm_manager_, | 4942 cdm_manager_, |
4936 #endif | 4943 #endif |
4937 this); | 4944 this); |
4938 } | 4945 } |
4939 | 4946 |
4940 return cdm_factory_; | 4947 return cdm_factory_; |
4941 } | 4948 } |
4942 | 4949 |
4943 } // namespace content | 4950 } // namespace content |
OLD | NEW |