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/browser/frame_host/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 details->http_status_code = params.http_status_code; | 876 details->http_status_code = params.http_status_code; |
877 NotifyNavigationEntryCommitted(details); | 877 NotifyNavigationEntryCommitted(details); |
878 | 878 |
879 return true; | 879 return true; |
880 } | 880 } |
881 | 881 |
882 NavigationType NavigationControllerImpl::ClassifyNavigation( | 882 NavigationType NavigationControllerImpl::ClassifyNavigation( |
883 RenderFrameHost* rfh, | 883 RenderFrameHost* rfh, |
884 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) const { | 884 const FrameHostMsg_DidCommitProvisionalLoad_Params& params) const { |
885 if (params.page_id == -1) { | 885 if (params.page_id == -1) { |
886 // TODO(nasko, creis): An out-of-process child frame has no way of | |
887 // knowing the page_id of its parent, so it is passing back -1. The | |
888 // semantics here should be re-evaluated during session history refactor | |
889 // (see http://crbug.com/236848). For now, we assume this means the | |
890 // child frame loaded and proceed. Note that this may do the wrong thing | |
891 // for cross-process AUTO_SUBFRAME navigations. | |
892 if (rfh->IsCrossProcessSubframe()) | |
893 return NAVIGATION_TYPE_NEW_SUBFRAME; | |
894 | |
895 // The renderer generates the page IDs, and so if it gives us the invalid | 886 // The renderer generates the page IDs, and so if it gives us the invalid |
896 // page ID (-1) we know it didn't actually navigate. This happens in a few | 887 // page ID (-1) we know it didn't actually navigate. This happens in a few |
897 // cases: | 888 // cases: |
898 // | 889 // |
899 // - If a page makes a popup navigated to about blank, and then writes | 890 // - If a page makes a popup navigated to about blank, and then writes |
900 // stuff like a subframe navigated to a real page. We'll get the commit | 891 // stuff like a subframe navigated to a real page. We'll get the commit |
901 // for the subframe, but there won't be any commit for the outer page. | 892 // for the subframe, but there won't be any commit for the outer page. |
902 // | 893 // |
903 // - We were also getting these for failed loads (for example, bug 21849). | 894 // - We were also getting these for failed loads (for example, bug 21849). |
904 // The guess is that we get a "load commit" for the alternate error page, | 895 // The guess is that we get a "load commit" for the alternate error page, |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1786 } | 1777 } |
1787 } | 1778 } |
1788 } | 1779 } |
1789 | 1780 |
1790 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1781 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
1791 const base::Callback<base::Time()>& get_timestamp_callback) { | 1782 const base::Callback<base::Time()>& get_timestamp_callback) { |
1792 get_timestamp_callback_ = get_timestamp_callback; | 1783 get_timestamp_callback_ = get_timestamp_callback; |
1793 } | 1784 } |
1794 | 1785 |
1795 } // namespace content | 1786 } // namespace content |
OLD | NEW |