Chromium Code Reviews| Index: net/http/url_security_manager_win.cc |
| diff --git a/net/http/url_security_manager_win.cc b/net/http/url_security_manager_win.cc |
| index b0dcaa0beb80be7c8ae87f70d50167544acb8100..f51ce40daab5f9ecab866a8c5db2c7430af18216 100644 |
| --- a/net/http/url_security_manager_win.cc |
| +++ b/net/http/url_security_manager_win.cc |
| @@ -26,30 +26,30 @@ |
| namespace net { |
| -class URLSecurityManagerWin : public URLSecurityManager { |
| +class URLSecurityManagerWin : public URLSecurityManagerWhitelist { |
| public: |
| - explicit URLSecurityManagerWin(const HttpAuthFilter* whitelist_delegate); |
| + URLSecurityManagerWin(); |
| + ~URLSecurityManagerWin() override; |
| // URLSecurityManager methods: |
| bool CanUseDefaultCredentials(const GURL& auth_origin) const override; |
| - bool CanDelegate(const GURL& auth_origin) const override; |
| private: |
| bool EnsureSystemSecurityManager(); |
| base::win::ScopedComPtr<IInternetSecurityManager> security_manager_; |
| - scoped_ptr<const HttpAuthFilter> whitelist_delegate_; |
| DISALLOW_COPY_AND_ASSIGN(URLSecurityManagerWin); |
| }; |
| -URLSecurityManagerWin::URLSecurityManagerWin( |
| - const HttpAuthFilter* whitelist_delegate) |
| - : whitelist_delegate_(whitelist_delegate) { |
| -} |
| +URLSecurityManagerWin::URLSecurityManagerWin() {} |
| +URLSecurityManagerWin::~URLSecurityManagerWin() {} |
| bool URLSecurityManagerWin::CanUseDefaultCredentials( |
| const GURL& auth_origin) const { |
| + if (HasDefaultWhitelist()) { |
|
asanka
2015/11/10 15:48:06
Nit: no braces.
|
| + return URLSecurityManagerWhitelist::CanUseDefaultCredentials(auth_origin); |
| + } |
| if (!const_cast<URLSecurityManagerWin*>(this)->EnsureSystemSecurityManager()) |
| return false; |
| @@ -101,14 +101,7 @@ bool URLSecurityManagerWin::CanUseDefaultCredentials( |
| return false; |
| } |
| } |
| - |
| -bool URLSecurityManagerWin::CanDelegate(const GURL& auth_origin) const { |
| - // TODO(cbentzel): Could this just use the security zone as well? Apparently |
| - // this is what IE does as well. |
| - if (whitelist_delegate_.get()) |
| - return whitelist_delegate_->IsValid(auth_origin, HttpAuth::AUTH_SERVER); |
| - return false; |
| -} |
| +// TODO(cbentzel): Could CanDelegate use the security zone as well? |
| bool URLSecurityManagerWin::EnsureSystemSecurityManager() { |
| if (!security_manager_.get()) { |
| @@ -124,14 +117,8 @@ bool URLSecurityManagerWin::EnsureSystemSecurityManager() { |
| } |
| // static |
| -URLSecurityManager* URLSecurityManager::Create( |
| - const HttpAuthFilter* whitelist_default, |
| - const HttpAuthFilter* whitelist_delegate) { |
| - // If we have a whitelist, just use that. |
| - if (whitelist_default) |
| - return new URLSecurityManagerWhitelist(whitelist_default, |
| - whitelist_delegate); |
| - return new URLSecurityManagerWin(whitelist_delegate); |
| +URLSecurityManager* URLSecurityManager::Create() { |
| + return new URLSecurityManagerWin; |
| } |
| } // namespace net |