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

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

Issue 11348357: Add observer interface to PrerenderContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _really_ fix windows build. Created 8 years 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
diff --git a/chrome/browser/prerender/prerender_tracker.h b/chrome/browser/prerender/prerender_tracker.h
index f4bc1088ec4faef8b36da6f930d2873417888059..28e772f5ea54970af79f34345c733d7121e434bd 100644
--- a/chrome/browser/prerender/prerender_tracker.h
+++ b/chrome/browser/prerender/prerender_tracker.h
@@ -7,11 +7,13 @@
#include <map>
#include <set>
+#include <utility>
#include <vector>
#include "base/gtest_prod_util.h"
#include "base/synchronization/lock.h"
#include "base/threading/non_thread_safe.h"
+#include "chrome/browser/prerender/prerender_contents.h"
#include "chrome/browser/prerender/prerender_final_status.h"
#include "googleurl/src/gurl.h"
@@ -23,17 +25,17 @@ struct RenderViewInfo;
// PrerenderTracker is responsible for keeping track of all prerendering
// RenderViews and their statuses. Its list is guaranteed to be up to date
// and can be modified on any thread.
-class PrerenderTracker {
+class PrerenderTracker : public base::NonThreadSafe,
+ public PrerenderContents::Observer {
public:
PrerenderTracker();
- ~PrerenderTracker();
+ virtual ~PrerenderTracker();
// Attempts to set the status of the specified RenderViewHost to
// FINAL_STATUS_USED. Returns true on success. Returns false if it has
// already been cancelled for any reason or is no longer prerendering.
// Can only be called only on the IO thread. This method will not call
- // PrerenderContents::set_final_status() on the corresponding
- // PrerenderContents.
+ // PrerenderContents::SetFinalStatus() on the corresponding PrerenderContents.
//
// If it returns true, all subsequent calls to TryCancel and TryUse for the
// RenderView will return false.
@@ -83,13 +85,12 @@ class 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,
- PrerenderManager* prerender_manager);
+ virtual void OnPrerenderStart(PrerenderContents* prerender_contents) OVERRIDE;
// Must be called when a RenderView stops prerendering, either because the
// RenderView was used or prerendering was cancelled and it is being
// destroyed.
- void OnPrerenderingFinished(int child_id, int route_id);
+ virtual void OnPrerenderStop(PrerenderContents* prerender_contents) OVERRIDE;
mmenke 2012/12/06 19:54:22 optional: While still technically accurate, not s
gavinp 2012/12/07 17:37:04 Done.
// Attempts to set the FinalStatus of the specified RenderView to
// |desired_final_status|. If non-NULL, |actual_final_status| is set to the

Powered by Google App Engine
This is Rietveld 408576698