chore: bump chromium to 32e0bab929213da1019992bf31d29 (master) (#19488)

This commit is contained in:
Electron Bot 2019-08-02 16:56:46 -07:00 committed by Jeremy Apthorp
parent d0800aa200
commit e959137a4b
112 changed files with 524 additions and 5639 deletions

View file

@ -45,9 +45,7 @@
#include "shell/browser/api/atom_api_cookies.h"
#include "shell/browser/api/atom_api_download_item.h"
#include "shell/browser/api/atom_api_net_log.h"
#include "shell/browser/api/atom_api_protocol.h"
#include "shell/browser/api/atom_api_protocol_ns.h"
#include "shell/browser/api/atom_api_web_request.h"
#include "shell/browser/api/atom_api_web_request_ns.h"
#include "shell/browser/atom_browser_context.h"
#include "shell/browser/atom_browser_main_parts.h"
@ -122,15 +120,6 @@ uint32_t GetQuotaMask(const std::vector<std::string>& quota_types) {
return quota_mask;
}
void SetUserAgentInIO(scoped_refptr<net::URLRequestContextGetter> getter,
const std::string& accept_lang,
const std::string& user_agent) {
getter->GetURLRequestContext()->set_http_user_agent_settings(
new net::StaticHttpUserAgentSettings(
net::HttpUtil::GenerateAcceptLanguageHeader(accept_lang),
user_agent));
}
} // namespace
namespace mate {
@ -179,14 +168,6 @@ const char kPersistPrefix[] = "persist:";
// Referenced session objects.
std::map<uint32_t, v8::Global<v8::Object>> g_sessions;
void SetCertVerifyProcInIO(
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
const AtomCertVerifier::VerifyProc& proc) {
auto* request_context = context_getter->GetURLRequestContext();
static_cast<AtomCertVerifier*>(request_context->cert_verifier())
->SetVerifyProc(proc);
}
void DownloadIdCallback(content::DownloadManager* download_manager,
const base::FilePath& path,
const std::vector<GURL>& url_chain,
@ -472,26 +453,17 @@ void Session::SetCertVerifyProc(v8::Local<v8::Value> val,
return;
}
if (base::FeatureList::IsEnabled(network::features::kNetworkService)) {
network::mojom::CertVerifierClientPtr cert_verifier_client;
if (proc) {
mojo::MakeStrongBinding(
std::make_unique<ElectronCertVerifierClient>(proc),
mojo::MakeRequest(&cert_verifier_client));
}
content::BrowserContext::GetDefaultStoragePartition(browser_context_.get())
->GetNetworkContext()
->SetCertVerifierClient(std::move(cert_verifier_client));
// This causes the cert verifier cache to be cleared.
content::GetNetworkService()->OnCertDBChanged();
} else {
base::PostTaskWithTraits(
FROM_HERE, {BrowserThread::IO},
base::BindOnce(&SetCertVerifyProcInIO,
WrapRefCounted(browser_context_->GetRequestContext()),
base::BindRepeating(&WrapVerifyProc, proc)));
network::mojom::CertVerifierClientPtr cert_verifier_client;
if (proc) {
mojo::MakeStrongBinding(std::make_unique<ElectronCertVerifierClient>(proc),
mojo::MakeRequest(&cert_verifier_client));
}
content::BrowserContext::GetDefaultStoragePartition(browser_context_.get())
->GetNetworkContext()
->SetCertVerifierClient(std::move(cert_verifier_client));
// This causes the cert verifier cache to be cleared.
content::GetNetworkService()->OnCertDBChanged();
}
void Session::SetPermissionRequestHandler(v8::Local<v8::Value> val,
@ -563,22 +535,14 @@ v8::Local<v8::Promise> Session::ClearAuthCache() {
void Session::AllowNTLMCredentialsForDomains(const std::string& domains) {
auto auth_params = CreateHttpAuthDynamicParams();
auth_params->server_whitelist = domains;
auth_params->server_allowlist = domains;
content::GetNetworkService()->ConfigureHttpAuthPrefs(std::move(auth_params));
}
void Session::SetUserAgent(const std::string& user_agent,
mate::Arguments* args) {
browser_context_->SetUserAgent(user_agent);
std::string accept_lang = g_browser_process->GetApplicationLocale();
args->GetNext(&accept_lang);
scoped_refptr<net::URLRequestContextGetter> getter(
browser_context_->GetRequestContext());
getter->GetNetworkTaskRunner()->PostTask(
FROM_HERE,
base::BindOnce(&SetUserAgentInIO, getter, accept_lang, user_agent));
CHECK(false)
<< "TODO: This was disabled when the network service was turned on";
}
std::string Session::GetUserAgent() {
@ -661,10 +625,7 @@ v8::Local<v8::Value> Session::Cookies(v8::Isolate* isolate) {
v8::Local<v8::Value> Session::Protocol(v8::Isolate* isolate) {
if (protocol_.IsEmpty()) {
v8::Local<v8::Value> handle;
if (base::FeatureList::IsEnabled(network::features::kNetworkService))
handle = ProtocolNS::Create(isolate, browser_context()).ToV8();
else
handle = Protocol::Create(isolate, browser_context()).ToV8();
handle = ProtocolNS::Create(isolate, browser_context()).ToV8();
protocol_.Reset(isolate, handle);
}
return v8::Local<v8::Value>::New(isolate, protocol_);
@ -673,10 +634,7 @@ v8::Local<v8::Value> Session::Protocol(v8::Isolate* isolate) {
v8::Local<v8::Value> Session::WebRequest(v8::Isolate* isolate) {
if (web_request_.IsEmpty()) {
v8::Local<v8::Value> handle;
if (base::FeatureList::IsEnabled(network::features::kNetworkService))
handle = WebRequestNS::Create(isolate, browser_context()).ToV8();
else
handle = WebRequest::Create(isolate, browser_context()).ToV8();
handle = WebRequestNS::Create(isolate, browser_context()).ToV8();
web_request_.Reset(isolate, handle);
}
return v8::Local<v8::Value>::New(isolate, web_request_);
@ -774,7 +732,7 @@ namespace {
using electron::api::Cookies;
using electron::api::NetLog;
using electron::api::Protocol;
using electron::api::ProtocolNS;
using electron::api::Session;
v8::Local<v8::Value> FromPartition(const std::string& partition,
@ -803,9 +761,9 @@ void Initialize(v8::Local<v8::Object> exports,
dict.Set(
"NetLog",
NetLog::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
dict.Set(
"Protocol",
Protocol::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
dict.Set("Protocol", ProtocolNS::GetConstructor(isolate)
->GetFunction(context)
.ToLocalChecked());
dict.SetMethod("fromPartition", &FromPartition);
}