Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: net/http/url_security_manager_win.cc

Issue 1414313002: Allow dynamic updating of authentication policies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various build problems detected on bots. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..34ece8205613d1b5395328f811637393825cda25 100644
--- a/net/http/url_security_manager_win.cc
+++ b/net/http/url_security_manager_win.cc
@@ -26,30 +26,32 @@
namespace net {
-class URLSecurityManagerWin : public URLSecurityManager {
+class URLSecurityManagerWin : public URLSecurityManagerWhitelist {
public:
- explicit URLSecurityManagerWin(const HttpAuthFilter* whitelist_delegate);
+ URLSecurityManagerWin(const HttpAuthFilter* whitelist_default,
+ const HttpAuthFilter* whitelist_delegate);
// 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_default,
const HttpAuthFilter* whitelist_delegate)
- : whitelist_delegate_(whitelist_delegate) {
-}
+ : URLSecurityManagerWhitelist(whitelist_default, whitelist_delegate) {}
bool URLSecurityManagerWin::CanUseDefaultCredentials(
const GURL& auth_origin) const {
+ if (HasDefaultWhitelist()) {
+ return URLSecurityManagerWhitelist::CanUseDefaultCredentials(auth_origin);
+ }
if (!const_cast<URLSecurityManagerWin*>(this)->EnsureSystemSecurityManager())
return false;
@@ -101,14 +103,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()) {
@@ -128,10 +123,7 @@ 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);
+ return new URLSecurityManagerWin(whitelist_default, whitelist_delegate);
}
} // namespace net
« net/http/http_auth_handler_negotiate_unittest.cc ('K') | « net/http/url_security_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698