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

Unified Diff: chrome/browser/net/connect_interceptor.h

Issue 7690006: Revert 97446 - Modifying prefetch to account for multi-profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 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
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/net/connect_interceptor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/connect_interceptor.h
===================================================================
--- chrome/browser/net/connect_interceptor.h (revision 97464)
+++ chrome/browser/net/connect_interceptor.h (working copy)
@@ -6,34 +6,30 @@
#define CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_
#pragma once
+#include "net/url_request/url_request.h"
+
#include "base/gtest_prod_util.h"
#include "base/memory/mru_cache.h"
-#include "base/time.h"
-#include "net/url_request/url_request_job_factory.h"
namespace chrome_browser_net {
-class Predictor;
-
//------------------------------------------------------------------------------
// An interceptor to monitor URLRequests so that we can do speculative DNS
// resolution and/or speculative TCP preconnections.
-class ConnectInterceptor : public net::URLRequestJobFactory::Interceptor {
+class ConnectInterceptor : public net::URLRequest::Interceptor {
public:
// Construction includes registration as an URL.
- explicit ConnectInterceptor(Predictor* predictor);
+ ConnectInterceptor();
// Destruction includes unregistering.
virtual ~ConnectInterceptor();
protected:
// Overridden from net::URLRequest::Interceptor:
// Learn about referrers, and optionally preconnect based on history.
- virtual net::URLRequestJob* MaybeIntercept(
- net::URLRequest* request) const OVERRIDE;
- virtual net::URLRequestJob* MaybeInterceptResponse(
- net::URLRequest* request) const OVERRIDE;
- virtual net::URLRequestJob* MaybeInterceptRedirect(
- const GURL& location, net::URLRequest* request) const OVERRIDE;
+ virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request);
+ virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request);
+ virtual net::URLRequestJob* MaybeInterceptRedirect(net::URLRequest* request,
+ const GURL& location);
private:
// Provide access to local class TimedCache for testing.
@@ -52,20 +48,17 @@
// Evicts any entries that have been in the FIFO "too long," and then checks
// to see if the given url is (still) in the FIFO cache.
- bool WasRecentlySeen(const GURL& url) const;
+ bool WasRecentlySeen(const GURL& url);
// Adds the given url to the cache, where it will remain for max_duration_.
- void SetRecentlySeen(const GURL& url) const;
+ void SetRecentlySeen(const GURL& url);
private:
// Our cache will be keyed on a URL (actually, just a scheme/host/port).
// We will always track the time it was last added to the FIFO cache by
// remembering a TimeTicks value.
typedef base::MRUCache<GURL, base::TimeTicks> UrlMruTimedCache;
- // mru_cache_ has to be mutable in order to be accessed from the overriden
- // URLRequestJob functions. It is mutable because it tracks the urls and
- // caches them.
- mutable UrlMruTimedCache mru_cache_;
+ UrlMruTimedCache mru_cache_;
// The longest time an entry can persist in the cache, and still be found.
const base::TimeDelta max_duration_;
@@ -73,7 +66,6 @@
DISALLOW_COPY_AND_ASSIGN(TimedCache);
};
TimedCache timed_cache_;
- Predictor* const predictor_;
DISALLOW_COPY_AND_ASSIGN(ConnectInterceptor);
};
« no previous file with comments | « chrome/browser/io_thread.cc ('k') | chrome/browser/net/connect_interceptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698