Chromium Code Reviews| 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 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1871 // sequence number in the same SiteInstance. Newly restored items may not have | 1871 // sequence number in the same SiteInstance. Newly restored items may not have |
| 1872 // a SiteInstance yet, in which case it will be assigned on first commit. | 1872 // a SiteInstance yet, in which case it will be assigned on first commit. |
| 1873 if (!old_item || | 1873 if (!old_item || |
| 1874 new_item->item_sequence_number() != old_item->item_sequence_number() || | 1874 new_item->item_sequence_number() != old_item->item_sequence_number() || |
| 1875 (new_item->site_instance() != nullptr && | 1875 (new_item->site_instance() != nullptr && |
| 1876 new_item->site_instance() != old_item->site_instance())) { | 1876 new_item->site_instance() != old_item->site_instance())) { |
| 1877 if (old_item && | 1877 if (old_item && |
| 1878 new_item->document_sequence_number() == | 1878 new_item->document_sequence_number() == |
| 1879 old_item->document_sequence_number()) { | 1879 old_item->document_sequence_number()) { |
| 1880 same_document_loads->push_back(std::make_pair(frame, new_item)); | 1880 same_document_loads->push_back(std::make_pair(frame, new_item)); |
| 1881 // This is a bug; we should not return here. Rather, we should continue on | |
|
Charlie Reis
2016/05/05 17:45:42
nit: Blank line before, and start with TODO(avi, c
Avi (use Gerrit)
2016/05/05 19:06:21
Done.
| |
| 1882 // and navigate all child frames which have also changed. This bug is the | |
| 1883 // cause of <https://crbug.com/542299>. | |
| 1884 // | |
| 1885 // However, this bug masks a deeper and worse problem. Doing a pushState | |
| 1886 // immediately after loading a subframe is a race, one that no web page | |
| 1887 // author expects. If we fix this bug, many large websites break. For | |
| 1888 // example, see <https://crbug.com/598043> and the spec discussion at | |
|
Charlie Reis
2016/05/05 17:45:42
Let's also mention 600534.
Avi (use Gerrit)
2016/05/05 19:06:21
That's a Google-only bug; do we want to mention it
Charlie Reis
2016/05/05 19:34:22
Ah. No, just listing it in the CL description sho
| |
| 1889 // <https://github.com/whatwg/html/issues/1191>. | |
| 1890 // | |
| 1891 // For now, we accept this bug, and hope to resolve the race in a | |
| 1892 // different way that will one day allow us to fix this. | |
| 1893 return; | |
| 1881 } else { | 1894 } else { |
| 1882 different_document_loads->push_back(std::make_pair(frame, new_item)); | 1895 different_document_loads->push_back(std::make_pair(frame, new_item)); |
| 1883 // For a different document, the subframes will be destroyed, so there's | 1896 // For a different document, the subframes will be destroyed, so there's |
| 1884 // no need to consider them. | 1897 // no need to consider them. |
| 1885 return; | 1898 return; |
| 1886 } | 1899 } |
| 1887 } | 1900 } |
| 1888 | 1901 |
| 1889 for (size_t i = 0; i < frame->child_count(); i++) { | 1902 for (size_t i = 0; i < frame->child_count(); i++) { |
| 1890 FindFramesToNavigate(frame->child_at(i), same_document_loads, | 1903 FindFramesToNavigate(frame->child_at(i), same_document_loads, |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2053 } | 2066 } |
| 2054 } | 2067 } |
| 2055 } | 2068 } |
| 2056 | 2069 |
| 2057 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 2070 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
| 2058 const base::Callback<base::Time()>& get_timestamp_callback) { | 2071 const base::Callback<base::Time()>& get_timestamp_callback) { |
| 2059 get_timestamp_callback_ = get_timestamp_callback; | 2072 get_timestamp_callback_ = get_timestamp_callback; |
| 2060 } | 2073 } |
| 2061 | 2074 |
| 2062 } // namespace content | 2075 } // namespace content |
| OLD | NEW |