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

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

Issue 2321083002: [NoStatePrefetch] Add performance histograms. (Closed)
Patch Set: rename url_ to start_url_ 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // about: URL to the history db and keep the data: URL hidden. This is what 98 // about: URL to the history db and keep the data: URL hidden. This is what
99 // the WebContents' URL getter does. 99 // the WebContents' URL getter does.
100 NavigationEntry* last_committed = 100 NavigationEntry* last_committed =
101 web_contents()->GetController().GetLastCommittedEntry(); 101 web_contents()->GetController().GetLastCommittedEntry();
102 const history::HistoryAddPageArgs& add_page_args = 102 const history::HistoryAddPageArgs& add_page_args =
103 CreateHistoryAddPageArgs( 103 CreateHistoryAddPageArgs(
104 web_contents()->GetURL(), details.entry->GetTimestamp(), 104 web_contents()->GetURL(), details.entry->GetTimestamp(),
105 details.did_replace_entry, last_committed->GetUniqueID(), params); 105 details.did_replace_entry, last_committed->GetUniqueID(), params);
106 106
107 prerender::PrerenderManager* prerender_manager = 107 prerender::PrerenderManager* prerender_manager =
108 prerender::PrerenderManagerFactory::GetForProfile( 108 prerender::PrerenderManagerFactory::GetForBrowserContext(
109 Profile::FromBrowserContext(web_contents()->GetBrowserContext())); 109 web_contents()->GetBrowserContext());
110 if (prerender_manager) { 110 if (prerender_manager) {
111 prerender::PrerenderContents* prerender_contents = 111 prerender::PrerenderContents* prerender_contents =
112 prerender_manager->GetPrerenderContents(web_contents()); 112 prerender_manager->GetPrerenderContents(web_contents());
113 if (prerender_contents) { 113 if (prerender_contents) {
114 prerender_contents->DidNavigate(add_page_args); 114 prerender_contents->DidNavigate(add_page_args);
115 return; 115 return;
116 } 116 }
117 } 117 }
118 118
119 #if !defined(OS_ANDROID) 119 #if !defined(OS_ANDROID)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 if (hs) { 158 if (hs) {
159 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry(); 159 NavigationEntry* entry = tab->GetController().GetLastCommittedEntry();
160 history::ContextID context_id = history::ContextIDForWebContents(tab); 160 history::ContextID context_id = history::ContextIDForWebContents(tab);
161 if (entry) { 161 if (entry) {
162 hs->UpdateWithPageEndTime(context_id, entry->GetUniqueID(), tab->GetURL(), 162 hs->UpdateWithPageEndTime(context_id, entry->GetUniqueID(), tab->GetURL(),
163 base::Time::Now()); 163 base::Time::Now());
164 } 164 }
165 hs->ClearCachedDataForContextID(context_id); 165 hs->ClearCachedDataForContextID(context_id);
166 } 166 }
167 } 167 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698