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

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

Issue 9226037: Cancel prerenders from Omnibox if we navigate to a different URL than predicted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove debug logging Created 8 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 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 SessionStorageNamespace* session_storage_namespace); 114 SessionStorageNamespace* session_storage_namespace);
115 115
116 // Destroy all prerenders for the given child route id pair and assign a final 116 // Destroy all prerenders for the given child route id pair and assign a final
117 // status to them. 117 // status to them.
118 virtual void DestroyPrerenderForRenderView(int process_id, int view_id, 118 virtual void DestroyPrerenderForRenderView(int process_id, int view_id,
119 FinalStatus final_status); 119 FinalStatus final_status);
120 120
121 // Cancels all active prerenders. 121 // Cancels all active prerenders.
122 void CancelAllPrerenders(); 122 void CancelAllPrerenders();
123 123
124 // Cancels all active prerenders with the ORIGIN_OMNIBOX origin.
125 void CancelOmniboxPrerenders();
126
124 // For a given WebContents that wants to navigate to the URL supplied, 127 // For a given WebContents that wants to navigate to the URL supplied,
125 // determines whether a prerendered version of the URL can be used, 128 // determines whether a prerendered version of the URL can be used,
126 // and substitutes the prerendered RVH into the WebContents. |opener_url| is 129 // and substitutes the prerendered RVH into the WebContents. |opener_url| is
127 // set to the window.opener url that the WebContents should have set and 130 // set to the window.opener url that the WebContents should have set and
128 // will be empty if there is no opener set. Returns whether or not a 131 // will be empty if there is no opener set. Returns whether or not a
129 // prerendered RVH could be used or not. 132 // prerendered RVH could be used or not.
130 bool MaybeUsePrerenderedPage(content::WebContents* web_contents, 133 bool MaybeUsePrerenderedPage(content::WebContents* web_contents,
131 const GURL& url, 134 const GURL& url,
132 const GURL& opener_url); 135 const GURL& opener_url);
133 136
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 213
211 PrerenderTracker* prerender_tracker() { return prerender_tracker_; } 214 PrerenderTracker* prerender_tracker() { return prerender_tracker_; }
212 215
213 // Adds a condition. This is owned by the PrerenderManager. 216 // Adds a condition. This is owned by the PrerenderManager.
214 void AddCondition(const PrerenderCondition* condition); 217 void AddCondition(const PrerenderCondition* condition);
215 218
216 bool IsTopSite(const GURL& url); 219 bool IsTopSite(const GURL& url);
217 220
218 bool IsPendingEntry(const GURL& url) const; 221 bool IsPendingEntry(const GURL& url) const;
219 222
223 // Returns true if |url| matches any URLs being prerendered.
224 // TODO(dominich): This should be a const method but FindEntry is not const.
225 // It should be.
226 bool IsPrerendering(const GURL& url);
227
220 protected: 228 protected:
221 void SetPrerenderContentsFactory( 229 void SetPrerenderContentsFactory(
222 PrerenderContents::Factory* prerender_contents_factory); 230 PrerenderContents::Factory* prerender_contents_factory);
223 231
224 // Utility method that is called from the virtual Shutdown method on this 232 // Utility method that is called from the virtual Shutdown method on this
225 // class but is called directly from the TestPrerenderManager in the unit 233 // class but is called directly from the TestPrerenderManager in the unit
226 // tests. 234 // tests.
227 void DoShutdown(); 235 void DoShutdown();
228 236
229 private: 237 private:
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 438
431 DISALLOW_COPY_AND_ASSIGN(PrerenderManager); 439 DISALLOW_COPY_AND_ASSIGN(PrerenderManager);
432 }; 440 };
433 441
434 PrerenderManager* FindPrerenderManagerUsingRenderProcessId( 442 PrerenderManager* FindPrerenderManagerUsingRenderProcessId(
435 int render_process_id); 443 int render_process_id);
436 444
437 } // namespace prerender 445 } // namespace prerender
438 446
439 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_ 447 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698