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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc

Issue 286013002: Added alternative configuration for the data reduction proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK fix Created 6 years, 6 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
OLDNEW
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 17 matching lines...) Expand all
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 DataReductionProxySettings* settings) : settings_(settings) {
38 DCHECK(settings);
38 } 39 }
39 40
40 DataReductionProxyAuthRequestHandler::~DataReductionProxyAuthRequestHandler() { 41 DataReductionProxyAuthRequestHandler::~DataReductionProxyAuthRequestHandler() {
41 } 42 }
42 43
43 DataReductionProxyAuthRequestHandler::TryHandleResult 44 DataReductionProxyAuthRequestHandler::TryHandleResult
44 DataReductionProxyAuthRequestHandler::TryHandleAuthentication( 45 DataReductionProxyAuthRequestHandler::TryHandleAuthentication(
45 net::AuthChallengeInfo* auth_info, 46 net::AuthChallengeInfo* auth_info,
46 base::string16* user, 47 base::string16* user,
47 base::string16* password) { 48 base::string16* password) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 *user = base::string16(); 98 *user = base::string16();
98 DLOG(WARNING) << "Data reduction proxy auth produced null token."; 99 DLOG(WARNING) << "Data reduction proxy auth produced null token.";
99 return TRY_HANDLE_RESULT_CANCEL; 100 return TRY_HANDLE_RESULT_CANCEL;
100 } 101 }
101 *user = base::UTF8ToUTF16("fw-cookie"); 102 *user = base::UTF8ToUTF16("fw-cookie");
102 return TRY_HANDLE_RESULT_PROCEED; 103 return TRY_HANDLE_RESULT_PROCEED;
103 } 104 }
104 105
105 bool DataReductionProxyAuthRequestHandler::IsAcceptableAuthChallenge( 106 bool DataReductionProxyAuthRequestHandler::IsAcceptableAuthChallenge(
106 net::AuthChallengeInfo* auth_info) { 107 net::AuthChallengeInfo* auth_info) {
107 return DataReductionProxySettings::IsAcceptableAuthChallenge(auth_info); 108 return settings_->IsAcceptableAuthChallenge(auth_info);
108 } 109 }
109 110
110 base::string16 DataReductionProxyAuthRequestHandler::GetTokenForAuthChallenge( 111 base::string16 DataReductionProxyAuthRequestHandler::GetTokenForAuthChallenge(
111 net::AuthChallengeInfo* auth_info) { 112 net::AuthChallengeInfo* auth_info) {
112 DCHECK(settings_); 113 DCHECK(settings_);
113 return settings_->GetTokenForAuthChallenge(auth_info); 114 return settings_->GetTokenForAuthChallenge(auth_info);
114 } 115 }
115 116
116 base::TimeTicks DataReductionProxyAuthRequestHandler::Now() { 117 base::TimeTicks DataReductionProxyAuthRequestHandler::Now() {
117 return base::TimeTicks::Now(); 118 return base::TimeTicks::Now();
118 } 119 }
119 120
120 } // namespace data_reduction_proxy 121 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698