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

Side by Side Diff: chrome/browser/history/history_tab_helper.cc

Issue 2321083002: [NoStatePrefetch] Add performance histograms. (Closed)
Patch Set: Review comments 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/history/history_tab_helper.h" 5 #include "chrome/browser/history/history_tab_helper.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/history/history_service_factory.h" 10 #include "chrome/browser/history/history_service_factory.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // about: URL to the history db and keep the data: URL hidden. This is what 112 // about: URL to the history db and keep the data: URL hidden. This is what
113 // the WebContents' URL getter does. 113 // the WebContents' URL getter does.
114 NavigationEntry* last_committed = 114 NavigationEntry* last_committed =
115 web_contents()->GetController().GetLastCommittedEntry(); 115 web_contents()->GetController().GetLastCommittedEntry();
116 const history::HistoryAddPageArgs& add_page_args = 116 const history::HistoryAddPageArgs& add_page_args =
117 CreateHistoryAddPageArgs( 117 CreateHistoryAddPageArgs(
118 web_contents()->GetURL(), details.entry->GetTimestamp(), 118 web_contents()->GetURL(), details.entry->GetTimestamp(),
119 details.did_replace_entry, last_committed->GetUniqueID(), params); 119 details.did_replace_entry, last_committed->GetUniqueID(), params);
120 120
121 prerender::PrerenderManager* prerender_manager = 121 prerender::PrerenderManager* prerender_manager =
122 prerender::PrerenderManagerFactory::GetForProfile( 122 prerender::PrerenderManagerFactory::GetForBrowserContext(
123 Profile::FromBrowserContext(web_contents()->GetBrowserContext())); 123 web_contents()->GetBrowserContext());
124 if (prerender_manager) { 124 if (prerender_manager) {
125 prerender::PrerenderContents* prerender_contents = 125 prerender::PrerenderContents* prerender_contents =
126 prerender_manager->GetPrerenderContents(web_contents()); 126 prerender_manager->GetPrerenderContents(web_contents());
127 if (prerender_contents) { 127 if (prerender_contents) {
128 prerender_contents->DidNavigate(add_page_args); 128 prerender_contents->DidNavigate(add_page_args);
129 return; 129 return;
130 } 130 }
131 } 131 }
132 132
133 #if !defined(OS_ANDROID) 133 #if !defined(OS_ANDROID)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 if (hs) { 172 if (hs) {
173 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); 173 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry();
174 history::ContextID context_id = history::ContextIDForWebContents(tab); 174 history::ContextID context_id = history::ContextIDForWebContents(tab);
175 if (entry) { 175 if (entry) {
176 hs->UpdateWithPageEndTime(context_id, entry->GetUniqueID(), tab->GetURL(), 176 hs->UpdateWithPageEndTime(context_id, entry->GetUniqueID(), tab->GetURL(),
177 base::Time::Now()); 177 base::Time::Now());
178 } 178 }
179 hs->ClearCachedDataForContextID(context_id); 179 hs->ClearCachedDataForContextID(context_id);
180 } 180 }
181 } 181 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698