OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NETWOR
K_DELEGATE_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NETWOR
K_DELEGATE_H_ |
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NETWOR
K_DELEGATE_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NETWOR
K_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_metr
ics.h" | 15 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_metr
ics.h" |
| 16 #include "net/base/completion_callback.h" |
16 #include "net/base/layered_network_delegate.h" | 17 #include "net/base/layered_network_delegate.h" |
17 #include "net/proxy/proxy_retry_info.h" | 18 #include "net/proxy/proxy_retry_info.h" |
18 | 19 |
19 class GURL; | 20 class GURL; |
20 | 21 |
21 namespace base { | 22 namespace base { |
22 class Value; | 23 class Value; |
23 } | 24 } |
24 | 25 |
25 namespace net { | 26 namespace net { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // report UMA. | 79 // report UMA. |
79 void InitIODataAndUMA( | 80 void InitIODataAndUMA( |
80 DataReductionProxyIOData* io_data, | 81 DataReductionProxyIOData* io_data, |
81 DataReductionProxyBypassStats* bypass_stats); | 82 DataReductionProxyBypassStats* bypass_stats); |
82 | 83 |
83 // Creates a |Value| summary of the state of the network session. The caller | 84 // Creates a |Value| summary of the state of the network session. The caller |
84 // is responsible for deleting the returned value. | 85 // is responsible for deleting the returned value. |
85 base::Value* SessionNetworkStatsInfoToValue() const; | 86 base::Value* SessionNetworkStatsInfoToValue() const; |
86 | 87 |
87 private: | 88 private: |
| 89 // Resets if Lo-Fi has been used for the last main frame load to false. |
| 90 void OnBeforeURLRequestInternal(net::URLRequest* request, |
| 91 const net::CompletionCallback& callback, |
| 92 GURL* new_url) override; |
| 93 |
88 // Called after a proxy connection. Allows the delegate to read/write | 94 // Called after a proxy connection. Allows the delegate to read/write |
89 // |headers| before they get sent out. |headers| is valid only until | 95 // |headers| before they get sent out. |headers| is valid only until |
90 // OnCompleted or OnURLRequestDestroyed is called for this request. | 96 // OnCompleted or OnURLRequestDestroyed is called for this request. |
91 void OnBeforeSendProxyHeadersInternal( | 97 void OnBeforeSendProxyHeadersInternal( |
92 net::URLRequest* request, | 98 net::URLRequest* request, |
93 const net::ProxyInfo& proxy_info, | 99 const net::ProxyInfo& proxy_info, |
94 net::HttpRequestHeaders* headers) override; | 100 net::HttpRequestHeaders* headers) override; |
95 | 101 |
96 // Indicates that the URL request has been completed or failed. | 102 // Indicates that the URL request has been completed or failed. |
97 // |started| indicates whether the request has been started. If false, | 103 // |started| indicates whether the request has been started. If false, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 149 |
144 DataReductionProxyIOData* data_reduction_proxy_io_data_; | 150 DataReductionProxyIOData* data_reduction_proxy_io_data_; |
145 | 151 |
146 const DataReductionProxyConfigurator* configurator_; | 152 const DataReductionProxyConfigurator* configurator_; |
147 | 153 |
148 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyNetworkDelegate); | 154 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyNetworkDelegate); |
149 }; | 155 }; |
150 } // namespace data_reduction_proxy | 156 } // namespace data_reduction_proxy |
151 | 157 |
152 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NET
WORK_DELEGATE_H_ | 158 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_NET
WORK_DELEGATE_H_ |
OLD | NEW |