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

Unified Diff: chrome/browser/prerender/prerender_plt_recorder.h

Issue 6263014: Add Perceived PageLoad Time (PPLT) metrics for Prerender Experiments,... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « chrome/browser/prerender/prerender_manager.cc ('k') | chrome/browser/prerender/prerender_plt_recorder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_plt_recorder.h
===================================================================
--- chrome/browser/prerender/prerender_plt_recorder.h (revision 0)
+++ chrome/browser/prerender/prerender_plt_recorder.h (revision 0)
@@ -0,0 +1,48 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PRERENDER_PRERENDER_PLT_RECORDER_H_
+#define CHROME_BROWSER_PRERENDER_PRERENDER_PLT_RECORDER_H_
+#pragma once
+
+#include <list>
+#include <vector>
+
+#include "base/scoped_ptr.h"
+#include "base/time.h"
+#include "chrome/browser/tab_contents/web_navigation_observer.h"
+#include "googleurl/src/gurl.h"
+
+class PrerenderContents;
+class Profile;
+class TabContents;
+
+// PrerenderPLTRecorder is responsible for recording perceived pageload times
+// to compare PLT's with prerendering enabled and disabled.
+class PrerenderPLTRecorder : public WebNavigationObserver {
+ public:
+ explicit PrerenderPLTRecorder(TabContents* tab_contents);
+ virtual ~PrerenderPLTRecorder();
+
+ // WebNavigationObserver implementation.
+ virtual bool OnMessageReceived(const IPC::Message& message);
+
+ // Message handler.
+ void OnDidStartProvisionalLoadForFrame(int64 frame_id,
+ bool main_frame,
+ const GURL& url);
+
+ virtual void DidStopLoading();
+
+ private:
+ TabContents* tab_contents_;
+
+ // System time at which the current load was started for the purpose of
+ // the perceived page load time (PPLT).
+ base::TimeTicks pplt_load_start_;
+
+ DISALLOW_COPY_AND_ASSIGN(PrerenderPLTRecorder);
+};
+
+#endif // CHROME_BROWSER_PRERENDER_PRERENDER_PLT_RECORDER_H_
« no previous file with comments | « chrome/browser/prerender/prerender_manager.cc ('k') | chrome/browser/prerender/prerender_plt_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698