OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_basic.h" | 5 #include "net/http/http_auth_handler_basic.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 HttpAuthHandlerBasic::Factory::Factory() { | 102 HttpAuthHandlerBasic::Factory::Factory() { |
103 } | 103 } |
104 | 104 |
105 HttpAuthHandlerBasic::Factory::~Factory() { | 105 HttpAuthHandlerBasic::Factory::~Factory() { |
106 } | 106 } |
107 | 107 |
108 int HttpAuthHandlerBasic::Factory::CreateAuthHandler( | 108 int HttpAuthHandlerBasic::Factory::CreateAuthHandler( |
109 HttpAuthChallengeTokenizer* challenge, | 109 HttpAuthChallengeTokenizer* challenge, |
110 HttpAuth::Target target, | 110 HttpAuth::Target target, |
111 const GURL& origin, | 111 const url::Origin& origin, |
112 CreateReason reason, | 112 CreateReason reason, |
113 int digest_nonce_count, | 113 int digest_nonce_count, |
114 const BoundNetLog& net_log, | 114 const BoundNetLog& net_log, |
115 scoped_ptr<HttpAuthHandler>* handler) { | 115 scoped_ptr<HttpAuthHandler>* handler) { |
116 // TODO(cbentzel): Move towards model of parsing in the factory | 116 // TODO(cbentzel): Move towards model of parsing in the factory |
117 // method and only constructing when valid. | 117 // method and only constructing when valid. |
118 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerBasic()); | 118 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerBasic()); |
119 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log)) | 119 if (!tmp_handler->InitFromChallenge(challenge, target, origin, net_log)) |
120 return ERR_INVALID_RESPONSE; | 120 return ERR_INVALID_RESPONSE; |
121 handler->swap(tmp_handler); | 121 handler->swap(tmp_handler); |
122 return OK; | 122 return OK; |
123 } | 123 } |
124 | 124 |
125 } // namespace net | 125 } // namespace net |
OLD | NEW |