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

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

Issue 311783005: Fix crash in NavigationControllerImpl::RendererDidNavigateToNewPage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl_unittest.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 #include "content/browser/frame_host/navigation_controller_impl.h" 5 #include "content/browser/frame_host/navigation_controller_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 new_entry->set_site_instance( 1053 new_entry->set_site_instance(
1054 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance())); 1054 static_cast<SiteInstanceImpl*>(rfh->GetSiteInstance()));
1055 new_entry->SetHasPostData(params.is_post); 1055 new_entry->SetHasPostData(params.is_post);
1056 new_entry->SetPostID(params.post_id); 1056 new_entry->SetPostID(params.post_id);
1057 new_entry->SetOriginalRequestURL(params.original_request_url); 1057 new_entry->SetOriginalRequestURL(params.original_request_url);
1058 new_entry->SetIsOverridingUserAgent(params.is_overriding_user_agent); 1058 new_entry->SetIsOverridingUserAgent(params.is_overriding_user_agent);
1059 1059
1060 // history.pushState() is classified as a navigation to a new page, but 1060 // history.pushState() is classified as a navigation to a new page, but
1061 // sets was_within_same_page to true. In this case, we already have the 1061 // sets was_within_same_page to true. In this case, we already have the
1062 // title available, so set it immediately. 1062 // title available, so set it immediately.
1063 if (params.was_within_same_page) 1063 if (params.was_within_same_page && GetLastCommittedEntry())
1064 new_entry->SetTitle(GetLastCommittedEntry()->GetTitle()); 1064 new_entry->SetTitle(GetLastCommittedEntry()->GetTitle());
1065 1065
1066 DCHECK(!params.history_list_was_cleared || !replace_entry); 1066 DCHECK(!params.history_list_was_cleared || !replace_entry);
1067 // The browser requested to clear the session history when it initiated the 1067 // The browser requested to clear the session history when it initiated the
1068 // navigation. Now we know that the renderer has updated its state accordingly 1068 // navigation. Now we know that the renderer has updated its state accordingly
1069 // and it is safe to also clear the browser side history. 1069 // and it is safe to also clear the browser side history.
1070 if (params.history_list_was_cleared) { 1070 if (params.history_list_was_cleared) {
1071 DiscardNonCommittedEntriesInternal(); 1071 DiscardNonCommittedEntriesInternal();
1072 entries_.clear(); 1072 entries_.clear();
1073 last_committed_entry_index_ = -1; 1073 last_committed_entry_index_ = -1;
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1770 } 1770 }
1771 } 1771 }
1772 } 1772 }
1773 1773
1774 void NavigationControllerImpl::SetGetTimestampCallbackForTest( 1774 void NavigationControllerImpl::SetGetTimestampCallbackForTest(
1775 const base::Callback<base::Time()>& get_timestamp_callback) { 1775 const base::Callback<base::Time()>& get_timestamp_callback) {
1776 get_timestamp_callback_ = get_timestamp_callback; 1776 get_timestamp_callback_ = get_timestamp_callback;
1777 } 1777 }
1778 1778
1779 } // namespace content 1779 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698