chore: bump chromium to 108.0.5355.0 (main) (#35900)

* chore: bump chromium in DEPS to 108.0.5339.0

* chore: bump chromium in DEPS to 108.0.5341.0

* chore: sync patch to unrelated upstream code shear

patches/chromium/network_service_allow_remote_certificate_verification_logic.patch

Xref: 3927793

* chore: sync patch to unrelated upstream code shear

patches/chromium/printing.patch

Xref: 3927793

* chore: sync patch to unrelated upstream code shear

patches/chromium/chore_add_electron_deps_to_gitignores.patch

Xref: 3906023

* chore: refresh patches - `e patches all`

* chore: remove unused parameter from WillCreateURLLoaderRequestInterceptors

Xref: 3932218

* perf: avoid unique pointer round trip

Xref: 3913938

* refactor: Simplify entropy provider management.

Xref: 3901211

* fixup! perf: avoid unique pointer round trip

* fixup! perf: avoid unique pointer round trip

* refactor: update typeof FileSelectHelper::select_file_dialog_

Xref: 3930092

* fixup! fixup! perf: avoid unique pointer round trip

* chore: bump chromium in DEPS to 108.0.5343.0

* chore: update patches

* chore: bump chromium in DEPS to 108.0.5345.0

* chore: bump chromium in DEPS to 108.0.5347.0

* chore: bump chromium in DEPS to 108.0.5349.0

* chore: bump chromium in DEPS to 108.0.5351.0

* chore: bump chromium in DEPS to 108.0.5353.0

* chore: bump chromium in DEPS to 108.0.5355.0

* chore: update patches

* Refactor display::win::DisplayInfo to display::win::internal::DisplayInfo

Refs 3929014

* Update proxy resolution to use NAK - Part 2

Refs 3934016

* Disable PreconnectManager when the user disabled preloading.

Refs 3928470
Refs 3937183

* chore: update patches

* chore: update sysroot

* linux: Remove breakpad integration

Refs 3764621

* chore: update comments

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: electron-patch-conflict-fixer[bot] <83340002+electron-patch-conflict-fixer[bot]@users.noreply.github.com>
This commit is contained in:
electron-roller[bot] 2022-10-17 10:22:24 -04:00 committed by GitHub
parent bcafe8f654
commit f2c341b655
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
95 changed files with 484 additions and 1001 deletions

View file

@ -58,7 +58,6 @@
#if BUILDFLAG(IS_LINUX)
#include "base/nix/xdg_util.h"
#include "components/crash/core/app/breakpad_linux.h"
#include "v8/include/v8-wasm-trap-handler-posix.h"
#include "v8/include/v8.h"
#endif
@ -372,15 +371,11 @@ void ElectronMainDelegate::PreSandboxStartup() {
// Zygote needs to call InitCrashReporter() in RunZygote().
if (process_type != ::switches::kZygoteProcess && !process_type.empty()) {
ElectronCrashReporterClient::Create();
if (crash_reporter::IsCrashpadEnabled()) {
if (command_line->HasSwitch(
crash_reporter::switches::kCrashpadHandlerPid)) {
crash_reporter::InitializeCrashpad(false, process_type);
crash_reporter::SetFirstChanceExceptionHandler(
v8::TryHandleWebAssemblyTrapPosix);
}
} else {
breakpad::InitCrashReporter(process_type);
if (command_line->HasSwitch(
crash_reporter::switches::kCrashpadHandlerPid)) {
crash_reporter::InitializeCrashpad(false, process_type);
crash_reporter::SetFirstChanceExceptionHandler(
v8::TryHandleWebAssemblyTrapPosix);
}
}
#endif
@ -503,15 +498,10 @@ void ElectronMainDelegate::ZygoteForked() {
base::CommandLine::ForCurrentProcess();
std::string process_type =
command_line->GetSwitchValueASCII(::switches::kProcessType);
if (crash_reporter::IsCrashpadEnabled()) {
if (command_line->HasSwitch(
crash_reporter::switches::kCrashpadHandlerPid)) {
crash_reporter::InitializeCrashpad(false, process_type);
crash_reporter::SetFirstChanceExceptionHandler(
v8::TryHandleWebAssemblyTrapPosix);
}
} else {
breakpad::InitCrashReporter(process_type);
if (command_line->HasSwitch(crash_reporter::switches::kCrashpadHandlerPid)) {
crash_reporter::InitializeCrashpad(false, process_type);
crash_reporter::SetFirstChanceExceptionHandler(
v8::TryHandleWebAssemblyTrapPosix);
}
// Reset the command line for the newly spawned process.

View file

@ -37,9 +37,5 @@ int main(int argc, char* argv[]) {
params.argc = argc;
params.argv = const_cast<const char**>(argv);
base::CommandLine::Init(params.argc, params.argv);
// TODO(https://crbug.com/1176772): Remove when Chrome Linux is fully migrated
// to Crashpad.
base::CommandLine::ForCurrentProcess()->AppendSwitch(
::switches::kEnableCrashpad);
return content::ContentMain(std::move(params));
}

View file

@ -30,10 +30,6 @@
#include "shell/common/node_bindings.h"
#include "shell/common/node_includes.h"
#if BUILDFLAG(IS_LINUX)
#include "components/crash/core/app/breakpad_linux.h"
#endif
#if BUILDFLAG(IS_WIN)
#include "chrome/child/v8_crashpad_support_win.h"
#endif
@ -41,7 +37,6 @@
#if !defined(MAS_BUILD)
#include "components/crash/core/app/crashpad.h" // nogncheck
#include "shell/app/electron_crash_reporter_client.h"
#include "shell/browser/api/electron_api_crash_reporter.h"
#include "shell/common/crash_keys.h"
#endif
@ -100,35 +95,6 @@ void ClearCrashKeyStub(const std::string& key) {}
namespace electron {
#if BUILDFLAG(IS_LINUX)
void CrashReporterStart(gin_helper::Dictionary options) {
std::string submit_url;
bool upload_to_server = true;
bool ignore_system_crash_handler = false;
bool rate_limit = false;
bool compress = false;
std::map<std::string, std::string> global_extra;
std::map<std::string, std::string> extra;
options.Get("submitURL", &submit_url);
options.Get("uploadToServer", &upload_to_server);
options.Get("ignoreSystemCrashHandler", &ignore_system_crash_handler);
options.Get("rateLimit", &rate_limit);
options.Get("compress", &compress);
options.Get("extra", &extra);
options.Get("globalExtra", &global_extra);
std::string product_name;
if (options.Get("productName", &product_name))
global_extra["_productName"] = product_name;
std::string company_name;
if (options.Get("companyName", &company_name))
global_extra["_companyName"] = company_name;
api::crash_reporter::Start(submit_url, upload_to_server,
ignore_system_crash_handler, rate_limit, compress,
global_extra, extra, true);
}
#endif
v8::Local<v8::Value> GetParameters(v8::Isolate* isolate) {
std::map<std::string, std::string> keys;
#if !defined(MAS_BUILD)
@ -144,15 +110,12 @@ int NodeMain(int argc, char* argv[]) {
v8_crashpad_support::SetUp();
#endif
#if !defined(MAS_BUILD)
ElectronCrashReporterClient::Create();
#endif
// TODO(deepak1556): Enable crashpad support on linux for
// ELECTRON_RUN_AS_NODE processes.
// Refs https://github.com/electron/electron/issues/36030
#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_MAC) && !defined(MAS_BUILD))
ElectronCrashReporterClient::Create();
crash_reporter::InitializeCrashpad(false, "node");
#endif
#if !defined(MAS_BUILD)
crash_keys::SetCrashKeysFromCommandLine(
*base::CommandLine::ForCurrentProcess());
crash_keys::SetPlatformCrashKey();
@ -225,10 +188,6 @@ int NodeMain(int argc, char* argv[]) {
// Setup process.crashReporter in child node processes
gin_helper::Dictionary reporter = gin::Dictionary::CreateEmpty(isolate);
#if BUILDFLAG(IS_LINUX)
reporter.SetMethod("start", &CrashReporterStart);
#endif
reporter.SetMethod("getParameters", &GetParameters);
#if defined(MAS_BUILD)
reporter.SetMethod("addExtraParameter", &SetCrashKeyStub);

View file

@ -43,7 +43,6 @@
#include "base/containers/span.h"
#include "base/files/file_util.h"
#include "base/guid.h"
#include "components/crash/core/app/breakpad_linux.h"
#include "components/crash/core/common/crash_keys.h"
#include "components/upload_list/combining_upload_list.h"
#include "v8/include/v8-wasm-trap-handler-posix.h"
@ -149,28 +148,15 @@ void Start(const std::string& submit_url,
? "node"
: command_line->GetSwitchValueASCII(::switches::kProcessType);
#if BUILDFLAG(IS_LINUX)
if (::crash_reporter::IsCrashpadEnabled()) {
for (const auto& pair : extra)
electron::crash_keys::SetCrashKey(pair.first, pair.second);
{
base::ThreadRestrictions::ScopedAllowIO allow_io;
::crash_reporter::InitializeCrashpad(process_type.empty(), process_type);
}
if (ignore_system_crash_handler) {
crashpad::CrashpadInfo::GetCrashpadInfo()
->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled);
}
} else {
::crash_keys::SetMetricsClientIdFromGUID(GetClientId());
auto& global_crash_keys = GetGlobalCrashKeysMutable();
for (const auto& pair : global_extra) {
global_crash_keys[pair.first] = pair.second;
}
for (const auto& pair : extra)
electron::crash_keys::SetCrashKey(pair.first, pair.second);
for (const auto& pair : global_extra)
electron::crash_keys::SetCrashKey(pair.first, pair.second);
breakpad::InitCrashReporter(process_type);
for (const auto& pair : extra)
electron::crash_keys::SetCrashKey(pair.first, pair.second);
{
base::ThreadRestrictions::ScopedAllowIO allow_io;
::crash_reporter::InitializeCrashpad(process_type.empty(), process_type);
}
if (ignore_system_crash_handler) {
crashpad::CrashpadInfo::GetCrashpadInfo()
->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled);
}
#elif BUILDFLAG(IS_MAC)
for (const auto& pair : extra)
@ -213,17 +199,15 @@ scoped_refptr<UploadList> CreateCrashUploadList() {
crash_dir_path.AppendASCII(CrashUploadList::kReporterLogFilename);
scoped_refptr<UploadList> result =
base::MakeRefCounted<TextLogUploadList>(upload_log_path);
if (crash_reporter::IsCrashpadEnabled()) {
// Crashpad keeps the records of C++ crashes (segfaults, etc) in its
// internal database. The JavaScript error reporter writes JS error upload
// records to the older text format. Combine the two to present a complete
// list to the user.
// TODO(nornagon): what is "The JavaScript error reporter", and do we care
// about it?
std::vector<scoped_refptr<UploadList>> uploaders = {
base::MakeRefCounted<CrashUploadListCrashpad>(), std::move(result)};
result = base::MakeRefCounted<CombiningUploadList>(std::move(uploaders));
}
// Crashpad keeps the records of C++ crashes (segfaults, etc) in its
// internal database. The JavaScript error reporter writes JS error upload
// records to the older text format. Combine the two to present a complete
// list to the user.
// TODO(nornagon): what is "The JavaScript error reporter", and do we care
// about it?
std::vector<scoped_refptr<UploadList>> uploaders = {
base::MakeRefCounted<CrashUploadListCrashpad>(), std::move(result)};
result = base::MakeRefCounted<CombiningUploadList>(std::move(uploaders));
return result;
#endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
}

View file

@ -282,7 +282,7 @@ void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) {
base::UTF8ToWide(device_name.c_str(), device_name.size(),
&wide_device_name);
const int64_t device_id =
display::win::DisplayInfo::DeviceIdFromDeviceName(
display::win::internal::DisplayInfo::DeviceIdFromDeviceName(
wide_device_name.c_str());
source.display_id = base::NumberToString(device_id);
}

View file

@ -39,6 +39,7 @@
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "net/base/completion_repeating_callback.h"
#include "net/base/load_flags.h"
#include "net/base/network_anonymization_key.h"
#include "net/http/http_auth_handler_factory.h"
#include "net/http/http_auth_preferences.h"
#include "net/http/http_cache.h"
@ -99,23 +100,6 @@
using content::BrowserThread;
using content::StoragePartition;
namespace predictors {
// NOTE(nornagon): this is copied from
// //chrome/browser/predictors/resource_prefetch_predictor.cc we don't need
// anything in that file other than this constructor. Without it we get a link
// error. Probably upstream the constructor should be moved to
// preconnect_manager.cc.
PreconnectRequest::PreconnectRequest(
const url::Origin& origin,
int num_sockets,
const net::NetworkIsolationKey& network_isolation_key)
: origin(origin),
num_sockets(num_sockets),
network_isolation_key(network_isolation_key) {
DCHECK_GE(num_sockets, 0);
}
} // namespace predictors
namespace {
struct ClearStorageDataOptions {
@ -162,6 +146,30 @@ uint32_t GetQuotaMask(const std::vector<std::string>& quota_types) {
return quota_mask;
}
base::Value::Dict createProxyConfig(ProxyPrefs::ProxyMode proxy_mode,
std::string const& pac_url,
std::string const& proxy_server,
std::string const& bypass_list) {
if (proxy_mode == ProxyPrefs::MODE_DIRECT) {
return ProxyConfigDictionary::CreateDirect();
}
if (proxy_mode == ProxyPrefs::MODE_SYSTEM) {
return ProxyConfigDictionary::CreateSystem();
}
if (proxy_mode == ProxyPrefs::MODE_AUTO_DETECT) {
return ProxyConfigDictionary::CreateAutoDetect();
}
if (proxy_mode == ProxyPrefs::MODE_PAC_SCRIPT) {
const bool pac_mandatory = true;
return ProxyConfigDictionary::CreatePacScript(pac_url, pac_mandatory);
}
return ProxyConfigDictionary::CreateFixedServers(proxy_server, bypass_list);
}
} // namespace
namespace gin {
@ -517,26 +525,10 @@ v8::Local<v8::Promise> Session::SetProxy(gin::Arguments* args) {
}
}
std::unique_ptr<base::Value> proxy_config;
if (proxy_mode == ProxyPrefs::MODE_DIRECT) {
proxy_config =
std::make_unique<base::Value>(ProxyConfigDictionary::CreateDirect());
} else if (proxy_mode == ProxyPrefs::MODE_SYSTEM) {
proxy_config =
std::make_unique<base::Value>(ProxyConfigDictionary::CreateSystem());
} else if (proxy_mode == ProxyPrefs::MODE_AUTO_DETECT) {
proxy_config = std::make_unique<base::Value>(
ProxyConfigDictionary::CreateAutoDetect());
} else if (proxy_mode == ProxyPrefs::MODE_PAC_SCRIPT) {
proxy_config =
std::make_unique<base::Value>(ProxyConfigDictionary::CreatePacScript(
pac_url, true /* pac_mandatory */));
} else {
proxy_config = std::make_unique<base::Value>(
ProxyConfigDictionary::CreateFixedServers(proxy_rules, bypass_list));
}
browser_context_->in_memory_pref_store()->SetValue(
proxy_config::prefs::kProxy, std::move(proxy_config),
proxy_config::prefs::kProxy,
base::Value{
createProxyConfig(proxy_mode, pac_url, proxy_rules, bypass_list)},
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
base::ThreadTaskRunnerHandle::Get()->PostTask(
@ -955,7 +947,8 @@ static void StartPreconnectOnUI(ElectronBrowserContext* browser_context,
url::Origin origin = url::Origin::Create(url);
std::vector<predictors::PreconnectRequest> requests = {
{url::Origin::Create(url), num_sockets_to_preconnect,
net::NetworkIsolationKey(origin, origin)}};
net::NetworkAnonymizationKey(net::SchemefulSite(origin),
net::SchemefulSite(origin))}};
browser_context->GetPreconnectManager()->Start(url, requests);
}

View file

@ -54,33 +54,29 @@ void BrowserProcessImpl::ApplyProxyModeFromCommandLine(
auto* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kNoProxyServer)) {
pref_store->SetValue(
proxy_config::prefs::kProxy,
std::make_unique<base::Value>(ProxyConfigDictionary::CreateDirect()),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
pref_store->SetValue(proxy_config::prefs::kProxy,
base::Value(ProxyConfigDictionary::CreateDirect()),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
} else if (command_line->HasSwitch(switches::kProxyPacUrl)) {
std::string pac_script_url =
command_line->GetSwitchValueASCII(switches::kProxyPacUrl);
pref_store->SetValue(
proxy_config::prefs::kProxy,
std::make_unique<base::Value>(ProxyConfigDictionary::CreatePacScript(
pac_script_url, false /* pac_mandatory */)),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
pref_store->SetValue(proxy_config::prefs::kProxy,
base::Value(ProxyConfigDictionary::CreatePacScript(
pac_script_url, false /* pac_mandatory */)),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
} else if (command_line->HasSwitch(switches::kProxyAutoDetect)) {
pref_store->SetValue(proxy_config::prefs::kProxy,
std::make_unique<base::Value>(
ProxyConfigDictionary::CreateAutoDetect()),
base::Value(ProxyConfigDictionary::CreateAutoDetect()),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
} else if (command_line->HasSwitch(switches::kProxyServer)) {
std::string proxy_server =
command_line->GetSwitchValueASCII(switches::kProxyServer);
std::string bypass_list =
command_line->GetSwitchValueASCII(switches::kProxyBypassList);
pref_store->SetValue(
proxy_config::prefs::kProxy,
std::make_unique<base::Value>(ProxyConfigDictionary::CreateFixedServers(
proxy_server, bypass_list)),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
pref_store->SetValue(proxy_config::prefs::kProxy,
base::Value(ProxyConfigDictionary::CreateFixedServers(
proxy_server, bypass_list)),
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
}
}

View file

@ -186,10 +186,7 @@
#include "content/public/common/child_process_host.h"
#endif
#if BUILDFLAG(IS_LINUX) && !defined(MAS_BUILD)
#include "base/debug/leak_annotations.h"
#include "components/crash/content/browser/crash_handler_host_linux.h"
#include "components/crash/core/app/breakpad_linux.h" // nogncheck
#if BUILDFLAG(IS_LINUX)
#include "components/crash/core/app/crash_switches.h" // nogncheck
#include "components/crash/core/app/crashpad.h" // nogncheck
#endif
@ -308,67 +305,9 @@ const extensions::Extension* GetEnabledExtensionFromEffectiveURL(
#endif // BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
#if BUILDFLAG(IS_LINUX)
breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost(
const std::string& process_type) {
base::FilePath dumps_path;
base::PathService::Get(electron::DIR_CRASH_DUMPS, &dumps_path);
{
ANNOTATE_SCOPED_MEMORY_LEAK;
bool upload = ElectronCrashReporterClient::Get()->GetCollectStatsConsent();
breakpad::CrashHandlerHostLinux* crash_handler =
new breakpad::CrashHandlerHostLinux(process_type, dumps_path, upload);
crash_handler->StartUploaderThread();
return crash_handler;
}
}
int GetCrashSignalFD(const base::CommandLine& command_line) {
if (crash_reporter::IsCrashpadEnabled()) {
int fd;
pid_t pid;
return crash_reporter::GetHandlerSocket(&fd, &pid) ? fd : -1;
}
// Extensions have the same process type as renderers.
if (command_line.HasSwitch(extensions::switches::kExtensionProcess)) {
static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler)
crash_handler = CreateCrashHandlerHost("extension");
return crash_handler->GetDeathSignalSocket();
}
std::string process_type =
command_line.GetSwitchValueASCII(::switches::kProcessType);
if (process_type == ::switches::kRendererProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler)
crash_handler = CreateCrashHandlerHost(process_type);
return crash_handler->GetDeathSignalSocket();
}
if (process_type == ::switches::kPpapiPluginProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler)
crash_handler = CreateCrashHandlerHost(process_type);
return crash_handler->GetDeathSignalSocket();
}
if (process_type == ::switches::kGpuProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler)
crash_handler = CreateCrashHandlerHost(process_type);
return crash_handler->GetDeathSignalSocket();
}
if (process_type == ::switches::kUtilityProcess) {
static breakpad::CrashHandlerHostLinux* crash_handler = nullptr;
if (!crash_handler)
crash_handler = CreateCrashHandlerHost(process_type);
return crash_handler->GetDeathSignalSocket();
}
return -1;
int fd;
return crash_reporter::GetHandlerSocket(&fd, nullptr) ? fd : -1;
}
#endif // BUILDFLAG(IS_LINUX)
@ -566,42 +505,22 @@ void ElectronBrowserClient::AppendExtraCommandLineSwitches(
command_line->GetSwitchValueASCII(::switches::kProcessType);
#if BUILDFLAG(IS_LINUX)
bool enable_crash_reporter = false;
if (crash_reporter::IsCrashpadEnabled()) {
command_line->AppendSwitch(::switches::kEnableCrashpad);
enable_crash_reporter = true;
int fd;
pid_t pid;
if (crash_reporter::GetHandlerSocket(&fd, &pid)) {
command_line->AppendSwitchASCII(
crash_reporter::switches::kCrashpadHandlerPid,
base::NumberToString(pid));
}
} else {
enable_crash_reporter = breakpad::IsCrashReporterEnabled();
pid_t pid;
if (crash_reporter::GetHandlerSocket(nullptr, &pid)) {
command_line->AppendSwitchASCII(
crash_reporter::switches::kCrashpadHandlerPid,
base::NumberToString(pid));
}
// Zygote Process gets booted before any JS runs, accessing GetClientId
// will end up touching DIR_USER_DATA path provider and this will
// configure default value because app.name from browser_init has
// not run yet.
if (enable_crash_reporter && process_type != ::switches::kZygoteProcess) {
if (process_type != ::switches::kZygoteProcess) {
std::string switch_value =
api::crash_reporter::GetClientId() + ",no_channel";
command_line->AppendSwitchASCII(::switches::kEnableCrashReporter,
switch_value);
if (!crash_reporter::IsCrashpadEnabled()) {
for (const auto& pair : api::crash_reporter::GetGlobalCrashKeys()) {
if (!switch_value.empty())
switch_value += ",";
switch_value += pair.first;
switch_value += "=";
switch_value += pair.second;
}
command_line->AppendSwitchASCII(switches::kGlobalCrashKeys, switch_value);
}
}
#endif
@ -1508,9 +1427,7 @@ bool ElectronBrowserClient::WillCreateURLLoaderFactory(
std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
ElectronBrowserClient::WillCreateURLLoaderRequestInterceptors(
content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id,
const scoped_refptr<network::SharedURLLoaderFactory>&
network_loader_factory) {
int frame_tree_node_id) {
std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
interceptors;
#if BUILDFLAG(ENABLE_PDF_VIEWER)

View file

@ -236,9 +236,7 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
std::vector<std::unique_ptr<content::URLLoaderRequestInterceptor>>
WillCreateURLLoaderRequestInterceptors(
content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id,
const scoped_refptr<network::SharedURLLoaderFactory>&
network_loader_factory) override;
int frame_tree_node_id) override;
bool ShouldTreatURLSchemeAsFirstPartyWhenTopLevel(
base::StringPiece scheme,
bool is_embedded_origin_secure) override;

View file

@ -230,7 +230,7 @@ int ElectronBrowserMainParts::GetExitCode() const {
}
int ElectronBrowserMainParts::PreEarlyInitialization() {
field_trial_list_ = std::make_unique<base::FieldTrialList>(nullptr);
field_trial_list_ = std::make_unique<base::FieldTrialList>();
#if BUILDFLAG(IS_POSIX)
HandleSIGCHLD();
#endif

View file

@ -79,7 +79,7 @@ FileSelectHelper::FileSelectHelper()
FileSelectHelper::~FileSelectHelper() {
// There may be pending file dialogs, we need to tell them that we've gone
// away so they don't try and call back to us.
if (select_file_dialog_.get())
if (select_file_dialog_)
select_file_dialog_->ListenerDestroyed();
}

View file

@ -200,7 +200,7 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
scoped_refptr<content::FileSelectListener> listener_;
// Dialog box used for choosing files to upload from file form fields.
std::unique_ptr<ui::SelectFileDialog> select_file_dialog_;
scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
std::unique_ptr<ui::SelectFileDialog::FileTypeInfo> select_file_types_;
// The type of file dialog last shown. This is SELECT_NONE if an

View file

@ -16,6 +16,7 @@
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/unguessable_token.h"
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"

View file

@ -10,6 +10,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "net/base/network_anonymization_key.h"
#include "net/proxy_resolution/proxy_info.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "shell/browser/electron_browser_context.h"
@ -56,7 +57,7 @@ void ResolveProxyHelper::StartPendingRequest() {
browser_context_->GetDefaultStoragePartition()
->GetNetworkContext()
->LookUpProxyForURL(pending_requests_.front().url,
net::NetworkIsolationKey(),
net::NetworkAnonymizationKey(),
std::move(proxy_lookup_client));
}

View file

@ -10,6 +10,7 @@
#include <vector>
#include "base/memory/weak_ptr.h"
#include "base/scoped_observation.h"
#include "content/public/browser/serial_delegate.h"
#include "shell/browser/serial/serial_chooser_context.h"
#include "shell/browser/serial/serial_chooser_controller.h"

View file

@ -27,14 +27,7 @@ namespace electron::crash_keys {
namespace {
#if BUILDFLAG(IS_LINUX)
// Breakpad has a flawed system of calculating the number of chunks
// we add 127 bytes to force an extra chunk
constexpr size_t kMaxCrashKeyValueSize = 20479;
#else
constexpr size_t kMaxCrashKeyValueSize = 20320;
#endif
static_assert(kMaxCrashKeyValueSize < crashpad::Annotation::kValueMaxSize,
"max crash key value length above what crashpad supports");
@ -53,14 +46,8 @@ std::deque<std::string>& GetExtraCrashKeyNames() {
} // namespace
constexpr uint32_t kMaxCrashKeyNameLength = 40;
#if BUILDFLAG(IS_LINUX)
static_assert(kMaxCrashKeyNameLength <=
crash_reporter::internal::kCrashKeyStorageKeySize,
"max crash key name length above what breakpad supports");
#else
static_assert(kMaxCrashKeyNameLength <= crashpad::Annotation::kNameMaxLength,
"max crash key name length above what crashpad supports");
#endif
void SetCrashKey(const std::string& key, const std::string& value) {
// Chrome DCHECK()s if we try to set an annotation with a name longer than
@ -122,18 +109,6 @@ bool IsRunningAsNode() {
} // namespace
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
#if BUILDFLAG(IS_LINUX)
if (command_line.HasSwitch(switches::kGlobalCrashKeys)) {
std::vector<std::pair<std::string, std::string>> global_crash_keys;
base::SplitStringIntoKeyValuePairs(
command_line.GetSwitchValueASCII(switches::kGlobalCrashKeys), '=', ',',
&global_crash_keys);
for (const auto& pair : global_crash_keys) {
SetCrashKey(pair.first, pair.second);
}
}
#endif
// NB. this is redundant with the 'ptype' key that //components/crash
// reports; it's present for backwards compatibility.
static crash_reporter::CrashKeyString<16> process_type_key("process_type");

View file

@ -267,8 +267,6 @@ const char kEnableAuthNegotiatePort[] = "enable-auth-negotiate-port";
// If set, NTLM v2 is disabled for POSIX platforms.
const char kDisableNTLMv2[] = "disable-ntlm-v2";
const char kGlobalCrashKeys[] = "global-crash-keys";
const char kEnableWebSQL[] = "enable-websql";
} // namespace switches

View file

@ -130,8 +130,6 @@ extern const char kAuthNegotiateDelegateWhitelist[];
extern const char kEnableAuthNegotiatePort[];
extern const char kDisableNTLMv2[];
extern const char kGlobalCrashKeys[];
extern const char kEnableWebSQL[];
} // namespace switches