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_negotiate.h" | 5 #include "net/http/http_auth_handler_negotiate.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 "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 if (rv != OK) | 54 if (rv != OK) |
55 return rv; | 55 return rv; |
56 } | 56 } |
57 // TODO(cbentzel): Move towards model of parsing in the factory | 57 // TODO(cbentzel): Move towards model of parsing in the factory |
58 // method and only constructing when valid. | 58 // method and only constructing when valid. |
59 scoped_ptr<HttpAuthHandler> tmp_handler( | 59 scoped_ptr<HttpAuthHandler> tmp_handler( |
60 new HttpAuthHandlerNegotiate(auth_library_.get(), max_token_length_, | 60 new HttpAuthHandlerNegotiate(auth_library_.get(), max_token_length_, |
61 url_security_manager(), resolver_, | 61 url_security_manager(), resolver_, |
62 disable_cname_lookup_, use_port_)); | 62 disable_cname_lookup_, use_port_)); |
63 #elif defined(OS_ANDROID) | 63 #elif defined(OS_ANDROID) |
64 if (is_unsupported_ || auth_library_->empty() || reason == CREATE_PREEMPTIVE) | 64 if (is_unsupported_ || !auth_library_ || auth_library_->empty() || |
| 65 reason == CREATE_PREEMPTIVE) |
65 return ERR_UNSUPPORTED_AUTH_SCHEME; | 66 return ERR_UNSUPPORTED_AUTH_SCHEME; |
66 // TODO(cbentzel): Move towards model of parsing in the factory | 67 // TODO(cbentzel): Move towards model of parsing in the factory |
67 // method and only constructing when valid. | 68 // method and only constructing when valid. |
68 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNegotiate( | 69 scoped_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerNegotiate( |
69 auth_library_.get(), url_security_manager(), resolver_, | 70 auth_library_.get(), url_security_manager(), resolver_, |
70 disable_cname_lookup_, use_port_)); | 71 disable_cname_lookup_, use_port_)); |
71 #elif defined(OS_POSIX) | 72 #elif defined(OS_POSIX) |
72 if (is_unsupported_) | 73 if (is_unsupported_) |
73 return ERR_UNSUPPORTED_AUTH_SCHEME; | 74 return ERR_UNSUPPORTED_AUTH_SCHEME; |
74 if (!auth_library_->Init()) { | 75 if (!auth_library_->Init()) { |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 bool HttpAuthHandlerNegotiate::CanDelegate() const { | 336 bool HttpAuthHandlerNegotiate::CanDelegate() const { |
336 // TODO(cbentzel): Should delegation be allowed on proxies? | 337 // TODO(cbentzel): Should delegation be allowed on proxies? |
337 if (target_ == HttpAuth::AUTH_PROXY) | 338 if (target_ == HttpAuth::AUTH_PROXY) |
338 return false; | 339 return false; |
339 if (!url_security_manager_) | 340 if (!url_security_manager_) |
340 return false; | 341 return false; |
341 return url_security_manager_->CanDelegate(origin_); | 342 return url_security_manager_->CanDelegate(origin_); |
342 } | 343 } |
343 | 344 |
344 } // namespace net | 345 } // namespace net |
OLD | NEW |