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 |
886 // The renderer generates the page IDs, and so if it gives us the invalid | 895 // The renderer generates the page IDs, and so if it gives us the invalid |
887 // page ID (-1) we know it didn't actually navigate. This happens in a few | 896 // page ID (-1) we know it didn't actually navigate. This happens in a few |
888 // cases: | 897 // cases: |
889 // | 898 // |
890 // - If a page makes a popup navigated to about blank, and then writes | 899 // - If a page makes a popup navigated to about blank, and then writes |
891 // stuff like a subframe navigated to a real page. We'll get the commit | 900 // stuff like a subframe navigated to a real page. We'll get the commit |
892 // for the subframe, but there won't be any commit for the outer page. | 901 // for the subframe, but there won't be any commit for the outer page. |
893 // | 902 // |
894 // - We were also getting these for failed loads (for example, bug 21849). | 903 // - We were also getting these for failed loads (for example, bug 21849). |
895 // The guess is that we get a "load commit" for the alternate error page, | 904 // 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... |
1777 } | 1786 } |
1778 } | 1787 } |
1779 } | 1788 } |
1780 | 1789 |
1781 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1790 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
1782 const base::Callback<base::Time()>& get_timestamp_callback) { | 1791 const base::Callback<base::Time()>& get_timestamp_callback) { |
1783 get_timestamp_callback_ = get_timestamp_callback; | 1792 get_timestamp_callback_ = get_timestamp_callback; |
1784 } | 1793 } |
1785 | 1794 |
1786 } // namespace content | 1795 } // namespace content |
OLD | NEW |