OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_PLT_RECORDER_H_ |
| 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_PLT_RECORDER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <list> |
| 10 #include <vector> |
| 11 |
| 12 #include "base/scoped_ptr.h" |
| 13 #include "base/time.h" |
| 14 #include "chrome/browser/tab_contents/web_navigation_observer.h" |
| 15 #include "googleurl/src/gurl.h" |
| 16 |
| 17 class PrerenderContents; |
| 18 class Profile; |
| 19 class TabContents; |
| 20 |
| 21 // PrerenderPLTRecorder is responsible for recording perceived pageload times |
| 22 // to compare PLT's with prerendering enabled and disabled. |
| 23 class PrerenderPLTRecorder : public WebNavigationObserver { |
| 24 public: |
| 25 explicit PrerenderPLTRecorder(TabContents* tab_contents); |
| 26 virtual ~PrerenderPLTRecorder(); |
| 27 |
| 28 // WebNavigationObserver implementation. |
| 29 virtual bool OnMessageReceived(const IPC::Message& message); |
| 30 |
| 31 // Message handler. |
| 32 void OnDidStartProvisionalLoadForFrame(int64 frame_id, |
| 33 bool main_frame, |
| 34 const GURL& url); |
| 35 |
| 36 virtual void DidStopLoading(); |
| 37 |
| 38 private: |
| 39 TabContents* tab_contents_; |
| 40 |
| 41 // System time at which the current load was started for the purpose of |
| 42 // the perceived page load time (PPLT). |
| 43 base::TimeTicks pplt_load_start_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(PrerenderPLTRecorder); |
| 46 }; |
| 47 |
| 48 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_PLT_RECORDER_H_ |
OLD | NEW |