From aa7255bad5e77c21faa33e06f6013080e5ef82a3 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Mon, 17 Oct 2016 16:06:37 +0530 Subject: [PATCH] allow embedder to provide RequireCTDelegate --- brightray/browser/url_request_context_getter.cc | 7 +++++-- brightray/browser/url_request_context_getter.h | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index 57ca1f1b405..ad2838a8efe 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -267,9 +267,12 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { net::HttpAuthHandlerRegistryFactory::Create( http_auth_preferences_.get(), host_resolver.get()); + std::unique_ptr transport_security_state = + base::WrapUnique(new net::TransportSecurityState); + transport_security_state->SetRequireCTDelegate( + delegate_->GetRequireCTDelegate()); + storage_->set_transport_security_state(std::move(transport_security_state)); storage_->set_cert_verifier(delegate_->CreateCertVerifier()); - storage_->set_transport_security_state( - base::WrapUnique(new net::TransportSecurityState)); storage_->set_ssl_config_service(delegate_->CreateSSLConfigService()); storage_->set_http_auth_handler_factory(std::move(auth_handler_factory)); std::unique_ptr server_properties( diff --git a/brightray/browser/url_request_context_getter.h b/brightray/browser/url_request_context_getter.h index 1b10c2d75a1..88fdc392b90 100644 --- a/brightray/browser/url_request_context_getter.h +++ b/brightray/browser/url_request_context_getter.h @@ -10,6 +10,7 @@ #include "content/public/browser/content_browser_client.h" #include "net/cookies/cookie_monster.h" #include "net/http/http_cache.h" +#include "net/http/transport_security_state.h" #include "net/http/url_security_manager.h" #include "net/url_request/url_request_context_getter.h" @@ -52,6 +53,10 @@ class URLRequestContextGetter : public net::URLRequestContextGetter { virtual std::unique_ptr CreateCertVerifier(); virtual net::SSLConfigService* CreateSSLConfigService(); virtual std::vector GetCookieableSchemes(); + virtual net::TransportSecurityState::RequireCTDelegate* + GetRequireCTDelegate() { + return nullptr; + } }; URLRequestContextGetter(