Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Side by Side Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 1949213002: Don't update subframes on parent frame commits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
1882 // TODO(avi, creis): This is a bug; we should not return here. Rather, we
1883 // should continue on and navigate all child frames which have also
1884 // changed. This bug is the cause of <https://crbug.com/542299>, which is
1885 // a NC_IN_PAGE_NAVIGATION renderer kill.
1886 //
1887 // However, this bug is a bandaid over a deeper and worse problem. Doing a
1888 // pushState immediately after loading a subframe is a race, one that no
1889 // web page author expects. If we fix this bug, many large websites break.
1890 // For example, see <https://crbug.com/598043> and the spec discussion at
1891 // <https://github.com/whatwg/html/issues/1191>.
1892 //
1893 // For now, we accept this bug, and hope to resolve the race in a
1894 // different way that will one day allow us to fix this.
1895 return;
1881 } else { 1896 } else {
1882 different_document_loads->push_back(std::make_pair(frame, new_item)); 1897 different_document_loads->push_back(std::make_pair(frame, new_item));
1883 // For a different document, the subframes will be destroyed, so there's 1898 // For a different document, the subframes will be destroyed, so there's
1884 // no need to consider them. 1899 // no need to consider them.
1885 return; 1900 return;
1886 } 1901 }
1887 } 1902 }
1888 1903
1889 for (size_t i = 0; i < frame->child_count(); i++) { 1904 for (size_t i = 0; i < frame->child_count(); i++) {
1890 FindFramesToNavigate(frame->child_at(i), same_document_loads, 1905 FindFramesToNavigate(frame->child_at(i), same_document_loads,
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 } 2068 }
2054 } 2069 }
2055 } 2070 }
2056 2071
2057 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2072 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2058 const base::Callback<base::Time()>& get_timestamp_callback) { 2073 const base::Callback<base::Time()>& get_timestamp_callback) {
2059 get_timestamp_callback_ = get_timestamp_callback; 2074 get_timestamp_callback_ = get_timestamp_callback;
2060 } 2075 }
2061 2076
2062 } // namespace content 2077 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698