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

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

Issue 6901128: Cancel prerenders that spawn post requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missed the call to erase. Created 9 years, 8 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
Index: chrome/browser/prerender/prerender_manager.h
diff --git a/chrome/browser/prerender/prerender_manager.h b/chrome/browser/prerender/prerender_manager.h
index 356b33a9c7fea0b8184dff362f062a1f3edb53a5..ca0d1984cf1e9351fb07d45e625266e5574b9513 100644
--- a/chrome/browser/prerender/prerender_manager.h
+++ b/chrome/browser/prerender/prerender_manager.h
@@ -44,6 +44,11 @@ void HandlePrefetchTagOnUIThread(
const GURL& referrer,
bool make_pending);
+void DestroyPreloadForChildRouteIdPairOnUIThread(
jam 2011/05/02 16:21:33 nit: this name seems a bit long. we usually use "
dominich 2011/05/02 16:45:55 Done and I will fix the HandlePrefetchTag above to
+ const base::WeakPtr<PrerenderManager>& prerender_manager_weak_ptr,
+ const std::pair<int, int>& child_route_id_pair,
+ FinalStatus final_status);
+
// PrerenderManager is responsible for initiating and keeping prerendered
// views of webpages. All methods must be called on the UI thread unless
// indicated otherwise.
@@ -78,6 +83,12 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
const GURL& url,
const GURL& referrer);
+ // Destroy all preloads for the given child route id pair and assign a final
+ // status to them.
+ void DestroyPreloadForChildRouteIdPair(
+ const std::pair<int, int>& child_route_id_pair,
+ FinalStatus final_status);
+
// For a given TabContents that wants to navigate to the URL supplied,
// determines whether a preloaded version of the URL can be used,
// and substitutes the prerendered RVH into the TabContents. Returns
@@ -145,6 +156,9 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
static bool MaybeGetQueryStringBasedAliasURL(const GURL& url,
GURL* alias_url);
+ // Returns true if the method given is invalid for prerendering.
+ static bool IsValidHttpMethod(const std::string& method);
+
protected:
struct PendingContentsData;
@@ -184,6 +198,12 @@ class PrerenderManager : public base::SupportsWeakPtr<PrerenderManager>,
// ownership of the PrerenderContents.
PrerenderContents* FindEntry(const GURL& url);
+ // Returns the iterator to the PrerenderContentsData entry that is being
+ // prerendered from the given child route id pair.
+ std::list<PrerenderContentsData>::iterator
+ FindPrerenderContentsForChildRouteIdPair(
+ const std::pair<int, int>& child_route_id_pair);
+
// Returns whether the PrerenderManager is currently within the prerender
// window - effectively, up to 30 seconds after a prefetch tag has been
// observed.

Powered by Google App Engine
This is Rietveld 408576698