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

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

Issue 9733005: net: add DNS certificate revocation experiment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 8 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CHROME_NETWORK_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/time.h"
12 #include "net/base/network_delegate.h" 13 #include "net/base/network_delegate.h"
13 14
14 class CookieSettings; 15 class CookieSettings;
15 class ExtensionEventRouterForwarder; 16 class ExtensionEventRouterForwarder;
16 class ExtensionInfoMap; 17 class ExtensionInfoMap;
17 class PrefService; 18 class PrefService;
18 template<class T> class PrefMember; 19 template<class T> class PrefMember;
19 20
20 typedef PrefMember<bool> BooleanPrefMember; 21 typedef PrefMember<bool> BooleanPrefMember;
21 22
22 namespace policy { 23 namespace policy {
23 class URLBlacklistManager; 24 class URLBlacklistManager;
24 } 25 }
25 26
27 namespace net {
28 class DnsRRResolver;
29 }
30
26 // ChromeNetworkDelegate is the central point from within the chrome code to 31 // ChromeNetworkDelegate is the central point from within the chrome code to
27 // add hooks into the network stack. 32 // add hooks into the network stack.
28 class ChromeNetworkDelegate : public net::NetworkDelegate { 33 class ChromeNetworkDelegate : public net::NetworkDelegate {
29 public: 34 public:
30 // If |profile| is NULL, events will be broadcasted to all profiles, 35 // If |profile| is NULL, events will be broadcasted to all profiles,
31 // otherwise they will only be sent to the specified profile. 36 // otherwise they will only be sent to the specified profile.
32 // |enable_referrers| should be initialized on the UI thread (see below) 37 // |enable_referrers| should be initialized on the UI thread (see below)
33 // beforehand. This object's owner is responsible for cleaning it up at 38 // beforehand. This object's owner is responsible for cleaning it up at
34 // shutdown. If |cookie_settings| is NULL, all cookies are enabled, 39 // shutdown. If |cookie_settings| is NULL, all cookies are enabled,
35 // otherwise, the settings are enforced on all observed network requests. 40 // otherwise, the settings are enforced on all observed network requests.
36 ChromeNetworkDelegate( 41 ChromeNetworkDelegate(
37 ExtensionEventRouterForwarder* event_router, 42 ExtensionEventRouterForwarder* event_router,
38 ExtensionInfoMap* extension_info_map, 43 ExtensionInfoMap* extension_info_map,
39 const policy::URLBlacklistManager* url_blacklist_manager, 44 const policy::URLBlacklistManager* url_blacklist_manager,
40 void* profile, 45 void* profile,
41 CookieSettings* cookie_settings, 46 CookieSettings* cookie_settings,
42 BooleanPrefMember* enable_referrers); 47 BooleanPrefMember* enable_referrers);
43 virtual ~ChromeNetworkDelegate(); 48 virtual ~ChromeNetworkDelegate();
44 49
45 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread. 50 // Binds |enable_referrers| to |pref_service| and moves it to the IO thread.
46 // This method should be called on the UI thread. 51 // This method should be called on the UI thread.
47 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers, 52 static void InitializeReferrersEnabled(BooleanPrefMember* enable_referrers,
48 PrefService* pref_service); 53 PrefService* pref_service);
49 54
55 static void EnableComodoDNSExperiment();
56
50 private: 57 private:
51 // NetworkDelegate implementation. 58 // NetworkDelegate implementation.
52 virtual int OnBeforeURLRequest(net::URLRequest* request, 59 virtual int OnBeforeURLRequest(net::URLRequest* request,
53 const net::CompletionCallback& callback, 60 const net::CompletionCallback& callback,
54 GURL* new_url) OVERRIDE; 61 GURL* new_url) OVERRIDE;
55 virtual int OnBeforeSendHeaders(net::URLRequest* request, 62 virtual int OnBeforeSendHeaders(net::URLRequest* request,
56 const net::CompletionCallback& callback, 63 const net::CompletionCallback& callback,
57 net::HttpRequestHeaders* headers) OVERRIDE; 64 net::HttpRequestHeaders* headers) OVERRIDE;
58 virtual void OnSendHeaders(net::URLRequest* request, 65 virtual void OnSendHeaders(net::URLRequest* request,
59 const net::HttpRequestHeaders& headers) OVERRIDE; 66 const net::HttpRequestHeaders& headers) OVERRIDE;
(...skipping 28 matching lines...) Expand all
88 scoped_refptr<CookieSettings> cookie_settings_; 95 scoped_refptr<CookieSettings> cookie_settings_;
89 96
90 scoped_refptr<ExtensionInfoMap> extension_info_map_; 97 scoped_refptr<ExtensionInfoMap> extension_info_map_;
91 98
92 // Weak, owned by our owner. 99 // Weak, owned by our owner.
93 BooleanPrefMember* enable_referrers_; 100 BooleanPrefMember* enable_referrers_;
94 101
95 // Weak, owned by our owner. 102 // Weak, owned by our owner.
96 const policy::URLBlacklistManager* url_blacklist_manager_; 103 const policy::URLBlacklistManager* url_blacklist_manager_;
97 104
105 static bool comodo_dns_experiment_enabled_;
willchan no longer on Chromium 2012/03/19 21:24:33 chrome-network-stack folks discussed and decided t
agl 2012/03/21 16:16:39 Done.
106 scoped_ptr<net::DnsRRResolver> dnsrr_resolver_;
107 base::TimeTicks last_comodo_resolution_time_;
108
98 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); 109 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
99 }; 110 };
100 111
101 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 112 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698