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

Side by Side Diff: chrome/browser/net/connect_interceptor.h

Issue 1857383002: Refactor net predictor to use ResourceThrottles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_
6 #define CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_
7
8 #include "base/gtest_prod_util.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/net/timed_cache.h"
12
13 class GURL;
14
15 namespace net {
16 class URLRequest;
17 }
18
19 namespace chrome_browser_net {
20
21 class Predictor;
22
23 //------------------------------------------------------------------------------
24 // An interceptor to monitor URLRequests so that we can do speculative DNS
25 // resolution and/or speculative TCP preconnections.
26 class ConnectInterceptor {
27 public:
28 // Construction includes registration as an URL.
29 explicit ConnectInterceptor(Predictor* predictor);
30 // Destruction includes unregistering.
31 virtual ~ConnectInterceptor();
32
33 // Learn about referrers, and optionally preconnect based on history.
34 void WitnessURLRequest(net::URLRequest* request);
35
36 private:
37 // Provide access to local class TimedCache for testing.
38 FRIEND_TEST_ALL_PREFIXES(ConnectInterceptorTest, TimedCacheRecall);
39 FRIEND_TEST_ALL_PREFIXES(ConnectInterceptorTest, TimedCacheEviction);
40
41 TimedCache timed_cache_;
42 Predictor* const predictor_;
43
44 DISALLOW_COPY_AND_ASSIGN(ConnectInterceptor);
45 };
46
47 } // namespace chrome_browser_net
48
49 #endif // CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698