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_controller.h" | 5 #include "net/http/http_auth_controller.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 identity_.source = HttpAuth::IDENT_SRC_URL; | 458 identity_.source = HttpAuth::IDENT_SRC_URL; |
459 identity_.invalid = false; | 459 identity_.invalid = false; |
460 // Extract the username:password from the URL. | 460 // Extract the username:password from the URL. |
461 string16 username; | 461 string16 username; |
462 string16 password; | 462 string16 password; |
463 GetIdentityFromURL(auth_url_, &username, &password); | 463 GetIdentityFromURL(auth_url_, &username, &password); |
464 identity_.credentials.Set(username, password); | 464 identity_.credentials.Set(username, password); |
465 embedded_identity_used_ = true; | 465 embedded_identity_used_ = true; |
466 // TODO(eroman): If the password is blank, should we also try combining | 466 // TODO(eroman): If the password is blank, should we also try combining |
467 // with a password from the cache? | 467 // with a password from the cache? |
| 468 UMA_HISTOGRAM_BOOLEAN("net.HTTPIdentSrcURL", true); |
468 return true; | 469 return true; |
469 } | 470 } |
470 | 471 |
471 // Check the auth cache for a realm entry. | 472 // Check the auth cache for a realm entry. |
472 HttpAuthCache::Entry* entry = | 473 HttpAuthCache::Entry* entry = |
473 http_auth_cache_->Lookup(auth_origin_, handler_->realm(), | 474 http_auth_cache_->Lookup(auth_origin_, handler_->realm(), |
474 handler_->auth_scheme()); | 475 handler_->auth_scheme()); |
475 | 476 |
476 if (entry) { | 477 if (entry) { |
477 identity_.source = HttpAuth::IDENT_SRC_REALM_LOOKUP; | 478 identity_.source = HttpAuth::IDENT_SRC_REALM_LOOKUP; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 DCHECK(CalledOnValidThread()); | 559 DCHECK(CalledOnValidThread()); |
559 return disabled_schemes_.find(scheme) != disabled_schemes_.end(); | 560 return disabled_schemes_.find(scheme) != disabled_schemes_.end(); |
560 } | 561 } |
561 | 562 |
562 void HttpAuthController::DisableAuthScheme(HttpAuth::Scheme scheme) { | 563 void HttpAuthController::DisableAuthScheme(HttpAuth::Scheme scheme) { |
563 DCHECK(CalledOnValidThread()); | 564 DCHECK(CalledOnValidThread()); |
564 disabled_schemes_.insert(scheme); | 565 disabled_schemes_.insert(scheme); |
565 } | 566 } |
566 | 567 |
567 } // namespace net | 568 } // namespace net |
OLD | NEW |