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 #include "net/http/http_auth_handler.h" | 5 #include "net/http/http_auth_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
11 #include "net/http/http_auth_challenge_tokenizer.h" | 11 #include "net/http/http_auth_challenge_tokenizer.h" |
12 #include "net/log/net_log_event_type.h" | 12 #include "net/log/net_log_event_type.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 | 15 |
16 HttpAuthHandler::HttpAuthHandler() | 16 HttpAuthHandler::HttpAuthHandler() |
17 : auth_scheme_(HttpAuth::AUTH_SCHEME_MAX), | 17 : auth_scheme_(HttpAuth::AUTH_SCHEME_MAX), |
18 score_(-1), | 18 score_(-1), |
19 target_(HttpAuth::AUTH_NONE), | 19 target_(HttpAuth::AUTH_NONE), |
20 properties_(-1) { | 20 properties_(-1) { |
21 } | 21 } |
22 | 22 |
23 HttpAuthHandler::~HttpAuthHandler() { | 23 HttpAuthHandler::~HttpAuthHandler() { |
24 } | 24 } |
25 | 25 |
26 bool HttpAuthHandler::InitFromChallenge(HttpAuthChallengeTokenizer* challenge, | 26 bool HttpAuthHandler::InitFromChallenge(HttpAuthChallengeTokenizer* challenge, |
27 HttpAuth::Target target, | 27 HttpAuth::Target target, |
28 const SSLInfo& ssl_info, | 28 const SSLInfo& ssl_info, |
29 const GURL& origin, | 29 const GURL& origin, |
30 const BoundNetLog& net_log) { | 30 const NetLogWithSource& net_log) { |
31 origin_ = origin; | 31 origin_ = origin; |
32 target_ = target; | 32 target_ = target; |
33 score_ = -1; | 33 score_ = -1; |
34 properties_ = -1; | 34 properties_ = -1; |
35 net_log_ = net_log; | 35 net_log_ = net_log; |
36 | 36 |
37 auth_challenge_ = challenge->challenge_text(); | 37 auth_challenge_ = challenge->challenge_text(); |
38 bool ok = Init(challenge, ssl_info); | 38 bool ok = Init(challenge, ssl_info); |
39 | 39 |
40 // Init() is expected to set the scheme, realm, score, and properties. The | 40 // Init() is expected to set the scheme, realm, score, and properties. The |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 callback.Run(rv); | 101 callback.Run(rv); |
102 } | 102 } |
103 | 103 |
104 void HttpAuthHandler::FinishGenerateAuthToken() { | 104 void HttpAuthHandler::FinishGenerateAuthToken() { |
105 // TOOD(cbentzel): Should this be done in OK case only? | 105 // TOOD(cbentzel): Should this be done in OK case only? |
106 net_log_.EndEvent(EventTypeFromAuthTarget(target_)); | 106 net_log_.EndEvent(EventTypeFromAuthTarget(target_)); |
107 callback_.Reset(); | 107 callback_.Reset(); |
108 } | 108 } |
109 | 109 |
110 } // namespace net | 110 } // namespace net |
OLD | NEW |