| OLD | NEW |
| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 namespace net { | 44 namespace net { |
| 45 class URLRequest; | 45 class URLRequest; |
| 46 } | 46 } |
| 47 | 47 |
| 48 namespace policy { | 48 namespace policy { |
| 49 class URLBlacklistManager; | 49 class URLBlacklistManager; |
| 50 } | 50 } |
| 51 | 51 |
| 52 namespace prerender { |
| 53 class PrerenderTracker; |
| 54 } |
| 55 |
| 52 // ChromeNetworkDelegate is the central point from within the chrome code to | 56 // ChromeNetworkDelegate is the central point from within the chrome code to |
| 53 // add hooks into the network stack. | 57 // add hooks into the network stack. |
| 54 class ChromeNetworkDelegate : public net::NetworkDelegate { | 58 class ChromeNetworkDelegate : public net::NetworkDelegate { |
| 55 public: | 59 public: |
| 56 // |enable_referrers| (and all of the other optional PrefMembers) should be | 60 // |enable_referrers| (and all of the other optional PrefMembers) should be |
| 57 // initialized on the UI thread (see below) beforehand. This object's owner is | 61 // initialized on the UI thread (see below) beforehand. This object's owner is |
| 58 // responsible for cleaning them up at shutdown. | 62 // responsible for cleaning them up at shutdown. |
| 59 ChromeNetworkDelegate(extensions::EventRouterForwarder* event_router, | 63 ChromeNetworkDelegate(extensions::EventRouterForwarder* event_router, |
| 60 BooleanPrefMember* enable_referrers); | 64 BooleanPrefMember* enable_referrers); |
| 61 virtual ~ChromeNetworkDelegate(); | 65 virtual ~ChromeNetworkDelegate(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 BooleanPrefMember* force_google_safe_search) { | 103 BooleanPrefMember* force_google_safe_search) { |
| 100 force_google_safe_search_ = force_google_safe_search; | 104 force_google_safe_search_ = force_google_safe_search; |
| 101 } | 105 } |
| 102 | 106 |
| 103 void set_domain_reliability_monitor( | 107 void set_domain_reliability_monitor( |
| 104 domain_reliability::DomainReliabilityMonitor* | 108 domain_reliability::DomainReliabilityMonitor* |
| 105 domain_reliability_monitor) { | 109 domain_reliability_monitor) { |
| 106 domain_reliability_monitor_ = domain_reliability_monitor; | 110 domain_reliability_monitor_ = domain_reliability_monitor; |
| 107 } | 111 } |
| 108 | 112 |
| 113 void set_prerender_tracker(prerender::PrerenderTracker* prerender_tracker) { |
| 114 prerender_tracker_ = prerender_tracker; |
| 115 } |
| 116 |
| 109 // Adds the Client Hints header to HTTP requests. | 117 // Adds the Client Hints header to HTTP requests. |
| 110 void SetEnableClientHints(); | 118 void SetEnableClientHints(); |
| 111 | 119 |
| 112 // Causes |OnCanThrottleRequest| to always return false, for all | 120 // Causes |OnCanThrottleRequest| to always return false, for all |
| 113 // instances of this object. | 121 // instances of this object. |
| 114 static void NeverThrottleRequests(); | 122 static void NeverThrottleRequests(); |
| 115 | 123 |
| 116 // Binds the pref members to |pref_service| and moves them to the IO thread. | 124 // Binds the pref members to |pref_service| and moves them to the IO thread. |
| 117 // |enable_referrers| cannot be NULL, the others can. | 125 // |enable_referrers| cannot be NULL, the others can. |
| 118 // This method should be called on the UI thread. | 126 // This method should be called on the UI thread. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // over the network. | 229 // over the network. |
| 222 int64 received_content_length_; | 230 int64 received_content_length_; |
| 223 | 231 |
| 224 // Total original size of all content before it was transferred. | 232 // Total original size of all content before it was transferred. |
| 225 int64 original_content_length_; | 233 int64 original_content_length_; |
| 226 | 234 |
| 227 scoped_ptr<ClientHints> client_hints_; | 235 scoped_ptr<ClientHints> client_hints_; |
| 228 | 236 |
| 229 bool first_request_; | 237 bool first_request_; |
| 230 | 238 |
| 239 prerender::PrerenderTracker* prerender_tracker_; |
| 240 |
| 231 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); | 241 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); |
| 232 }; | 242 }; |
| 233 | 243 |
| 234 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ | 244 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ |
| OLD | NEW |