mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-24 06:16:30 +03:00
cronet: Add cert net fetcher
This commit is contained in:
parent
ce15c3dddc
commit
307679b200
@ -247,6 +247,10 @@ CronetContext::NetworkTasks::~NetworkTasks() {
|
|||||||
|
|
||||||
if (net::NetworkChangeNotifier::AreNetworkHandlesSupported())
|
if (net::NetworkChangeNotifier::AreNetworkHandlesSupported())
|
||||||
net::NetworkChangeNotifier::RemoveNetworkObserver(this);
|
net::NetworkChangeNotifier::RemoveNetworkObserver(this);
|
||||||
|
|
||||||
|
if (default_cert_net_fetcher_) {
|
||||||
|
default_cert_net_fetcher_->Shutdown();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CronetContext::InitRequestContextOnInitThread() {
|
void CronetContext::InitRequestContextOnInitThread() {
|
||||||
@ -423,6 +427,9 @@ CronetContext::NetworkTasks::BuildDefaultURLRequestContext(
|
|||||||
g_net_log.Get().net_log(), &context_builder);
|
g_net_log.Get().net_log(), &context_builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default_cert_net_fetcher_ = base::MakeRefCounted<net::CertNetFetcherURLRequest>();
|
||||||
|
context_builder.SetCertVerifier(net::CertVerifier::CreateDefault(default_cert_net_fetcher_));
|
||||||
|
|
||||||
auto context = context_builder.Build();
|
auto context = context_builder.Build();
|
||||||
|
|
||||||
// Set up host cache persistence if it's enabled. Happens after building the
|
// Set up host cache persistence if it's enabled. Happens after building the
|
||||||
@ -434,6 +441,8 @@ CronetContext::NetworkTasks::BuildDefaultURLRequestContext(
|
|||||||
g_net_log.Get().net_log());
|
g_net_log.Get().net_log());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default_cert_net_fetcher_->SetURLRequestContext(context.get());
|
||||||
|
|
||||||
SetSharedURLRequestContextConfig(context.get());
|
SetSharedURLRequestContextConfig(context.get());
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "components/prefs/json_pref_store.h"
|
#include "components/prefs/json_pref_store.h"
|
||||||
#include "net/base/network_change_notifier.h"
|
#include "net/base/network_change_notifier.h"
|
||||||
|
#include "net/cert_net/cert_net_fetcher_url_request.h"
|
||||||
#include "net/nqe/effective_connection_type.h"
|
#include "net/nqe/effective_connection_type.h"
|
||||||
#include "net/nqe/effective_connection_type_observer.h"
|
#include "net/nqe/effective_connection_type_observer.h"
|
||||||
#include "net/nqe/network_quality_estimator.h"
|
#include "net/nqe/network_quality_estimator.h"
|
||||||
@ -334,6 +335,9 @@ class CronetContext {
|
|||||||
base::flat_map<net::NetworkChangeNotifier::NetworkHandle,
|
base::flat_map<net::NetworkChangeNotifier::NetworkHandle,
|
||||||
std::unique_ptr<net::URLRequestContext>>
|
std::unique_ptr<net::URLRequestContext>>
|
||||||
contexts_;
|
contexts_;
|
||||||
|
|
||||||
|
scoped_refptr<net::CertNetFetcherURLRequest> default_cert_net_fetcher_;
|
||||||
|
|
||||||
// Shorthand for the default context (needed by
|
// Shorthand for the default context (needed by
|
||||||
// components/cronet/android/test/cronet_test_util.cc).
|
// components/cronet/android/test/cronet_test_util.cc).
|
||||||
raw_ptr<net::URLRequestContext> default_context_;
|
raw_ptr<net::URLRequestContext> default_context_;
|
||||||
|
Loading…
Reference in New Issue
Block a user