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

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

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest merge Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/net/about_protocol_handler.cc ('k') | chrome/browser/net/connect_interceptor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_ 5 #ifndef CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_
6 #define CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_ 6 #define CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/memory/mru_cache.h" 9 #include "base/memory/mru_cache.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 10 matching lines...) Expand all
21 public: 21 public:
22 // Construction includes registration as an URL. 22 // Construction includes registration as an URL.
23 explicit ConnectInterceptor(Predictor* predictor); 23 explicit ConnectInterceptor(Predictor* predictor);
24 // Destruction includes unregistering. 24 // Destruction includes unregistering.
25 virtual ~ConnectInterceptor(); 25 virtual ~ConnectInterceptor();
26 26
27 protected: 27 protected:
28 // Overridden from net::URLRequest::Interceptor: 28 // Overridden from net::URLRequest::Interceptor:
29 // Learn about referrers, and optionally preconnect based on history. 29 // Learn about referrers, and optionally preconnect based on history.
30 virtual net::URLRequestJob* MaybeIntercept( 30 virtual net::URLRequestJob* MaybeIntercept(
31 net::URLRequest* request) const OVERRIDE; 31 net::URLRequest* request,
32 net::NetworkDelegate* network_delegate) const OVERRIDE;
32 virtual net::URLRequestJob* MaybeInterceptResponse( 33 virtual net::URLRequestJob* MaybeInterceptResponse(
33 net::URLRequest* request) const OVERRIDE; 34 net::URLRequest* request,
35 net::NetworkDelegate* network_delegate) const OVERRIDE;
34 virtual net::URLRequestJob* MaybeInterceptRedirect( 36 virtual net::URLRequestJob* MaybeInterceptRedirect(
35 const GURL& location, net::URLRequest* request) const OVERRIDE; 37 const GURL& location,
38 net::URLRequest* request,
39 net::NetworkDelegate* network_delegate) const OVERRIDE;
36 40
37 private: 41 private:
38 // Provide access to local class TimedCache for testing. 42 // Provide access to local class TimedCache for testing.
39 FRIEND_TEST_ALL_PREFIXES(ConnectInterceptorTest, TimedCacheRecall); 43 FRIEND_TEST_ALL_PREFIXES(ConnectInterceptorTest, TimedCacheRecall);
40 FRIEND_TEST_ALL_PREFIXES(ConnectInterceptorTest, TimedCacheEviction); 44 FRIEND_TEST_ALL_PREFIXES(ConnectInterceptorTest, TimedCacheEviction);
41 45
42 // Define a LRU cache that recalls all navigations within the last N seconds. 46 // Define a LRU cache that recalls all navigations within the last N seconds.
43 // When we learn about subresources to possibly preconnect to, it would be a 47 // When we learn about subresources to possibly preconnect to, it would be a
44 // waste to preconnect when the original navigation was too long ago. Any 48 // waste to preconnect when the original navigation was too long ago. Any
45 // connected, but unused TCP/IP connection, will generally be reset by the 49 // connected, but unused TCP/IP connection, will generally be reset by the
(...skipping 27 matching lines...) Expand all
73 }; 77 };
74 TimedCache timed_cache_; 78 TimedCache timed_cache_;
75 Predictor* const predictor_; 79 Predictor* const predictor_;
76 80
77 DISALLOW_COPY_AND_ASSIGN(ConnectInterceptor); 81 DISALLOW_COPY_AND_ASSIGN(ConnectInterceptor);
78 }; 82 };
79 83
80 } // namespace chrome_browser_net 84 } // namespace chrome_browser_net
81 85
82 #endif // CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_ 86 #endif // CHROME_BROWSER_NET_CONNECT_INTERCEPTOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/about_protocol_handler.cc ('k') | chrome/browser/net/connect_interceptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698