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

Unified Diff: google_apis/gcm/tools/mcs_probe.cc

Issue 1414313002: Allow dynamic updating of authentication policies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle conflicting Android Webview change 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: google_apis/gcm/tools/mcs_probe.cc
diff --git a/google_apis/gcm/tools/mcs_probe.cc b/google_apis/gcm/tools/mcs_probe.cc
index b2acc19750007db96aa0b624601433c1417858fb..2ddddd594446751eae7440d948b56e4292d87a8a 100644
--- a/google_apis/gcm/tools/mcs_probe.cc
+++ b/google_apis/gcm/tools/mcs_probe.cc
@@ -38,6 +38,8 @@
#include "net/cert/cert_verifier.h"
#include "net/dns/host_resolver.h"
#include "net/http/http_auth_handler_factory.h"
+#include "net/http/http_auth_preferences.h"
+#include "net/http/http_auth_scheme.h"
#include "net/http/http_network_session.h"
#include "net/http/http_server_properties_impl.h"
#include "net/http/transport_security_state.h"
@@ -183,6 +185,27 @@ class MyTestCertVerifier : public net::CertVerifier {
}
};
+class MCSProbeAuthPreferences : public net::HttpAuthPreferences {
+ public:
+ MCSProbeAuthPreferences()
+ : HttpAuthPreferences(std::vector<std::string>()
+#if defined(OS_POSIX) && !defined(OS_ANDROID)
+ ,
+ std::string()
+#endif
+ ) {
+ }
+ std::vector<std::string> AuthSchemes() const override {
+ return std::vector<std::string>(1, net::kBasicAuthScheme);
+ }
+ bool NegotiateDisableCnameLookup() const override { return false; }
+ bool NegotiateEnablePort() const override { return false; }
+ bool CanUseDefaultCredentials(const GURL& auth_origin) const override {
+ return false;
+ }
+ bool CanDelegate(const GURL& auth_origin) const override { return false; }
+};
+
class MCSProbe {
public:
MCSProbe(
@@ -225,7 +248,7 @@ class MCSProbe {
scoped_ptr<net::CertVerifier> cert_verifier_;
scoped_ptr<net::ChannelIDService> system_channel_id_service_;
scoped_ptr<net::TransportSecurityState> transport_security_state_;
- scoped_ptr<net::URLSecurityManager> url_security_manager_;
+ MCSProbeAuthPreferences http_auth_preferences;
asanka 2015/12/01 05:30:03 http_auth_preferences_
aberent 2015/12/01 14:33:25 Done.
scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory_;
scoped_ptr<net::HttpServerPropertiesImpl> http_server_properties_;
scoped_ptr<net::HostMappingRules> host_mapping_rules_;
@@ -376,10 +399,9 @@ void MCSProbe::InitializeNetworkState() {
base::WorkerPool::GetTaskRunner(true)));
transport_security_state_.reset(new net::TransportSecurityState());
- url_security_manager_.reset(net::URLSecurityManager::Create(NULL, NULL));
- http_auth_handler_factory_.reset(net::HttpAuthHandlerRegistryFactory::Create(
- std::vector<std::string>(1, "basic"), url_security_manager_.get(),
- host_resolver_.get(), std::string(), std::string(), false, false));
+ http_auth_handler_factory_ = net::HttpAuthHandlerRegistryFactory::Create(
+ &http_auth_preferences, host_resolver_.get())
+ .Pass();
http_server_properties_.reset(new net::HttpServerPropertiesImpl());
host_mapping_rules_.reset(new net::HostMappingRules());
proxy_service_ = net::ProxyService::CreateDirectWithNetLog(&net_log_);

Powered by Google App Engine
This is Rietveld 408576698