| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/url_security_manager.h" | 5 #include "net/http/url_security_manager.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "net/http/http_auth_filter.h" | 9 #include "net/http/http_auth_filter.h" |
| 8 | 10 |
| 9 namespace net { | 11 namespace net { |
| 10 | 12 |
| 11 URLSecurityManagerWhitelist::URLSecurityManagerWhitelist() {} | 13 URLSecurityManagerWhitelist::URLSecurityManagerWhitelist() {} |
| 12 | 14 |
| 13 URLSecurityManagerWhitelist::~URLSecurityManagerWhitelist() {} | 15 URLSecurityManagerWhitelist::~URLSecurityManagerWhitelist() {} |
| 14 | 16 |
| 15 bool URLSecurityManagerWhitelist::CanUseDefaultCredentials( | 17 bool URLSecurityManagerWhitelist::CanUseDefaultCredentials( |
| 16 const GURL& auth_origin) const { | 18 const GURL& auth_origin) const { |
| 17 if (whitelist_default_.get()) | 19 if (whitelist_default_.get()) |
| 18 return whitelist_default_->IsValid(auth_origin, HttpAuth::AUTH_SERVER); | 20 return whitelist_default_->IsValid(auth_origin, HttpAuth::AUTH_SERVER); |
| 19 return false; | 21 return false; |
| 20 } | 22 } |
| 21 | 23 |
| 22 bool URLSecurityManagerWhitelist::CanDelegate(const GURL& auth_origin) const { | 24 bool URLSecurityManagerWhitelist::CanDelegate(const GURL& auth_origin) const { |
| 23 if (whitelist_delegate_.get()) | 25 if (whitelist_delegate_.get()) |
| 24 return whitelist_delegate_->IsValid(auth_origin, HttpAuth::AUTH_SERVER); | 26 return whitelist_delegate_->IsValid(auth_origin, HttpAuth::AUTH_SERVER); |
| 25 return false; | 27 return false; |
| 26 } | 28 } |
| 27 | 29 |
| 28 void URLSecurityManagerWhitelist::SetDefaultWhitelist( | 30 void URLSecurityManagerWhitelist::SetDefaultWhitelist( |
| 29 scoped_ptr<HttpAuthFilter> whitelist_default) { | 31 scoped_ptr<HttpAuthFilter> whitelist_default) { |
| 30 whitelist_default_ = whitelist_default.Pass(); | 32 whitelist_default_ = std::move(whitelist_default); |
| 31 } | 33 } |
| 32 | 34 |
| 33 void URLSecurityManagerWhitelist::SetDelegateWhitelist( | 35 void URLSecurityManagerWhitelist::SetDelegateWhitelist( |
| 34 scoped_ptr<HttpAuthFilter> whitelist_delegate) { | 36 scoped_ptr<HttpAuthFilter> whitelist_delegate) { |
| 35 whitelist_delegate_ = whitelist_delegate.Pass(); | 37 whitelist_delegate_ = std::move(whitelist_delegate); |
| 36 } | 38 } |
| 37 | 39 |
| 38 bool URLSecurityManagerWhitelist::HasDefaultWhitelist() const { | 40 bool URLSecurityManagerWhitelist::HasDefaultWhitelist() const { |
| 39 return whitelist_default_.get() != nullptr; | 41 return whitelist_default_.get() != nullptr; |
| 40 } | 42 } |
| 41 | 43 |
| 42 } // namespace net | 44 } // namespace net |
| OLD | NEW |