| 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/profiler/scoped_tracker.h" | |
| 11 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 12 #include "net/base/address_family.h" | 11 #include "net/base/address_family.h" |
| 13 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 14 #include "net/dns/host_resolver.h" | 13 #include "net/dns/host_resolver.h" |
| 15 #include "net/dns/single_request_host_resolver.h" | 14 #include "net/dns/single_request_host_resolver.h" |
| 16 #include "net/http/http_auth_filter.h" | 15 #include "net/http/http_auth_filter.h" |
| 17 #include "net/http/url_security_manager.h" | 16 #include "net/http/url_security_manager.h" |
| 18 | 17 |
| 19 namespace net { | 18 namespace net { |
| 20 | 19 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 225 } |
| 227 next_state_ = STATE_RESOLVE_CANONICAL_NAME; | 226 next_state_ = STATE_RESOLVE_CANONICAL_NAME; |
| 228 } | 227 } |
| 229 int rv = DoLoop(OK); | 228 int rv = DoLoop(OK); |
| 230 if (rv == ERR_IO_PENDING) | 229 if (rv == ERR_IO_PENDING) |
| 231 callback_ = callback; | 230 callback_ = callback; |
| 232 return rv; | 231 return rv; |
| 233 } | 232 } |
| 234 | 233 |
| 235 void HttpAuthHandlerNegotiate::OnIOComplete(int result) { | 234 void HttpAuthHandlerNegotiate::OnIOComplete(int result) { |
| 236 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436634 is fixed. | |
| 237 tracked_objects::ScopedTracker tracking_profile( | |
| 238 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
| 239 "436634 HttpAuthHandlerNegotiate::OnIOComplete")); | |
| 240 | |
| 241 int rv = DoLoop(result); | 235 int rv = DoLoop(result); |
| 242 if (rv != ERR_IO_PENDING) | 236 if (rv != ERR_IO_PENDING) |
| 243 DoCallback(rv); | 237 DoCallback(rv); |
| 244 } | 238 } |
| 245 | 239 |
| 246 void HttpAuthHandlerNegotiate::DoCallback(int rv) { | 240 void HttpAuthHandlerNegotiate::DoCallback(int rv) { |
| 247 DCHECK(rv != ERR_IO_PENDING); | 241 DCHECK(rv != ERR_IO_PENDING); |
| 248 DCHECK(!callback_.is_null()); | 242 DCHECK(!callback_.is_null()); |
| 249 CompletionCallback callback = callback_; | 243 CompletionCallback callback = callback_; |
| 250 callback_.Reset(); | 244 callback_.Reset(); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 bool HttpAuthHandlerNegotiate::CanDelegate() const { | 328 bool HttpAuthHandlerNegotiate::CanDelegate() const { |
| 335 // TODO(cbentzel): Should delegation be allowed on proxies? | 329 // TODO(cbentzel): Should delegation be allowed on proxies? |
| 336 if (target_ == HttpAuth::AUTH_PROXY) | 330 if (target_ == HttpAuth::AUTH_PROXY) |
| 337 return false; | 331 return false; |
| 338 if (!url_security_manager_) | 332 if (!url_security_manager_) |
| 339 return false; | 333 return false; |
| 340 return url_security_manager_->CanDelegate(origin_); | 334 return url_security_manager_->CanDelegate(origin_); |
| 341 } | 335 } |
| 342 | 336 |
| 343 } // namespace net | 337 } // namespace net |
| OLD | NEW |