| 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.
|
|
|