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

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

Issue 8540025: Prerendering: Add MatchComplete PPLT (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 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 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_MANAGER_H_ 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <list> 9 #include <list>
10 #include <string> 10 #include <string>
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // and substitutes the prerendered RVH into the TabContents. |opener_url| is 121 // and substitutes the prerendered RVH into the TabContents. |opener_url| is
122 // set to the window.opener url that the TabContents should have set and 122 // set to the window.opener url that the TabContents should have set and
123 // will be empty if there is no opener set. Returns whether or not a 123 // will be empty if there is no opener set. Returns whether or not a
124 // prerendered RVH could be used or not. 124 // prerendered RVH could be used or not.
125 bool MaybeUsePrerenderedPage(TabContents* tab_contents, 125 bool MaybeUsePrerenderedPage(TabContents* tab_contents,
126 const GURL& url, 126 const GURL& url,
127 const GURL& opener_url); 127 const GURL& opener_url);
128 128
129 // Moves a PrerenderContents to the pending delete list from the list of 129 // Moves a PrerenderContents to the pending delete list from the list of
130 // active prerenders when prerendering should be cancelled. 130 // active prerenders when prerendering should be cancelled.
131 void MoveEntryToPendingDelete(PrerenderContents* entry); 131 void MoveEntryToPendingDelete(PrerenderContents* entry,
132 FinalStatus final_status);
132 133
133 // Records the perceived page load time for a page - effectively the time from 134 // Records the perceived page load time for a page - effectively the time from
134 // when the user navigates to a page to when it finishes loading. The actual 135 // when the user navigates to a page to when it finishes loading. The actual
135 // load may have started prior to navigation due to prerender hints. 136 // load may have started prior to navigation due to prerender hints.
136 // This must be called on the UI thread. 137 // This must be called on the UI thread.
137 static void RecordPerceivedPageLoadTime( 138 static void RecordPerceivedPageLoadTime(
138 base::TimeDelta perceived_page_load_time, 139 base::TimeDelta perceived_page_load_time,
139 TabContents* tab_contents, 140 TabContents* tab_contents,
140 const GURL& url); 141 const GURL& url);
141 142
142 // Returns whether prerendering is currently enabled for this manager. 143 // Returns whether prerendering is currently enabled for this manager.
143 // Must be called on the UI thread. 144 // Must be called on the UI thread.
144 bool is_enabled() const; 145 bool is_enabled() const;
145 146
146 // Set whether prerendering is currently enabled for this manager. 147 // Set whether prerendering is currently enabled for this manager.
147 // Must be called on the UI thread. 148 // Must be called on the UI thread.
148 // If |enabled| is false, existing prerendered pages will still persist until 149 // If |enabled| is false, existing prerendered pages will still persist until
149 // they time out, but new ones will not be generated. 150 // they time out, but new ones will not be generated.
150 void set_enabled(bool enabled); 151 void set_enabled(bool enabled);
151 152
152 static PrerenderManagerMode GetMode(); 153 static PrerenderManagerMode GetMode();
153 static void SetMode(PrerenderManagerMode mode); 154 static void SetMode(PrerenderManagerMode mode);
154 static bool IsPrerenderingPossible(); 155 static bool IsPrerenderingPossible();
156 static bool ActuallyPrerendering();
155 static bool IsControlGroup(); 157 static bool IsControlGroup();
156 158
157 // Query the list of current prerender pages to see if the given tab contents 159 // Query the list of current prerender pages to see if the given tab contents
158 // is prerendering a page. 160 // is prerendering a page.
159 bool IsTabContentsPrerendering(TabContents* tab_contents) const; 161 bool IsTabContentsPrerendering(TabContents* tab_contents) const;
160 162
161 // Maintaining and querying the set of TabContents belonging to this 163 // Maintaining and querying the set of TabContents belonging to this
162 // PrerenderManager that are currently showing prerendered pages. 164 // PrerenderManager that are currently showing prerendered pages.
163 void MarkTabContentsAsPrerendered(TabContents* tab_contents); 165 void MarkTabContentsAsPrerendered(TabContents* tab_contents);
164 void MarkTabContentsAsWouldBePrerendered(TabContents* tab_contents); 166 void MarkTabContentsAsWouldBePrerendered(TabContents* tab_contents);
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 424
423 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); 425 DISALLOW_COPY_AND_ASSIGN(PrerenderManager);
424 }; 426 };
425 427
426 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( 428 PrerenderManager* FindPrerenderManagerUsingRenderProcessId(
427 int render_process_id); 429 int render_process_id);
428 430
429 } // namespace prerender 431 } // namespace prerender
430 432
431 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 433 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698