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

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: Respond to cbentzel@'s comments. Created 5 years 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
« no previous file with comments | « net/http/url_security_manager_unittest.cc ('k') | net/net.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9872595a65d61ffbc18c79fd02f59be0db4da3d9 100644
--- a/net/http/url_security_manager_win.cc
+++ b/net/http/url_security_manager_win.cc
@@ -26,30 +26,29 @@
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())
+ return URLSecurityManagerWhitelist::CanUseDefaultCredentials(auth_origin);
if (!const_cast<URLSecurityManagerWin*>(this)->EnsureSystemSecurityManager())
return false;
@@ -101,14 +100,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 +116,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
« no previous file with comments | « net/http/url_security_manager_unittest.cc ('k') | net/net.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698