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

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

Issue 2337233006: CL for src perf tryjob to run page_cycler_v2.intl_ko_th_vi benchmark on all-android platform(s)
Patch Set: Created 4 years, 3 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 <memory>
9
10 #include "base/gtest_prod_util.h"
11 #include "base/macros.h"
12 #include "chrome/browser/net/timed_cache.h"
13
14 class GURL;
15
16 namespace net {
17 class URLRequest;
18 }
19
20 namespace chrome_browser_net {
21
22 class Predictor;
23
24 //------------------------------------------------------------------------------
25 // An interceptor to monitor URLRequests so that we can do speculative DNS
26 // resolution and/or speculative TCP preconnections.
27 class ConnectInterceptor {
28 public:
29 // Construction includes registration as an URL.
30 explicit ConnectInterceptor(Predictor* predictor);
31 // Destruction includes unregistering.
32 virtual ~ConnectInterceptor();
33
34 // Learn about referrers, and optionally preconnect based on history.
35 void WitnessURLRequest(net::URLRequest* request);
36
37 private:
38 // Provide access to local class TimedCache for testing.
39 FRIEND_TEST_ALL_PREFIXES(ConnectInterceptorTest, TimedCacheRecall);
40 FRIEND_TEST_ALL_PREFIXES(ConnectInterceptorTest, TimedCacheEviction);
41
42 TimedCache timed_cache_;
43 Predictor* const predictor_;
44
45 DISALLOW_COPY_AND_ASSIGN(ConnectInterceptor);
46 };
47
48 } // namespace chrome_browser_net
49
50 #endif // CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_network_delegate.cc ('k') | chrome/browser/net/connect_interceptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698