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 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_requ
est_handler.h" | 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_requ
est_handler.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" | 9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
10 #include "net/base/auth.h" | 10 #include "net/base/auth.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace data_reduction_proxy { | 26 namespace data_reduction_proxy { |
27 | 27 |
28 int64 DataReductionProxyAuthRequestHandler::auth_request_timestamp_ = 0; | 28 int64 DataReductionProxyAuthRequestHandler::auth_request_timestamp_ = 0; |
29 | 29 |
30 int DataReductionProxyAuthRequestHandler::back_to_back_failure_count_ = 0; | 30 int DataReductionProxyAuthRequestHandler::back_to_back_failure_count_ = 0; |
31 | 31 |
32 int64 | 32 int64 |
33 DataReductionProxyAuthRequestHandler::auth_token_invalidation_timestamp_ = 0; | 33 DataReductionProxyAuthRequestHandler::auth_token_invalidation_timestamp_ = 0; |
34 | 34 |
35 | 35 |
36 DataReductionProxyAuthRequestHandler::DataReductionProxyAuthRequestHandler() { | 36 DataReductionProxyAuthRequestHandler::DataReductionProxyAuthRequestHandler( |
| 37 DataReductionProxySettings* settings) : settings_(settings) { |
37 } | 38 } |
38 | 39 |
39 DataReductionProxyAuthRequestHandler::~DataReductionProxyAuthRequestHandler() { | 40 DataReductionProxyAuthRequestHandler::~DataReductionProxyAuthRequestHandler() { |
40 } | 41 } |
41 | 42 |
42 DataReductionProxyAuthRequestHandler::TryHandleResult | 43 DataReductionProxyAuthRequestHandler::TryHandleResult |
43 DataReductionProxyAuthRequestHandler::TryHandleAuthentication( | 44 DataReductionProxyAuthRequestHandler::TryHandleAuthentication( |
44 net::AuthChallengeInfo* auth_info, | 45 net::AuthChallengeInfo* auth_info, |
45 base::string16* user, | 46 base::string16* user, |
46 base::string16* password) { | 47 base::string16* password) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 return TRY_HANDLE_RESULT_PROCEED; | 102 return TRY_HANDLE_RESULT_PROCEED; |
102 } | 103 } |
103 | 104 |
104 bool DataReductionProxyAuthRequestHandler::IsAcceptableAuthChallenge( | 105 bool DataReductionProxyAuthRequestHandler::IsAcceptableAuthChallenge( |
105 net::AuthChallengeInfo* auth_info) { | 106 net::AuthChallengeInfo* auth_info) { |
106 return DataReductionProxySettings::IsAcceptableAuthChallenge(auth_info); | 107 return DataReductionProxySettings::IsAcceptableAuthChallenge(auth_info); |
107 } | 108 } |
108 | 109 |
109 base::string16 DataReductionProxyAuthRequestHandler::GetTokenForAuthChallenge( | 110 base::string16 DataReductionProxyAuthRequestHandler::GetTokenForAuthChallenge( |
110 net::AuthChallengeInfo* auth_info) { | 111 net::AuthChallengeInfo* auth_info) { |
111 return DataReductionProxySettings::GetTokenForAuthChallenge(auth_info); | 112 DCHECK(settings_); |
| 113 return settings_->GetTokenForAuthChallenge(auth_info); |
112 } | 114 } |
113 | 115 |
114 base::TimeTicks DataReductionProxyAuthRequestHandler::Now() { | 116 base::TimeTicks DataReductionProxyAuthRequestHandler::Now() { |
115 return base::TimeTicks::Now(); | 117 return base::TimeTicks::Now(); |
116 } | 118 } |
117 | 119 |
118 } // namespace data_reduction_proxy | 120 } // namespace data_reduction_proxy |
OLD | NEW |