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

Unified Diff: chrome/browser/prerender/prerender_manager.cc

Issue 7066011: Fix PPLT metric for the new TabContents based prerendering (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_manager.cc
===================================================================
--- chrome/browser/prerender/prerender_manager.cc (revision 86299)
+++ chrome/browser/prerender/prerender_manager.cc (working copy)
@@ -14,6 +14,7 @@
#include "chrome/browser/favicon/favicon_tab_helper.h"
#include "chrome/browser/prerender/prerender_contents.h"
#include "chrome/browser/prerender/prerender_final_status.h"
+#include "chrome/browser/prerender/prerender_observer.h"
#include "chrome/browser/prerender/prerender_tracker.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
@@ -608,6 +609,14 @@
urls);
}
+ // Update PPLT metrics:
+ // If the tab has finished loading, record a PPLT of 0.
+ // If the tab is still loading, reset its start time to the current time.
+ PrerenderObserver* prerender_observer =
+ new_tab_contents->prerender_observer();
+ DCHECK(prerender_observer != NULL);
+ prerender_observer->PrerenderSwappedIn();
+
// See if we have any pending prerender requests for this routing id and start
// the preload if we do.
std::pair<int, int> child_route_pair = std::make_pair(child_id, route_id);
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698