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

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

Issue 7060012: PrerenderTracker Cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prerender/prerender_tracker.h
===================================================================
--- chrome/browser/prerender/prerender_tracker.h (revision 86287)
+++ chrome/browser/prerender/prerender_tracker.h (working copy)
@@ -65,7 +65,8 @@
bool GetFinalStatus(int child_id, int route_id,
FinalStatus* final_status) const;
- protected:
+ private:
+ friend struct DefaultSingletonTraits<PrerenderTracker>;
friend class PrerenderContents;
FRIEND_TEST_ALL_PREFIXES(PrerenderTrackerTest, PrerenderTrackerUsed);
@@ -74,6 +75,16 @@
FRIEND_TEST_ALL_PREFIXES(PrerenderTrackerTest, PrerenderTrackerCancelledFast);
FRIEND_TEST_ALL_PREFIXES(PrerenderTrackerTest, PrerenderTrackerMultiple);
+ typedef std::pair<int, int> ChildRouteIdPair;
+
+ // Map of child/route id pairs to final statuses.
+ typedef std::map<ChildRouteIdPair, RenderViewInfo> FinalStatusMap;
+ // Set of child/route id pairs that may be prerendering.
+ typedef std::set<ChildRouteIdPair> PossiblyPrerenderingChildRouteIdPairs;
+
+ PrerenderTracker();
+ ~PrerenderTracker();
+
// Must be called when a RenderView starts prerendering, before the first
// navigation starts to avoid any races.
void OnPrerenderingStarted(int child_id, int route_id,
@@ -84,26 +95,20 @@
// destroyed.
void OnPrerenderingFinished(int child_id, int route_id);
- private:
- friend struct DefaultSingletonTraits<PrerenderTracker>;
-
- typedef std::pair<int, int> ChildRouteIdPair;
-
- // Map of child/route id pairs to final statuses.
- typedef std::map<ChildRouteIdPair, RenderViewInfo> FinalStatusMap;
- // Set of child/route id pairs that may be prerendering.
- typedef std::set<ChildRouteIdPair> PossiblyPrerenderingChildRouteIdPairs;
-
- PrerenderTracker();
- ~PrerenderTracker();
-
// Attempts to set the FinalStatus of the specified RenderView to
- // |final_status|. If the FinalStatus of the RenderView has already been
- // set, does nothing. Returns the resulting FinalStatus of that RenderView,
- // regardless of success or failure. If the RenderView isn't currently
- // prerendering, returns FINAL_STATUS_MAX.
- FinalStatus SetFinalStatus(int child_id, int route_id,
- FinalStatus final_status);
+ // |desired_final_status|.
+ //
+ // If the FinalStatus of the RenderView is successfully set, returns true and
+ // sets |actual_final_status| to |desired_final_status|.
+ //
+ // If the FinalStatus of the RenderView was already set, returns false and
+ // sets |actual_final_status| to the actual FinalStatus of the RenderView.
+ //
+ // If the RenderView is not a prerendering RenderView, returns false and sets
+ // |actual_final_status| to FINAL_STATUS_MAX.
+ bool SetFinalStatus(int child_id, int route_id,
+ FinalStatus desired_final_status,
+ FinalStatus* actual_final_status);
// Add/remove the specified pair to |possibly_prerendering_io_thread_set_| on
// the IO Thread.
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_tracker.cc » ('j') | chrome/browser/prerender/prerender_tracker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698