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

Side by Side Diff: chrome/browser/prerender/prerender_tab_helper.h

Issue 10392072: Pass the render view host with all provisional load related callbacks on the web contents observer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 unified diff | Download patch | Annotate | Revision Log
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 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_
7 7
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "content/public/browser/web_contents_observer.h" 10 #include "content/public/browser/web_contents_observer.h"
11 #include "googleurl/src/gurl.h" 11 #include "googleurl/src/gurl.h"
12 12
13 class TabContentsWrapper; 13 class TabContentsWrapper;
14 14
15 namespace prerender { 15 namespace prerender {
16 16
17 class PrerenderManager; 17 class PrerenderManager;
18 18
19 // PrerenderTabHelper is responsible for recording perceived pageload times 19 // PrerenderTabHelper is responsible for recording perceived pageload times
20 // to compare PLT's with prerendering enabled and disabled. 20 // to compare PLT's with prerendering enabled and disabled.
21 class PrerenderTabHelper : public content::WebContentsObserver { 21 class PrerenderTabHelper : public content::WebContentsObserver {
22 public: 22 public:
23 explicit PrerenderTabHelper(TabContentsWrapper* tab); 23 explicit PrerenderTabHelper(TabContentsWrapper* tab);
24 virtual ~PrerenderTabHelper(); 24 virtual ~PrerenderTabHelper();
25 25
26 // content::WebContentsObserver implementation. 26 // content::WebContentsObserver implementation.
27 virtual void ProvisionalChangeToMainFrameUrl( 27 virtual void ProvisionalChangeToMainFrameUrl(
28 const GURL& url, 28 const GURL& url,
29 const GURL& opener_url) OVERRIDE; 29 const GURL& opener_url,
30 content::RenderViewHost* render_view_host) OVERRIDE;
30 virtual void DidStopLoading() OVERRIDE; 31 virtual void DidStopLoading() OVERRIDE;
31 virtual void DidStartProvisionalLoadForFrame( 32 virtual void DidStartProvisionalLoadForFrame(
32 int64 frame_id, 33 int64 frame_id,
33 bool is_main_frame, 34 bool is_main_frame,
34 const GURL& validated_url, 35 const GURL& validated_url,
35 bool is_error_page, 36 bool is_error_page,
36 content::RenderViewHost* render_view_host) OVERRIDE; 37 content::RenderViewHost* render_view_host) OVERRIDE;
37 virtual void DidCommitProvisionalLoadForFrame( 38 virtual void DidCommitProvisionalLoadForFrame(
38 int64 frame_id, 39 int64 frame_id,
39 bool is_main_frame, 40 bool is_main_frame,
40 const GURL& validated_url, 41 const GURL& validated_url,
41 content::PageTransition transition_type) OVERRIDE; 42 content::PageTransition transition_type,
43 content::RenderViewHost* render_view_host) OVERRIDE;
42 // Called when this prerendered TabContents has just been swapped in. 44 // Called when this prerendered TabContents has just been swapped in.
43 void PrerenderSwappedIn(); 45 void PrerenderSwappedIn();
44 46
45 private: 47 private:
46 // Helper class to compute pixel-based stats on the paint progress 48 // Helper class to compute pixel-based stats on the paint progress
47 // between when a prerendered page is swapped in and when the onload event 49 // between when a prerendered page is swapped in and when the onload event
48 // fires. 50 // fires.
49 class PixelStats; 51 class PixelStats;
50 scoped_ptr<PixelStats> pixel_stats_; 52 scoped_ptr<PixelStats> pixel_stats_;
51 53
(...skipping 22 matching lines...) Expand all
74 76
75 // Current URL being loaded. 77 // Current URL being loaded.
76 GURL url_; 78 GURL url_;
77 79
78 DISALLOW_COPY_AND_ASSIGN(PrerenderTabHelper); 80 DISALLOW_COPY_AND_ASSIGN(PrerenderTabHelper);
79 }; 81 };
80 82
81 } // namespace prerender 83 } // namespace prerender
82 84
83 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_ 85 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_TAB_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | chrome/browser/prerender/prerender_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698