| 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 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1879 // sequence number in the same SiteInstance. Newly restored items may not have | 1879 // sequence number in the same SiteInstance. Newly restored items may not have |
| 1880 // a SiteInstance yet, in which case it will be assigned on first commit. | 1880 // a SiteInstance yet, in which case it will be assigned on first commit. |
| 1881 if (!old_item || | 1881 if (!old_item || |
| 1882 new_item->item_sequence_number() != old_item->item_sequence_number() || | 1882 new_item->item_sequence_number() != old_item->item_sequence_number() || |
| 1883 (new_item->site_instance() != nullptr && | 1883 (new_item->site_instance() != nullptr && |
| 1884 new_item->site_instance() != old_item->site_instance())) { | 1884 new_item->site_instance() != old_item->site_instance())) { |
| 1885 if (old_item && | 1885 if (old_item && |
| 1886 new_item->document_sequence_number() == | 1886 new_item->document_sequence_number() == |
| 1887 old_item->document_sequence_number()) { | 1887 old_item->document_sequence_number()) { |
| 1888 same_document_loads->push_back(std::make_pair(frame, new_item)); | 1888 same_document_loads->push_back(std::make_pair(frame, new_item)); |
| 1889 |
| 1890 // TODO(avi, creis): This is a bug; we should not return here. Rather, we |
| 1891 // should continue on and navigate all child frames which have also |
| 1892 // changed. This bug is the cause of <https://crbug.com/542299>, which is |
| 1893 // a NC_IN_PAGE_NAVIGATION renderer kill. |
| 1894 // |
| 1895 // However, this bug is a bandaid over a deeper and worse problem. Doing a |
| 1896 // pushState immediately after loading a subframe is a race, one that no |
| 1897 // web page author expects. If we fix this bug, many large websites break. |
| 1898 // For example, see <https://crbug.com/598043> and the spec discussion at |
| 1899 // <https://github.com/whatwg/html/issues/1191>. |
| 1900 // |
| 1901 // For now, we accept this bug, and hope to resolve the race in a |
| 1902 // different way that will one day allow us to fix this. |
| 1903 return; |
| 1889 } else { | 1904 } else { |
| 1890 different_document_loads->push_back(std::make_pair(frame, new_item)); | 1905 different_document_loads->push_back(std::make_pair(frame, new_item)); |
| 1891 // For a different document, the subframes will be destroyed, so there's | 1906 // For a different document, the subframes will be destroyed, so there's |
| 1892 // no need to consider them. | 1907 // no need to consider them. |
| 1893 return; | 1908 return; |
| 1894 } | 1909 } |
| 1895 } | 1910 } |
| 1896 | 1911 |
| 1897 for (size_t i = 0; i < frame->child_count(); i++) { | 1912 for (size_t i = 0; i < frame->child_count(); i++) { |
| 1898 FindFramesToNavigate(frame->child_at(i), same_document_loads, | 1913 FindFramesToNavigate(frame->child_at(i), same_document_loads, |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2063 } | 2078 } |
| 2064 } | 2079 } |
| 2065 } | 2080 } |
| 2066 | 2081 |
| 2067 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2082 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 2068 const base::Callback<base::Time()>& get_timestamp_callback) { | 2083 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 2069 get_timestamp_callback_ = get_timestamp_callback; | 2084 get_timestamp_callback_ = get_timestamp_callback; |
| 2070 } | 2085 } |
| 2071 | 2086 |
| 2072 } // namespace content | 2087 } // namespace content |
| OLD | NEW |