| 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 /* | 5 /* |
| 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * | 10 * |
| (...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1903 if (!new_item) | 1903 if (!new_item) |
| 1904 return; | 1904 return; |
| 1905 | 1905 |
| 1906 // Schedule a load in this frame if the new item isn't for the same item | 1906 // Schedule a load in this frame if the new item isn't for the same item |
| 1907 // sequence number in the same SiteInstance. Newly restored items may not have | 1907 // sequence number in the same SiteInstance. Newly restored items may not have |
| 1908 // a SiteInstance yet, in which case it will be assigned on first commit. | 1908 // a SiteInstance yet, in which case it will be assigned on first commit. |
| 1909 if (!old_item || | 1909 if (!old_item || |
| 1910 new_item->item_sequence_number() != old_item->item_sequence_number() || | 1910 new_item->item_sequence_number() != old_item->item_sequence_number() || |
| 1911 (new_item->site_instance() != nullptr && | 1911 (new_item->site_instance() != nullptr && |
| 1912 new_item->site_instance() != old_item->site_instance())) { | 1912 new_item->site_instance() != old_item->site_instance())) { |
| 1913 // Same document loads happen if the previous item has the same document |
| 1914 // sequence number. Note that we should treat them as different document if |
| 1915 // the destination RenderFrameHost (which is necessarily the current |
| 1916 // RenderFrameHost for same document navigations) doesn't have a last |
| 1917 // committed page. This case can happen for Ctrl+Back or after a renderer |
| 1918 // crash. |
| 1913 if (old_item && | 1919 if (old_item && |
| 1914 new_item->document_sequence_number() == | 1920 new_item->document_sequence_number() == |
| 1915 old_item->document_sequence_number()) { | 1921 old_item->document_sequence_number() && |
| 1922 !frame->current_frame_host()->last_committed_url().is_empty()) { |
| 1916 same_document_loads->push_back(std::make_pair(frame, new_item)); | 1923 same_document_loads->push_back(std::make_pair(frame, new_item)); |
| 1917 | 1924 |
| 1918 // TODO(avi, creis): This is a bug; we should not return here. Rather, we | 1925 // TODO(avi, creis): This is a bug; we should not return here. Rather, we |
| 1919 // should continue on and navigate all child frames which have also | 1926 // should continue on and navigate all child frames which have also |
| 1920 // changed. This bug is the cause of <https://crbug.com/542299>, which is | 1927 // changed. This bug is the cause of <https://crbug.com/542299>, which is |
| 1921 // a NC_IN_PAGE_NAVIGATION renderer kill. | 1928 // a NC_IN_PAGE_NAVIGATION renderer kill. |
| 1922 // | 1929 // |
| 1923 // However, this bug is a bandaid over a deeper and worse problem. Doing a | 1930 // However, this bug is a bandaid over a deeper and worse problem. Doing a |
| 1924 // pushState immediately after loading a subframe is a race, one that no | 1931 // pushState immediately after loading a subframe is a race, one that no |
| 1925 // web page author expects. If we fix this bug, many large websites break. | 1932 // web page author expects. If we fix this bug, many large websites break. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2104 } | 2111 } |
| 2105 } | 2112 } |
| 2106 } | 2113 } |
| 2107 | 2114 |
| 2108 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2115 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 2109 const base::Callback<base::Time()>& get_timestamp_callback) { | 2116 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 2110 get_timestamp_callback_ = get_timestamp_callback; | 2117 get_timestamp_callback_ = get_timestamp_callback; |
| 2111 } | 2118 } |
| 2112 | 2119 |
| 2113 } // namespace content | 2120 } // namespace content |
| OLD | NEW |