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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/connect_interceptor.h
diff --git a/chrome/browser/net/connect_interceptor.h b/chrome/browser/net/connect_interceptor.h
new file mode 100644
index 0000000000000000000000000000000000000000..febf196a4f0372521da87acf2d54294397ac5255
--- /dev/null
+++ b/chrome/browser/net/connect_interceptor.h
@@ -0,0 +1,50 @@
+// 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.
+
+#ifndef CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_
+#define CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_
+
+#include <memory>
+
+#include "base/gtest_prod_util.h"
+#include "base/macros.h"
+#include "chrome/browser/net/timed_cache.h"
+
+class GURL;
+
+namespace net {
+class URLRequest;
+}
+
+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:
+ // Construction includes registration as an URL.
+ explicit ConnectInterceptor(Predictor* predictor);
+ // Destruction includes unregistering.
+ virtual ~ConnectInterceptor();
+
+ // Learn about referrers, and optionally preconnect based on history.
+ void WitnessURLRequest(net::URLRequest* request);
+
+ private:
+ // Provide access to local class TimedCache for testing.
+ FRIEND_TEST_ALL_PREFIXES(ConnectInterceptorTest, TimedCacheRecall);
+ FRIEND_TEST_ALL_PREFIXES(ConnectInterceptorTest, TimedCacheEviction);
+
+ TimedCache timed_cache_;
+ Predictor* const predictor_;
+
+ DISALLOW_COPY_AND_ASSIGN(ConnectInterceptor);
+};
+
+} // namespace chrome_browser_net
+
+#endif // CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_
« 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