mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
chore: bump chromium to 141.0.7346.0 (main) (#47983)
* chore: bump chromium in DEPS to 141.0.7341.0 * chore: bump chromium in DEPS to 141.0.7342.0 * chore: update patches manually resolved conflict in `osr_shared_texture_remove_keyed_mutex_on_win_dxgi.patch` due to https://crrev.com/c/6681354 * 6819541: WebShare: Improve mac share behavior when sharing a URL https://chromium-review.googlesource.com/c/chromium/src/+/6819541 * Add missing include for SkBitmap Couldn't quickly find where we lost the full definition in this file's includes. 🤷 * 6771055: [SxS] Move devtools to ContentsContainerView supporting side-by-side. https://chromium-review.googlesource.com/c/chromium/src/+/6771055 There may be some simplification possible here (set_x, Rect position, ...), but this change is satisfactory to maintain the current behavior. * 6813689: Switch SystemMemoryInfoKB to use ByteCount https://chromium-review.googlesource.com/c/chromium/src/+/6813689 * 6818486: Track DevTools feature usage in new badge tracker https://chromium-review.googlesource.com/c/chromium/src/+/6818486 * chore: bump chromium in DEPS to 141.0.7344.0 * Remove ELECTRON_OZONE_PLATFORM_HINT env var 6819616: Remove OzonePlatformHint | https://chromium-review.googlesource.com/c/chromium/src/+/6819616 See: https://github.com/electron/electron/issues/48001 * chore: update patches * Add missing include for `base::NumberToString` * Remove `DESKTOP_STARTUP_ID` code This was removed upstream in https://chromium-review.googlesource.com/c/chromium/src/+/6819616 and I confirmed with the author that it was an intentional change. Going to mirror upstream and remove it here too. * chore: bump chromium in DEPS to 141.0.7346.0 * chore: update patches * 6828465: Reland "Remove BluezDBusThreadManager" https://chromium-review.googlesource.com/c/chromium/src/+/6828465 * Patch change to Node.js test output V8 enhanced the stack trace of "thenable" async tasks. A couple of Node.js tests needed to have their snapshots updates to accomodate the extra stack trace frames in the output. This patch should be upstreamed to Node.js. See: 6826001: fix thenable async stack trace https://chromium-review.googlesource.com/c/v8/v8/+/6826001 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: clavin <clavin@electronjs.org>
This commit is contained in:
committed by
GitHub
parent
b9ceaabb85
commit
55d8b71d72
@@ -45,6 +45,7 @@
|
||||
#include "shell/common/thread_restrictions.h"
|
||||
#include "skia/ext/font_utils.h"
|
||||
#include "skia/ext/legacy_display_globals.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
#include "third_party/skia/include/core/SkCanvas.h"
|
||||
#include "third_party/skia/include/core/SkFont.h"
|
||||
#include "third_party/skia/include/core/SkPaint.h"
|
||||
|
||||
@@ -210,7 +210,6 @@ int ElectronBrowserMainParts::PreEarlyInitialization() {
|
||||
HandleSIGCHLD();
|
||||
#endif
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
DetectOzonePlatform();
|
||||
ui::OzonePlatform::PreEarlyInitialization();
|
||||
#endif
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
|
||||
@@ -124,10 +124,6 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
|
||||
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
void DetectOzonePlatform();
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
void FreeAppDelegate();
|
||||
void RegisterURLHandler();
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
// Copyright (c) 2022 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/browser/electron_browser_main_parts.h"
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/strings/cstring_view.h"
|
||||
#include "ui/base/ozone_buildflags.h"
|
||||
#include "ui/ozone/public/ozone_switches.h"
|
||||
|
||||
#if BUILDFLAG(IS_OZONE_WAYLAND)
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/nix/xdg_util.h"
|
||||
#include "shell/common/thread_restrictions.h"
|
||||
#endif
|
||||
|
||||
namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr base::cstring_view kElectronOzonePlatformHint{
|
||||
"ELECTRON_OZONE_PLATFORM_HINT"};
|
||||
|
||||
#if BUILDFLAG(IS_OZONE_WAYLAND)
|
||||
|
||||
constexpr char kPlatformWayland[] = "wayland";
|
||||
|
||||
bool HasWaylandDisplay(base::Environment* env) {
|
||||
if (std::optional<std::string> wayland_display =
|
||||
env->GetVar("WAYLAND_DISPLAY")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (std::optional<std::string> xdg_runtime_dir =
|
||||
env->GetVar("XDG_RUNTIME_DIR")) {
|
||||
auto wayland_server_pipe =
|
||||
base::FilePath(*xdg_runtime_dir).Append("wayland-0");
|
||||
// Normally, this should happen exactly once, at the startup of the main
|
||||
// process.
|
||||
electron::ScopedAllowBlockingForElectron allow_blocking;
|
||||
return base::PathExists(wayland_server_pipe);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // BUILDFLAG(IS_OZONE_WAYLAND)
|
||||
|
||||
#if BUILDFLAG(IS_OZONE_X11)
|
||||
constexpr char kPlatformX11[] = "x11";
|
||||
#endif
|
||||
|
||||
// Evaluates the environment and returns the effective platform name for the
|
||||
// given |ozone_platform_hint|.
|
||||
// For the "auto" value, returns "wayland" if the XDG session type is "wayland",
|
||||
// "x11" otherwise.
|
||||
// For the "wayland" value, checks if the Wayland server is available, and
|
||||
// returns "x11" if it is not.
|
||||
// See https://crbug.com/1246928.
|
||||
std::string MaybeFixPlatformName(const std::string& ozone_platform_hint) {
|
||||
#if BUILDFLAG(IS_OZONE_WAYLAND)
|
||||
// Wayland is selected if both conditions below are true:
|
||||
// 1. The user selected either 'wayland' or 'auto'.
|
||||
// 2. The XDG session type is 'wayland', OR the user has selected 'wayland'
|
||||
// explicitly and a Wayland server is running.
|
||||
// Otherwise, fall back to X11.
|
||||
if (ozone_platform_hint == kPlatformWayland ||
|
||||
ozone_platform_hint == "auto") {
|
||||
auto env(base::Environment::Create());
|
||||
|
||||
std::optional<std::string> xdg_session_type =
|
||||
env->GetVar(base::nix::kXdgSessionTypeEnvVar);
|
||||
if ((xdg_session_type.has_value() && *xdg_session_type == "wayland") ||
|
||||
(ozone_platform_hint == kPlatformWayland &&
|
||||
HasWaylandDisplay(env.get()))) {
|
||||
return kPlatformWayland;
|
||||
}
|
||||
}
|
||||
#endif // BUILDFLAG(IS_OZONE_WAYLAND)
|
||||
|
||||
#if BUILDFLAG(IS_OZONE_X11)
|
||||
if (ozone_platform_hint == kPlatformX11) {
|
||||
return kPlatformX11;
|
||||
}
|
||||
#if BUILDFLAG(IS_OZONE_WAYLAND)
|
||||
if (ozone_platform_hint == kPlatformWayland ||
|
||||
ozone_platform_hint == "auto") {
|
||||
// We are here if:
|
||||
// - The binary has both X11 and Wayland backends.
|
||||
// - The user wanted Wayland but that did not work, otherwise it would have
|
||||
// been returned above.
|
||||
if (ozone_platform_hint == kPlatformWayland) {
|
||||
LOG(WARNING) << "No Wayland server is available. Falling back to X11.";
|
||||
} else {
|
||||
LOG(WARNING) << "This is not a Wayland session. Falling back to X11. "
|
||||
"If you need to run Chrome on Wayland using some "
|
||||
"embedded compositor, e. g., Weston, please specify "
|
||||
"Wayland as your preferred Ozone platform, or use "
|
||||
"--ozone-platform=wayland.";
|
||||
}
|
||||
return kPlatformX11;
|
||||
}
|
||||
#endif // BUILDFLAG(IS_OZONE_WAYLAND)
|
||||
#endif // BUILDFLAG(OZONE_PLATFORM_X11)
|
||||
|
||||
return ozone_platform_hint;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void ElectronBrowserMainParts::DetectOzonePlatform() {
|
||||
auto const env = base::Environment::Create();
|
||||
auto* const command_line = base::CommandLine::ForCurrentProcess();
|
||||
if (!command_line->HasSwitch(switches::kOzonePlatform)) {
|
||||
auto ozone_platform_hint =
|
||||
command_line->GetSwitchValueASCII(switches::kOzonePlatformHint);
|
||||
if (ozone_platform_hint.empty()) {
|
||||
ozone_platform_hint =
|
||||
env->GetVar(kElectronOzonePlatformHint).value_or("");
|
||||
}
|
||||
if (!ozone_platform_hint.empty()) {
|
||||
command_line->AppendSwitchASCII(
|
||||
switches::kOzonePlatform, MaybeFixPlatformName(ozone_platform_hint));
|
||||
}
|
||||
}
|
||||
|
||||
if (std::optional<std::string> desktop_startup_id =
|
||||
env->GetVar("DESKTOP_STARTUP_ID"))
|
||||
command_line->AppendSwitchASCII("desktop-startup-id", *desktop_startup_id);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/notimplemented.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/sequenced_task_runner.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "components/dbus/thread_linux/dbus_thread_linux.h"
|
||||
#include "device/bluetooth/dbus/bluez_dbus_manager.h"
|
||||
#include "device/bluetooth/dbus/bluez_dbus_thread_manager.h"
|
||||
#include "device/bluetooth/dbus/dbus_bluez_manager_wrapper_linux.h"
|
||||
|
||||
namespace {
|
||||
@@ -39,7 +39,7 @@ PowerObserverLinux::PowerObserverLinux(
|
||||
if (!bluez::BluezDBusManager::IsInitialized())
|
||||
bluez::DBusBluezManagerWrapperLinux::Initialize();
|
||||
|
||||
auto* bus = bluez::BluezDBusThreadManager::Get()->GetSystemBus();
|
||||
auto bus = dbus_thread_linux::GetSharedSystemBus();
|
||||
if (!bus) {
|
||||
LOG(WARNING) << "Failed to get system bus connection";
|
||||
return;
|
||||
|
||||
@@ -118,7 +118,7 @@ class OffScreenRenderWidgetHostView
|
||||
void ShowSharePicker(
|
||||
const std::string& title,
|
||||
const std::string& text,
|
||||
const std::string& url,
|
||||
const GURL& url,
|
||||
const std::vector<std::string>& file_paths,
|
||||
blink::mojom::ShareService::ShareCallback callback) override {}
|
||||
uint64_t GetNSViewId() const override;
|
||||
|
||||
@@ -8,12 +8,11 @@
|
||||
#include <memory>
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
#include "ui/events/event.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/views/view.h"
|
||||
|
||||
class SkBitmap;
|
||||
|
||||
namespace electron {
|
||||
|
||||
class OffscreenViewProxy;
|
||||
|
||||
@@ -174,6 +174,7 @@ class InspectableWebContents
|
||||
void RecordPerformanceHistogramMedium(const std::string& name,
|
||||
double duration) override {}
|
||||
void RecordUserMetricsAction(const std::string& name) override {}
|
||||
void RecordNewBadgeUsage(const std::string& feature_name) override {}
|
||||
void RecordImpression(const ImpressionEvent& event) override {}
|
||||
void RecordResize(const ResizeEvent& event) override {}
|
||||
void RecordClick(const ClickEvent& event) override {}
|
||||
|
||||
@@ -221,11 +221,11 @@ void InspectableWebContentsView::Layout(PassKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
gfx::Size container_size(width(), height());
|
||||
gfx::Rect container_bounds(width(), height());
|
||||
gfx::Rect new_devtools_bounds;
|
||||
gfx::Rect new_contents_bounds;
|
||||
ApplyDevToolsContentsResizingStrategy(
|
||||
strategy_, container_size, &new_devtools_bounds, &new_contents_bounds);
|
||||
strategy_, container_bounds, &new_devtools_bounds, &new_contents_bounds);
|
||||
|
||||
// DevTools cares about the specific position, so we have to compensate RTL
|
||||
// layout here.
|
||||
|
||||
@@ -165,28 +165,28 @@ v8::Local<v8::Value> ElectronBindings::GetCreationTime(v8::Isolate* isolate) {
|
||||
v8::Local<v8::Value> ElectronBindings::GetSystemMemoryInfo(
|
||||
v8::Isolate* isolate,
|
||||
gin_helper::Arguments* args) {
|
||||
base::SystemMemoryInfoKB mem_info;
|
||||
base::SystemMemoryInfo mem_info;
|
||||
if (!base::GetSystemMemoryInfo(&mem_info)) {
|
||||
args->ThrowError("Unable to retrieve system memory information");
|
||||
return v8::Undefined(isolate);
|
||||
}
|
||||
|
||||
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
|
||||
dict.Set("total", mem_info.total);
|
||||
dict.Set("total", mem_info.total.InKiB());
|
||||
|
||||
// See Chromium's "base/process/process_metrics.h" for an explanation.
|
||||
int free =
|
||||
base::ByteCount free =
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
mem_info.avail_phys;
|
||||
#else
|
||||
mem_info.free;
|
||||
#endif
|
||||
dict.Set("free", free);
|
||||
dict.Set("free", free.InKiB());
|
||||
|
||||
// NB: These return bogus values on macOS
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
dict.Set("swapTotal", mem_info.swap_total);
|
||||
dict.Set("swapFree", mem_info.swap_free);
|
||||
dict.Set("swapTotal", mem_info.swap_total.InKiB());
|
||||
dict.Set("swapFree", mem_info.swap_free.InKiB());
|
||||
#endif
|
||||
|
||||
return dict.GetHandle();
|
||||
|
||||
Reference in New Issue
Block a user