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

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

Issue 5912001: Add PrerenderResourceHandler and hook it into the ResourceDispatcherHost.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Another merge with trunk Created 9 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 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 2c49e6816f6c8b3410b66f6c977e0f1ed92596ce..0eff09a8b79f94edfc9749424ea0f10832515908 100644
--- a/chrome/browser/prerender/prerender_manager.h
+++ b/chrome/browser/prerender/prerender_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,6 +8,7 @@
#include <list>
+#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "base/time.h"
@@ -19,11 +20,11 @@ class TabContents;
// PrerenderManager is responsible for initiating and keeping prerendered
// views of webpages.
-class PrerenderManager : base::NonThreadSafe {
+class PrerenderManager : public base::RefCounted<PrerenderManager>,
+ private base::NonThreadSafe {
public:
// Owned by a Profile object for the lifetime of the profile.
explicit PrerenderManager(Profile* profile);
- virtual ~PrerenderManager();
// Preloads the URL supplied.
void AddPreload(const GURL& url);
@@ -50,16 +51,16 @@ class PrerenderManager : base::NonThreadSafe {
void set_max_elements(unsigned int num) { max_elements_ = num; }
protected:
- // The following methods exist explicitly rather than just inlined to
- // facilitate testing.
- virtual base::Time GetCurrentTime() const;
- virtual PrerenderContents* CreatePrerenderContents(const GURL& url);
+ virtual ~PrerenderManager();
private:
+ friend class base::RefCounted<PrerenderManager>;
struct PrerenderContentsData;
bool IsPrerenderElementFresh(const base::Time start) const;
void DeleteOldEntries();
+ virtual base::Time GetCurrentTime() const;
+ virtual PrerenderContents* CreatePrerenderContents(const GURL& url);
Profile* profile_;
« no previous file with comments | « chrome/browser/net/chrome_url_request_context.cc ('k') | chrome/browser/prerender/prerender_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698