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

Side by Side Diff: net/http/url_security_manager.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 unified diff | Download patch
« no previous file with comments | « net/http/url_security_manager.h ('k') | net/http/url_security_manager_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/http/http_auth_filter.h" 7 #include "net/http/http_auth_filter.h"
8 8
9 namespace net { 9 namespace net {
10 10
11 URLSecurityManagerWhitelist::URLSecurityManagerWhitelist( 11 URLSecurityManagerWhitelist::URLSecurityManagerWhitelist() {}
12 const HttpAuthFilter* whitelist_default,
13 const HttpAuthFilter* whitelist_delegate)
14 : whitelist_default_(whitelist_default),
15 whitelist_delegate_(whitelist_delegate) {
16 }
17 12
18 URLSecurityManagerWhitelist::~URLSecurityManagerWhitelist() {} 13 URLSecurityManagerWhitelist::~URLSecurityManagerWhitelist() {}
19 14
20 bool URLSecurityManagerWhitelist::CanUseDefaultCredentials( 15 bool URLSecurityManagerWhitelist::CanUseDefaultCredentials(
21 const GURL& auth_origin) const { 16 const GURL& auth_origin) const {
22 if (whitelist_default_.get()) 17 if (whitelist_default_.get())
23 return whitelist_default_->IsValid(auth_origin, HttpAuth::AUTH_SERVER); 18 return whitelist_default_->IsValid(auth_origin, HttpAuth::AUTH_SERVER);
24 return false; 19 return false;
25 } 20 }
26 21
27 bool URLSecurityManagerWhitelist::CanDelegate(const GURL& auth_origin) const { 22 bool URLSecurityManagerWhitelist::CanDelegate(const GURL& auth_origin) const {
28 if (whitelist_delegate_.get()) 23 if (whitelist_delegate_.get())
29 return whitelist_delegate_->IsValid(auth_origin, HttpAuth::AUTH_SERVER); 24 return whitelist_delegate_->IsValid(auth_origin, HttpAuth::AUTH_SERVER);
30 return false; 25 return false;
31 } 26 }
32 27
28 void URLSecurityManagerWhitelist::SetDefaultWhitelist(
29 scoped_ptr<HttpAuthFilter> whitelist_default) {
30 whitelist_default_ = whitelist_default.Pass();
31 }
32
33 void URLSecurityManagerWhitelist::SetDelegateWhitelist(
34 scoped_ptr<HttpAuthFilter> whitelist_delegate) {
35 whitelist_delegate_ = whitelist_delegate.Pass();
36 }
37
38 bool URLSecurityManagerWhitelist::HasDefaultWhitelist() const {
39 return whitelist_default_.get() != nullptr;
40 }
41
33 } // namespace net 42 } // namespace net
OLDNEW
« no previous file with comments | « net/http/url_security_manager.h ('k') | net/http/url_security_manager_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698