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

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

Issue 2273613003: Add a null check for last committed entry in ClassifyNavigation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 | no next file » | 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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 return NAVIGATION_TYPE_EXISTING_PAGE; 1004 return NAVIGATION_TYPE_EXISTING_PAGE;
1005 } 1005 }
1006 1006
1007 if (pending_entry_ && pending_entry_index_ == -1 && 1007 if (pending_entry_ && pending_entry_index_ == -1 &&
1008 pending_entry_->GetUniqueID() == params.nav_entry_id) { 1008 pending_entry_->GetUniqueID() == params.nav_entry_id) {
1009 // In this case, we have a pending entry for a load of a new URL but Blink 1009 // In this case, we have a pending entry for a load of a new URL but Blink
1010 // didn't do a new navigation (params.did_create_new_entry). First check to 1010 // didn't do a new navigation (params.did_create_new_entry). First check to
1011 // make sure Blink didn't treat a new cross-process navigation as inert, and 1011 // make sure Blink didn't treat a new cross-process navigation as inert, and
1012 // thus set params.did_create_new_entry to false. In that case, we must 1012 // thus set params.did_create_new_entry to false. In that case, we must
1013 // treat it as NEW since the SiteInstance doesn't match the entry. 1013 // treat it as NEW since the SiteInstance doesn't match the entry.
1014 if (GetLastCommittedEntry()->site_instance() != rfh->GetSiteInstance()) 1014 if (GetLastCommittedEntry() &&
1015 GetLastCommittedEntry()->site_instance() != rfh->GetSiteInstance())
1015 return NAVIGATION_TYPE_NEW_PAGE; 1016 return NAVIGATION_TYPE_NEW_PAGE;
1016 1017
1017 // Otherwise, this happens when you press enter in the URL bar to reload. We 1018 // Otherwise, this happens when you press enter in the URL bar to reload. We
1018 // will create a pending entry, but Blink will convert it to a reload since 1019 // will create a pending entry, but Blink will convert it to a reload since
1019 // it's the same page and not create a new entry for it (the user doesn't 1020 // it's the same page and not create a new entry for it (the user doesn't
1020 // want to have a new back/forward entry when they do this). Therefore we 1021 // want to have a new back/forward entry when they do this). Therefore we
1021 // want to just ignore the pending entry and go back to where we were (the 1022 // want to just ignore the pending entry and go back to where we were (the
1022 // "existing entry"). 1023 // "existing entry").
1023 // TODO(creis,avi): Eliminate SAME_PAGE in https://crbug.com/536102. 1024 // TODO(creis,avi): Eliminate SAME_PAGE in https://crbug.com/536102.
1024 return NAVIGATION_TYPE_SAME_PAGE; 1025 return NAVIGATION_TYPE_SAME_PAGE;
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 } 2102 }
2102 } 2103 }
2103 } 2104 }
2104 2105
2105 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 2106 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
2106 const base::Callback<base::Time()>& get_timestamp_callback) { 2107 const base::Callback<base::Time()>& get_timestamp_callback) {
2107 get_timestamp_callback_ = get_timestamp_callback; 2108 get_timestamp_callback_ = get_timestamp_callback;
2108 } 2109 }
2109 2110
2110 } // namespace content 2111 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698