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

Unified Diff: net/http/url_security_manager.h

Issue 1414313002: Allow dynamic updating of authentication policies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missing Chromeos includes Created 5 years, 1 month 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.h
diff --git a/net/http/url_security_manager.h b/net/http/url_security_manager.h
index c0d93a23296cd0510dd839073b1ed2b028ab6b48..4a60bd2fa637ca734bee8f33014eb35898e549e2 100644
--- a/net/http/url_security_manager.h
+++ b/net/http/url_security_manager.h
@@ -8,13 +8,12 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
+#include "net/http/http_auth_filter.h"
class GURL;
namespace net {
-class HttpAuthFilter;
-
// The URL security manager controls the policies (allow, deny, prompt user)
// regarding URL actions (e.g., sending the default credentials to a server).
class NET_EXPORT URLSecurityManager {
@@ -41,8 +40,7 @@ class NET_EXPORT URLSecurityManager {
//
// TODO(cbentzel): Perhaps it's better to make a non-abstract HttpAuthFilter
asanka 2015/11/04 16:05:44 Might as well remove this comment since it no long
aberent 2015/11/06 13:57:34 Done. Actually rewrote the whole comment.
// and just copy into the URLSecurityManager?
- static URLSecurityManager* Create(const HttpAuthFilter* whitelist_default,
- const HttpAuthFilter* whitelist_delegate);
+ static URLSecurityManager* Create();
// Returns true if we can send the default credentials to the server at
// |auth_origin| for HTTP NTLM or Negotiate authentication.
@@ -52,20 +50,30 @@ class NET_EXPORT URLSecurityManager {
// |auth_origin| for HTTP Negotiate authentication.
virtual bool CanDelegate(const GURL& auth_origin) const = 0;
+ virtual void SetDefaultWhitelist(
+ scoped_ptr<HttpAuthFilter> whitelist_default) = 0;
+ virtual void SetDelegateWhitelist(
+ scoped_ptr<HttpAuthFilter> whitelist_delegate) = 0;
+
private:
DISALLOW_COPY_AND_ASSIGN(URLSecurityManager);
};
class URLSecurityManagerWhitelist : public URLSecurityManager {
public:
- // The URLSecurityManagerWhitelist takes ownership of the whitelists.
- URLSecurityManagerWhitelist(const HttpAuthFilter* whitelist_default,
- const HttpAuthFilter* whitelist_delegation);
+ URLSecurityManagerWhitelist();
~URLSecurityManagerWhitelist() override;
// URLSecurityManager methods.
bool CanUseDefaultCredentials(const GURL& auth_origin) const override;
bool CanDelegate(const GURL& auth_origin) const override;
+ void SetDefaultWhitelist(
+ scoped_ptr<HttpAuthFilter> whitelist_default) override;
+ void SetDelegateWhitelist(
+ scoped_ptr<HttpAuthFilter> whitelist_delegate) override;
+
+ protected:
+ bool HasDefaultWhitelist() const;
private:
scoped_ptr<const HttpAuthFilter> whitelist_default_;

Powered by Google App Engine
This is Rietveld 408576698