chore: bump chromium to 115.0.5786.0 (main) (#38301)

* chore: bump chromium in DEPS to 115.0.5772.0

* chore: update disable_color_correct_rendering.patch

no manual changes; patch succeeded with fuzz 2.

* chore: update chromium/build_libc_as_static_library.patch

no manual changes; patch succeeded with fuzz 2 (offset 1 line).

* chore: update chromium/feat_configure_launch_options_for_service_process.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4518747

patch manually reapplied due to upstream code shear

* chore: update chromium/chore_patch_out_profile_methods_in_profile_selections_cc.patch

https://chromium-review.googlesource.com/c/chromium/src/+/4502965

patch manually reapplied due to upstream code shear

* chore: update bundle_locations #include location

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355

* chore: Remove `extension_name` from DesktopStreamsRegistry

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4514081

* chore: bump chromium in DEPS to 115.0.5778.0

* chore: add chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4482679

Another instance of patching out upstream references to Profile code

* refactor: add WebViewGuestDelegate::GetGuestDelegateWeakPtr()

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4515455

This approach copied from GuestViewBase::GetGuestDelegateWeakPtr() approach in that same commit.

* fixup! chore: update bundle_locations #include location

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355

Sync namespace use to upstream base::mac -> base::apple changes

* fixup! chore: update bundle_locations #include location

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4525355

Sync namespace use to upstream base::mac -> base::apple changes

* chore: update chromium/mas_disable_remote_accessibility.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4530546

patch manually reapplied due to upstream code shear

* chore: update chromium/printing.patch

no manual changes; patch succeeded with fuzz

* chore: update chromium/build_add_electron_tracing_category.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517872

no manual changes; patch succeeded with fuzz

* chore: update chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529098

patch manually reapplied due to upstream code shear

* chromium/build_only_use_the_mas_build_config_in_the_required_components.patch

https://chromium-review.googlesource.com/c/chromium/src/+/4529098

patch manually reapplied due to upstream code shear

* chore: update chromium/mas-cgdisplayusesforcetogray.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4529475

no manual changes; patch succeeded with fuzz

* chore: update chromium/build_only_use_the_mas_build_config_in_the_required_components.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4429011

no manual changes; patch succeeded with fuzz

* chore: remove chromium/cherry-pick-48a136e77e6d.patch

already present upstream

* chore: remove chromium/cherry-pick-e6e23ba00379.patch

already present upstream

* [Code Health] Remove value based RegisterPref for Dict and List

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4533537

* Remove `cxx17_backports.h` and adjust unittest file

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534916

Notes: mostly just removing #include and s/base::clamp/std::clamp/

* refactor: add FakeBrowserProcess helper class

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4424072

Used in ElectronBrowserMainParts' fake_browser_process_ field. Previously
this was an BrowserProcessImpl instance, but upstream 4424072 makes that
an abstract base class. `FakeBrowserProcess` is a thin subclass with the
minimum code needed to make it concrete.

`ElectronBrowserMainParts::fake_browser_process_` is now a `shared_ptr`
instead of a `unique_ptr` so we can avoid exposing `FakeBrowserProcess`
in the header.

* fixup! refactor: add FakeBrowserProcess helper class

remove unnecessary unique_ptr

* fix: Browser::SetDockIcon() when !Browser.is_ready()

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4410741

An alternative fix for https://github.com/electron/electron/pull/36279 .
The previous fix was to call `SetSupportedScales()` ourselves (1b1609a),
but upstream has removed this API.

CC @codebytere

* fixup! chore: remove chromium/cherry-pick-e6e23ba00379.patch

* chore: update chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4517404

patch manually reapplied due to upstream code shear

* chore: update patches

* chore: add dep: resource_coordinator:mojo_bindings

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4521464

* fixup! chore: add dep: resource_coordinator:mojo_bindings

chore: make lint happy

* chore: patch out Profile methods in titlebar_config

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4508143 (primary)

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4534461 (followup)

* chore: bump chromium in DEPS to 115.0.5780.0

* chore: update chromium/disable_hidden.patch

no manual changes; patch succeeded with fuzz

* chore: update chromium/sysroot.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4535715

no manual changes; patch succeeded with fuzz

* chore: update chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4403623

patch manually reapplied due to upstream code shear

* chore: update chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4547380

patch manually reapplied due to upstream code shear

* chore: update patches

* fixup! fix: Browser::SetDockIcon() when !Browser.is_ready()

chore: iwyu image.h

* chore: bump chromium in DEPS to 115.0.5782.0

* chore: bump chromium in DEPS to 115.0.5784.0

* 4514181: CR2023: Update filled cr-input styles.

https://chromium-review.googlesource.com/c/chromium/src/+/4514181

* 4521894: Remove SiteInstanceDeleting usage outside of tests.

https://chromium-review.googlesource.com/c/chromium/src/+/4521894

* 4525355: Move backup_util and bundle_locations to base/apple

https://chromium-review.googlesource.com/c/chromium/src/+/4525355

* 4484743: webauthn: add underlying support for calling iCloud Keychain on macOS.

https://chromium-review.googlesource.com/c/chromium/src/+/4484743

* chore: fixup patch indices

* 4546398: Convert /chrome/browser to use ARC

https://chromium-review.googlesource.com/c/chromium/src/+/4546398

* chore: bump chromium in DEPS to 115.0.5786.0

* chore: update patches

* 4540682: Initialize PDF SDK with policy in chrome_pdf::RenderPDFPageToDC()

https://chromium-review.googlesource.com/c/chromium/src/+/4540682

* Don't import ObjC++ fn headers into electron_api_app

* 4535715: Refactor sysroot-creator.sh

https://chromium-review.googlesource.com/c/chromium/src/+/4535715

* fixup! refactor: add FakeBrowserProcess helper class

* 4531903: [string][test] Create/Copy strings to old space before externalization

https://chromium-review.googlesource.com/c/v8/v8/+/4531903

* 59645: Add APIs to support RSA keys with large e.

https://boringssl-review.googlesource.com/c/boringssl/+/59645

---------

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
Charles Kerr 2023-05-23 14:58:58 -05:00 коммит произвёл GitHub
Родитель e7b8bb4766
Коммит 30e992dec4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
103 изменённых файлов: 1059 добавлений и 1490 удалений

Просмотреть файл

@ -555,6 +555,7 @@ source_set("electron_lib") {
}
frameworks = [
"AuthenticationServices.framework",
"AVFoundation.framework",
"Carbon.framework",
"LocalAuthentication.framework",

2
DEPS
Просмотреть файл

@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'115.0.5760.0',
'115.0.5786.0',
'node_version':
'v18.16.0',
'nan_version':

Просмотреть файл

@ -157,7 +157,10 @@ static_library("chrome") {
"//services/strings",
]
deps = [ "//chrome/browser:resource_prefetch_predictor_proto" ]
deps = [
"//chrome/browser:resource_prefetch_predictor_proto",
"//chrome/browser/resource_coordinator:mojo_bindings",
]
if (is_linux) {
sources += [ "//chrome/browser/icon_loader_auralinux.cc" ]

Просмотреть файл

@ -48,10 +48,10 @@ index 838761af5cb8498d8bcb66b1a7a6f9c1a233cac7..b9bda24dd4d372485622ff99873ee34e
void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
RSA *(*cb)(SSL *ssl, int is_export,
diff --git a/ssl/ssl_test.cc b/ssl/ssl_test.cc
index 1a06ba8458323c36f34fef517903807eb68e585d..4be9de27be025c859602ce54f08eabea438b3e9c 100644
index be00e7c342759d3059d77cbfd938438df96b5c33..6e551c4d48d1633509dbb95a9619abaa84f84cb2 100644
--- a/ssl/ssl_test.cc
+++ b/ssl/ssl_test.cc
@@ -8459,11 +8459,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
@@ -8558,11 +8558,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
EXPECT_EQ(ret, 0);
EXPECT_EQ(SSL_get_error(client.get(), ret), SSL_ERROR_ZERO_RETURN);
@ -63,7 +63,7 @@ index 1a06ba8458323c36f34fef517903807eb68e585d..4be9de27be025c859602ce54f08eabea
// Although the client has seen close_notify, it should continue to report
// |SSL_ERROR_SYSCALL| when its writes fail.
ret = SSL_write(client.get(), data, sizeof(data));
@@ -8471,22 +8466,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
@@ -8570,22 +8565,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
EXPECT_EQ(SSL_get_error(client.get(), ret), SSL_ERROR_SYSCALL);
EXPECT_TRUE(write_failed);
write_failed = false;

Просмотреть файл

@ -125,5 +125,6 @@ chore_patch_out_profile_methods_in_profile_selections_cc.patch
add_gin_converter_support_for_arraybufferview.patch
chore_defer_usb_service_getdevices_request_until_usb_service_is.patch
fix_remove_profiles_from_spellcheck_service.patch
cherry-pick-48a136e77e6d.patch
cherry-pick-e6e23ba00379.patch
chore_patch_out_profile_methods_in_chrome_browser_pdf.patch
chore_patch_out_profile_methods_in_titlebar_config.patch
chore_temporarily_patch_out_arc_references.patch

Просмотреть файл

@ -23,10 +23,10 @@ index fef4c8e02067c44ed804c8b53db1007fae2d2a76..b36304ee0a832c5e1e2fd3af6151b7b0
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 3b50524b8e33d99874dd58d78ef7c96a9eaa7205..886a34f94f38444117eae7e3b117ae043d50609e 100644
index 64e30259cdf7c0ee27f64d3c7d383171f6be1f4b..cc90f0e357d25f539be79f02724a27e178b501e8 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4409,6 +4409,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4408,6 +4408,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
@ -40,10 +40,10 @@ index 3b50524b8e33d99874dd58d78ef7c96a9eaa7205..886a34f94f38444117eae7e3b117ae04
int world_id) {
for (auto& observer : observers_)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 516a8140f79cc7f8ffe4b0665184d7d3d6111da9..fce2608070d2bf31b6b02de47102aff870c8229f 100644
index 0c8628f909e3a08b3f6ce7852842e50ec37e64cc..506aa2fc88003174dc7e82fc415e162e196dad61 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -608,6 +608,8 @@ class CONTENT_EXPORT RenderFrameImpl
@@ -606,6 +606,8 @@ class CONTENT_EXPORT RenderFrameImpl
void DidObserveLayoutShift(double score, bool after_input_or_scroll) override;
void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override;
@ -53,10 +53,10 @@ index 516a8140f79cc7f8ffe4b0665184d7d3d6111da9..fce2608070d2bf31b6b02de47102aff8
int world_id) override;
void DidChangeScrollOffset() override;
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
index dfd33eede0a8b0935a06eeb8f505a8d0738afa19..06827403830cb730b2521c715ec06aedbf7339c6 100644
index b9ab9b46f2aab2af137583a6012d100cabc4faaf..3c6825f29f9b5d570d968c31cee25b04aed26b58 100644
--- a/third_party/blink/public/web/web_local_frame_client.h
+++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -606,6 +606,9 @@ class BLINK_EXPORT WebLocalFrameClient {
@@ -605,6 +605,9 @@ class BLINK_EXPORT WebLocalFrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
@ -67,7 +67,7 @@ index dfd33eede0a8b0935a06eeb8f505a8d0738afa19..06827403830cb730b2521c715ec06aed
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
index e7d4256fa96f5bc8ad71bd13b6b33feef32b443f..0dfeda68a4dbfd6b442f8d8f928c8cb871dd6aa4 100644
index 62b35b9fa47f0b99f2b7b6bc712b3a4b2c1c8e4e..4a0fdbb120edc76647560fb86d95613c95ae7094 100644
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
@@ -198,6 +198,7 @@ void LocalWindowProxy::Initialize() {

Просмотреть файл

@ -30,7 +30,7 @@ index a58ddcc8f6e79d3288d0c645875c8b1bbdaaf209..1283bd18cce78bc5eaad71b3fad01031
} // namespace blink
diff --git a/third_party/blink/renderer/core/exported/web_message_port_converter.cc b/third_party/blink/renderer/core/exported/web_message_port_converter.cc
index f440ee59be4ed14760f2948751f31f7ea3d42e2a..654fbb2d12c9fe7cb362d792ede64c9d1f8c099f 100644
index 6a6cb3d4ef0e454d18cf47cd971240d0dabea9fb..10ea1b43e5caa7c6c0f6c9ff5182a712ca422f9b 100644
--- a/third_party/blink/renderer/core/exported/web_message_port_converter.cc
+++ b/third_party/blink/renderer/core/exported/web_message_port_converter.cc
@@ -6,6 +6,7 @@

Просмотреть файл

@ -6,10 +6,10 @@ Subject: allow disabling blink scheduler throttling per RenderView
This allows us to disable throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 43c8a9913c4b3a4fe0c3151d885c5a13a9fdc74b..0cd8005e743d3bb662c2d439b552a17b1db9b0ab 100644
index 3b059b6121562dba8ec7c4483388408100d8ef26..0eb07c514883975f39b1a98ccfe65028e4c2ad75 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -695,6 +695,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -700,6 +700,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
}
@ -60,10 +60,10 @@ index d18c66114870de83c7eef21578e9e2b8d5606a8b..e1defb3992289427df85963f44a705e3
+ SetSchedulerThrottling(bool allowed);
};
diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h
index 2c3930e849719dce3871c12b073966ca370e5e43..990f88a20320a2f6f58cf2e0b4d37e398d5f7fda 100644
index 8a18ecf567cd3a6a2fb1627083a5544a93198bf4..8b6436f3ba6c8bfc2cba054e77ab888625ae668d 100644
--- a/third_party/blink/public/web/web_view.h
+++ b/third_party/blink/public/web/web_view.h
@@ -369,6 +369,7 @@ class BLINK_EXPORT WebView {
@@ -371,6 +371,7 @@ class BLINK_EXPORT WebView {
// Scheduling -----------------------------------------------------------
virtual PageScheduler* Scheduler() const = 0;
@ -72,10 +72,10 @@ index 2c3930e849719dce3871c12b073966ca370e5e43..990f88a20320a2f6f58cf2e0b4d37e39
// Visibility -----------------------------------------------------------
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index 0c4e9bfffc6dca9f0540a88acfd0a57caaba9c10..55650ca27d81d09f9ad315b699cade5a6d7eaca9 100644
index a1bcdb3b7ceb5bed96b4c442268e3b7ddb490fa4..acda9f8ea1789d3febc0386ae855c009ea462816 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -3828,13 +3828,21 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -3833,13 +3833,21 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}
@ -99,10 +99,10 @@ index 0c4e9bfffc6dca9f0540a88acfd0a57caaba9c10..55650ca27d81d09f9ad315b699cade5a
if (!is_initial_state) {
for (auto& observer : observers_)
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
index 421ca0b15eea5958d18e52118613c388aeef7dce..c3751889cc1289f237f9f8e0e22f321e8e793778 100644
index cce09d720fda1929cd5202841305ea564ebdecaf..63bb7c62a8a6abf32fd8e29861018b0c9c80d471 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -441,6 +441,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -443,6 +443,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
LocalDOMWindow* PagePopupWindow() const;
PageScheduler* Scheduler() const override;
@ -110,7 +110,7 @@ index 421ca0b15eea5958d18e52118613c388aeef7dce..c3751889cc1289f237f9f8e0e22f321e
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) override;
mojom::blink::PageVisibilityState GetVisibilityState() override;
@@ -904,6 +905,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -907,6 +908,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// If true, we send IPC messages when |preferred_size_| changes.
bool send_preferred_size_changes_ = false;

Просмотреть файл

@ -49,7 +49,7 @@ index 22c4d4e9718a503d9c7ca26a40c97149b0f8986a..6bdc2757c96a28022fda9e6f5e3b74a0
// its owning reference back to our owning LocalFrame.
client_->Detached(type);
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index 833fd0ba35b510a91bd98c98ff5b5e8a279953b8..54cb4d1ef90ded89b85243ac1296dfb7787b08dc 100644
index c01a916555d1fe5dbf972cba3b7ce248c80df371..d7ba7113f69e23b0fe47d135a4f51b9d50fa45b2 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -636,10 +636,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {

Просмотреть файл

@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us
to introduce a new Electron category for Electron-specific tracing.
diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
index 3c8faea2c2391a0172504d524129702cb3c43cf0..b561f3e09d294e74b41a22ab22e8bbe5be05a116 100644
index dd59416e22822c8754f7446538e1add3e677a81a..b4cbc35fc1e62dffa209a74049eb32aea84090d7 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -80,6 +80,7 @@
@ -18,4 +18,4 @@ index 3c8faea2c2391a0172504d524129702cb3c43cf0..b561f3e09d294e74b41a22ab22e8bbe5
+ X("electron") \
X("evdev") \
X("event") \
X("event_latency") \
X("exo") \

Просмотреть файл

@ -11,10 +11,10 @@ if we ever align our .pak file generation with Chrome we can remove this
patch.
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index cde7a97b2fee1c7be9d8ff9c081b6739545ab22b..e2e8d678dea93af4f4232bab69e9f51d085969ea 100644
index 884bccba58c66861b43b3b50a7535cba543302e2..82e7bf534aa6b998cee8df53be3ca7db450f38c0 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -193,11 +193,16 @@ if (!is_android && !is_mac) {
@@ -202,11 +202,16 @@ if (!is_android && !is_mac) {
"common/crash_keys.h",
]
@ -33,10 +33,10 @@ index cde7a97b2fee1c7be9d8ff9c081b6739545ab22b..e2e8d678dea93af4f4232bab69e9f51d
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 2a68fafa1f590eb967d1d5317fa1e116ebd7cea3..02926b3429e352e0592dbb2ab7c891b279ce92a4 100644
index b50bf319e4343986a9feceeb078c00e7f5b15e0c..a772f8c59aadaccde0367ce614ea341c8de28fbd 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4597,7 +4597,7 @@ static_library("browser") {
@@ -4622,7 +4622,7 @@ static_library("browser") {
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
# than here in :chrome_dll.
@ -46,10 +46,10 @@ index 2a68fafa1f590eb967d1d5317fa1e116ebd7cea3..02926b3429e352e0592dbb2ab7c891b2
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index d3eae651675c91a5953806e83bd48ef8113afca3..487bd4f50f4198ce96846bf897a81ba476bfa292 100644
index 6e85bb36a93fa3809ea4f6e2768160cd6b7ac3c3..d606468f0f8a4bb92e69cc7ae3cd5b511f2db660 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -6476,7 +6476,6 @@ test("unit_tests") {
@@ -6573,7 +6573,6 @@ test("unit_tests") {
deps += [
"//chrome:other_version",
@ -57,7 +57,7 @@ index d3eae651675c91a5953806e83bd48ef8113afca3..487bd4f50f4198ce96846bf897a81ba4
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:win_unit_tests",
@@ -6502,6 +6501,10 @@ test("unit_tests") {
@@ -6599,6 +6598,10 @@ test("unit_tests") {
"//ui/resources",
]
@ -68,7 +68,7 @@ index d3eae651675c91a5953806e83bd48ef8113afca3..487bd4f50f4198ce96846bf897a81ba4
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -7445,7 +7448,6 @@ test("unit_tests") {
@@ -7546,7 +7549,6 @@ test("unit_tests") {
}
deps += [
@ -76,7 +76,7 @@ index d3eae651675c91a5953806e83bd48ef8113afca3..487bd4f50f4198ce96846bf897a81ba4
"//chrome/browser/apps:icon_standardizer",
"//chrome/browser/apps/app_service",
"//chrome/browser/apps/app_service:test_support",
@@ -7526,6 +7528,10 @@ test("unit_tests") {
@@ -7632,6 +7634,10 @@ test("unit_tests") {
"//ui/webui/resources/js/browser_command:mojo_bindings",
]

Просмотреть файл

@ -14,7 +14,7 @@ tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will
rebuild the entire tree.
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 9ab0ddbdcf39b6efcd2b0e94c246fad48ae60586..b791580cffc200aa161478bf7060156cec5adc0a 100644
index 6ee83a41a05488f016f86f90b026835f4b19ea54..63b32e52a11af599dbc5154ed353e2bf7250e9d3 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -123,6 +123,9 @@ if (current_os == "") {

Просмотреть файл

@ -32,15 +32,15 @@ index 027ed522bf54972a6586004d4d4302bda3481146..c227b7e0379539d14859701b00c8f941
]
if (is_linux) {
diff --git a/buildtools/third_party/libc++abi/BUILD.gn b/buildtools/third_party/libc++abi/BUILD.gn
index 3ab30c4f8776b9b60e736e69c9bfbce99263ff97..3e8ed18b836f863deafd28a6363b7de2bcdc1863 100644
index ecd4a007ce9ad0b1595d88d7df4ffa09af89db83..94f6b98b873a6cdda7a04192fed16e532f0856ce 100644
--- a/buildtools/third_party/libc++abi/BUILD.gn
+++ b/buildtools/third_party/libc++abi/BUILD.gn
@@ -4,7 +4,7 @@
@@ -5,7 +5,7 @@
import("//build/config/android/config.gni")
import("//build/config/c++/c++.gni")
-source_set("libc++abi") {
+static_library("libc++abi") {
if (export_libcxxabi_from_executables) {
visibility = [
"//build/config:executable_deps",
visibility = [ "//build/config:executable_deps" ]
} else {

Просмотреть файл

@ -6,10 +6,10 @@ Subject: build: only use the mas build config in the required components
Before landing this patch should be split into the relevant MAS patches, or at least the patch this one partially reverts
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 4858b4c2c1b34434db7cf1d6dd2d166cfea9c312..304d704f5115c8f888366c47eda771381212fa5e 100644
index 4925a756be531749e3fe1fd6f1c081b060c28a4f..b7596e0d06f07bcb950fadb0775cec5479af4c0e 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1029,6 +1029,7 @@ component("base") {
@@ -1031,6 +1031,7 @@ component("base") {
"//build/config/compiler:prevent_unsafe_narrowing",
"//build/config/compiler:wexit_time_destructors",
"//build/config/compiler:wglobal_constructors",
@ -18,7 +18,7 @@ index 4858b4c2c1b34434db7cf1d6dd2d166cfea9c312..304d704f5115c8f888366c47eda77138
deps = [
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index b791580cffc200aa161478bf7060156cec5adc0a..253f8bd1e0c6adaca5a7c223eaa031bedd61af08 100644
index 63b32e52a11af599dbc5154ed353e2bf7250e9d3..fc6ed0cdbe211cb29dd5a1dded36b3b0a6912ce9 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -355,7 +355,6 @@ default_compiler_configs = [
@ -30,13 +30,13 @@ index b791580cffc200aa161478bf7060156cec5adc0a..253f8bd1e0c6adaca5a7c223eaa031be
if (is_win) {
diff --git a/components/os_crypt/sync/BUILD.gn b/components/os_crypt/sync/BUILD.gn
index 3314c2a5cdcef04d7f1a8bf0e07cafa073f2815e..ef75cef4e449bb5c689f95ab664c19a1c2362b16 100644
index a20e1b68ebd112d66ad82e5753b756218e457c9e..65c7170d1c2dbe4ecfc75c4fed92d6e7ff8efb27 100644
--- a/components/os_crypt/sync/BUILD.gn
+++ b/components/os_crypt/sync/BUILD.gn
@@ -70,6 +70,8 @@ component("os_crypt") {
"keychain_password_mac.mm",
@@ -71,6 +71,8 @@ component("os_crypt") {
"os_crypt_mac.mm",
]
configs += [ "//build/config/compiler:enable_arc" ]
+
+ configs += ["//electron/build/config:mas_build"]
}
@ -55,18 +55,18 @@ index 0625f07f317de46af619fdb279be78d9ecdc0029..5897820839d6d57ada22a83fe753e3a6
"alert.h",
"alert.mm",
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index 06e4c47bd5f37c041d93808cf712e9eb028ff1b2..5b0a12d8b69c0b79fefcb9194e0f3fb88c4c7051 100644
index 9551e3ea2e5f3de9bff158fc0f443df69a27f93a..e8c192bfbe5a2688e8c767443edbe7fb573ed509 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -322,6 +322,7 @@ viz_component("service") {
frameworks += [ "CoreGraphics.framework" ]
@@ -332,6 +332,7 @@ viz_component("service") {
"frame_sinks/external_begin_frame_source_mac.h",
]
}
+ configs = ["//electron/build/config:mas_build"]
}
if (is_android || use_ozone) {
@@ -576,6 +577,8 @@ viz_source_set("unit_tests") {
@@ -588,6 +589,8 @@ viz_source_set("unit_tests") {
"display_embedder/software_output_device_mac_unittest.mm",
]
frameworks = [ "IOSurface.framework" ]
@ -76,7 +76,7 @@ index 06e4c47bd5f37c041d93808cf712e9eb028ff1b2..5b0a12d8b69c0b79fefcb9194e0f3fb8
if (is_win) {
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index b2f8d8dab348d031510b3ff8a5cf5854feb77282..898525c4ff6517dd1c1341394b248ecbfe6527f3 100644
index 6c5c6f0771c72ac300e07398d4ed9bd3ce9a6ae3..49b290aef900e270b5d682e0a0d9dcebb9e0414c 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -56,6 +56,7 @@ source_set("browser") {
@ -88,10 +88,10 @@ index b2f8d8dab348d031510b3ff8a5cf5854feb77282..898525c4ff6517dd1c1341394b248ecb
libs = []
frameworks = []
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn
index 7490e10b3741a0680b0fbe7b069bd5803dccfd42..40d243c84e0336b6f413caf3a8eee96cab62fcf8 100644
index d38bd551f8bafbc3be22ca0bedb508e4a74ffbb5..9e17dd2484a633301e684dc091b4800d635e5a20 100644
--- a/content/common/BUILD.gn
+++ b/content/common/BUILD.gn
@@ -171,6 +171,7 @@ source_set("common") {
@@ -170,6 +170,7 @@ source_set("common") {
"//content:content_implementation",
"//build/config:precompiled_headers",
]
@ -100,7 +100,7 @@ index 7490e10b3741a0680b0fbe7b069bd5803dccfd42..40d243c84e0336b6f413caf3a8eee96c
public_deps = [
":mojo_bindings",
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
index 8177e8f11818639b4bafbb860a0f3edd69289465..23e19a8550c20c01e5c04388fe1f0294eae9507e 100644
index 34636a58846e2b250e423dde76e4e6ea1f686676..899b75f2be91e86c526f550718e22221eea604f3 100644
--- a/content/renderer/BUILD.gn
+++ b/content/renderer/BUILD.gn
@@ -228,6 +228,7 @@ target(link_target_type, "renderer") {
@ -124,10 +124,10 @@ index 642afd72cc0f98fe2590cef0c470f378eabb939e..894769a5de698767117339cab0fc2942
if (is_mac) {
diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn
index 1e7a52437d36b3e55eb45f546c8449b98533ad73..dee8f9a33ed80ad52122c967c35674954ba39560 100644
index ed977f540a2920858a05292f823bf49c669aa6d2..9acd66a086654d77f2a2f84b917795197ac12810 100644
--- a/gpu/ipc/service/BUILD.gn
+++ b/gpu/ipc/service/BUILD.gn
@@ -129,6 +129,7 @@ component("service") {
@@ -130,6 +130,7 @@ component("service") {
"QuartzCore.framework",
]
defines += [ "GL_SILENCE_DEPRECATION" ]
@ -136,10 +136,10 @@ index 1e7a52437d36b3e55eb45f546c8449b98533ad73..dee8f9a33ed80ad52122c967c3567495
if (is_ios) {
sources += [
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
index 8aaf3f77faa5be3078888da392c2e2fb0d1d6959..b557f0edfe8bf4cd8c0185a94c83e53932d064b6 100644
index a828562c1da7aecc5b7e5888b25d8a3454628074..6926d5ca4c860d8754298948097dc1b63d2688a2 100644
--- a/media/audio/BUILD.gn
+++ b/media/audio/BUILD.gn
@@ -197,6 +197,7 @@ source_set("audio") {
@@ -199,6 +199,7 @@ source_set("audio") {
"mac/coreaudio_dispatch_override.h",
]
frameworks += [ "AudioUnit.framework" ]
@ -189,7 +189,7 @@ index 5e9fc18352d1bf0939f8366d2282b49aeb307994..69dcc2cafa27b3d8bdf3fe8d0a22a980
source_set("sandbox_unittests") {
diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
index c0c09f37b3332772dcd71cddb3114c44648ffe06..946684da595074c4b968500594018ae5d316d569 100644
index 2c9080001cf8e8b4da54a4744f6754e3d5aac5a0..e08a38e5f9ea9c15fc5ceba1a38af682055389b7 100644
--- a/third_party/blink/renderer/core/BUILD.gn
+++ b/third_party/blink/renderer/core/BUILD.gn
@@ -304,6 +304,7 @@ component("core") {
@ -226,10 +226,10 @@ index c9777e07fdd311213db325da44573ed09080856e..76a7ca0545b69baf19c6c89088fb2774
if (use_atk) {
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index 056a7b1bd399510688841cb68da3985690deb0c7..3c0c0f625156adcc9204ff718703e8314034dba4 100644
index 9ffa8129d29ecda50f91355ffd01ce9926a70b11..5ebf5ea4db7c692b3288110945d470831e7797e2 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -353,6 +353,7 @@ component("base") {
@@ -359,6 +359,7 @@ component("base") {
"l10n/l10n_util_mac.mm",
"resource/resource_bundle_mac.mm",
]
@ -253,10 +253,10 @@ index 4fb4a862d285fababc67d4f2fe38036ea83bd8a9..fa71bc82342412d85fb05312b441cecb
if (is_win) {
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
index 34a269ee4d47a2597fd098bc9eabe10685f4fc86..8a96f5abc4e0092bca15dbf6e5098a64d81a3ff7 100644
index c7a777df6803678108952185a40b590bbf419859..76303e25a06ed2123bf9ac6b93b8a1e0a91273e9 100644
--- a/ui/gfx/BUILD.gn
+++ b/ui/gfx/BUILD.gn
@@ -193,6 +193,7 @@ component("gfx") {
@@ -192,6 +192,7 @@ component("gfx") {
"scoped_ns_graphics_context_save_gstate_mac.h",
"scoped_ns_graphics_context_save_gstate_mac.mm",
]
@ -265,7 +265,7 @@ index 34a269ee4d47a2597fd098bc9eabe10685f4fc86..8a96f5abc4e0092bca15dbf6e5098a64
if (is_win) {
sources += [
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
index 11515d6de3e8b017f03f4d6665f1e57b1f6dceb3..6b5c3d3a9f6cab7dcc97830f2e76c93b3ed79d8d 100644
index 01bbf457bc079c266e6110f7ad7c1ba701343312..0718cc10706de5e4b12a891eff696c80352fb9cd 100644
--- a/ui/views/BUILD.gn
+++ b/ui/views/BUILD.gn
@@ -675,6 +675,7 @@ component("views") {

Просмотреть файл

@ -9,10 +9,10 @@ potentially prevent a window from being created.
TODO(loc): this patch is currently broken.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index 87878ae6a1cfebb3c49e6ef16e35390d9197711d..166293ad0d6246bcf477e6af57a9e6801b6f6f7b 100644
index 865bed3fd2faea604d87db4a2fc1081a538686cd..6e4e9686134ba56655e28c47a215059fe76251c4 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -7777,6 +7777,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -7799,6 +7799,7 @@ void RenderFrameHostImpl::CreateNewWindow(
last_committed_origin_, params->window_container_type,
params->target_url, params->referrer.To<Referrer>(),
params->frame_name, params->disposition, *params->features,
@ -21,10 +21,10 @@ index 87878ae6a1cfebb3c49e6ef16e35390d9197711d..166293ad0d6246bcf477e6af57a9e680
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 1603b08eb7d7f423a2f968ad1f1b254261f9f6c9..87dcf40a7619ad8e9999cf07e2aa7a16e380125e 100644
index f36fb125659ffefc9d138758c2df6522169fee8f..fc91e5302297863c395982818a00e9c2946638f0 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4167,6 +4167,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4170,6 +4170,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
auto* new_contents_impl = new_contents.get();
@ -37,7 +37,7 @@ index 1603b08eb7d7f423a2f968ad1f1b254261f9f6c9..87dcf40a7619ad8e9999cf07e2aa7a16
// If the new frame has a name, make sure any SiteInstances that can find
// this named frame have proxies for it. Must be called after
// SetSessionStorageNamespace, since this calls CreateRenderView, which uses
@@ -4208,12 +4214,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4211,12 +4217,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@ -51,10 +51,10 @@ index 1603b08eb7d7f423a2f968ad1f1b254261f9f6c9..87dcf40a7619ad8e9999cf07e2aa7a16
new_contents_impl, opener, params.target_url,
params.referrer.To<Referrer>(), params.disposition,
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index 12f4a2066a2a31e9852216c0cb3344095c7b0e39..588ca46227c58f9596317d6d4d05d0b3c76cbc06 100644
index 033780b477965e6915fc808cb468598f55050f2b..51da4e464c5768d979188bb46c11565cab5a494e 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -593,6 +593,10 @@ struct CreateNewWindowParams {
@@ -597,6 +597,10 @@ struct CreateNewWindowParams {
// The navigation initiator's user activation and ad status.
blink.mojom.NavigationInitiatorActivationAndAdStatus
initiator_activation_and_ad_status;
@ -66,10 +66,10 @@ index 12f4a2066a2a31e9852216c0cb3344095c7b0e39..588ca46227c58f9596317d6d4d05d0b3
// Operation result when the renderer asks the browser to create a new window.
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 24baf87b52ab9320181a6821b57ebabc94827ddc..c89e47d453a892b16ee2ed96a95ebaa912d99210 100644
index a5ea7baed1f095c03692b42f4526db12acdceb09..25441cae5c886fae1a8c508dc7f5947281cacd3b 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -653,6 +653,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -654,6 +654,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@ -79,10 +79,10 @@ index 24baf87b52ab9320181a6821b57ebabc94827ddc..c89e47d453a892b16ee2ed96a95ebaa9
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 90fc10e2c6881788f003a4a91b0719620f7a16e4..294986a55d49a9f57592cf209b6c0db42620f61e 100644
index 3db43fde00af40df4c197146665a606dc5bf4201..8daca4d7fad172c8436b9261022c4d1114b36f07 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -166,6 +166,7 @@ class NetworkService;
@@ -167,6 +167,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
@ -90,7 +90,7 @@ index 90fc10e2c6881788f003a4a91b0719620f7a16e4..294986a55d49a9f57592cf209b6c0db4
} // namespace network
namespace sandbox {
@@ -1061,6 +1062,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1065,6 +1066,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@ -148,10 +148,10 @@ index 5da6f93293bc5ddae88c17ac2dd8d7037ba8e8f3..76d699790fb7d92587293b14332f696d
// typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents,
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 741d2e447107a34eab153d4d7cf8a600b3fac1b3..3b50524b8e33d99874dd58d78ef7c96a9eaa7205 100644
index 8bf6b5dbb8b30c3b0ac817376899f6144a92754a..64e30259cdf7c0ee27f64d3c7d383171f6be1f4b 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6295,6 +6295,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
@@ -6280,6 +6280,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
blink::GetNavigationInitiatorActivationAndAdStatus(
request.HasUserGesture(), GetWebFrame()->IsAdScriptInStack());
@ -163,10 +163,10 @@ index 741d2e447107a34eab153d4d7cf8a600b3fac1b3..3b50524b8e33d99874dd58d78ef7c96a
// moved on send.
bool is_background_tab =
diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc
index 0fe31461d3b29dde0bf3754287eed766371e10f2..d1426c424b0861b3b713cd3face4f2473a356e82 100644
index bdf18ff21a92c7cde33cb299b5c3c0a609ce2ea8..97822402213729a4204cf36c3cd42ee5f568fc21 100644
--- a/content/web_test/browser/web_test_content_browser_client.cc
+++ b/content/web_test/browser/web_test_content_browser_client.cc
@@ -497,6 +497,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -504,6 +504,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@ -210,10 +210,10 @@ index bef5a989bac50c177f15f52fe87ac3790d553e85..65dcd2e3b51929400c8bfb6a98a4fb59
} // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
index 83a6e6015d0b974dc038133948e6f436c0c8ba72..e9a85e5b1ae2d7a0d4ccb7e17792431e27ce21fe 100644
index 0fe13a68578656da5bd511ce7ea2339150080044..cd6f197dcfdd797c0cffe1194a949c8c095c20ae 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -2219,6 +2219,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
@@ -2202,6 +2202,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
WebWindowFeatures window_features =
GetWindowFeaturesFromString(features, entered_window);

Просмотреть файл

@ -1,232 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Christopher Cameron <ccameron@chromium.org>
Date: Mon, 15 May 2023 23:09:29 +0000
Subject: ui::Compositor: Propagate display ID
The display ID originates in BrowserCompositorMac (for things like
ContentShell) or in NativeWidgetMacNSWindowHost (for views).
Add it as a parameter to RecyclableCompositorMac::UpdateSurface and
use this to propagate it to ui::Compositor.
Ensure that its initial value is propagated correctly in
ui::Compositor::SetLayerTreeFrameSink.
Remove use of base::LazyInstance from BrowserCompositorMac (it is
long deprecated, and touching the file triggered presubmit failures).
Bug: 1404797
Change-Id: Ib39addd1ac2a3b2f42e1958d7ab7c6c4750224f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4517539
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Maggie Chen <magchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1144438}
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm
index 323548d3ed7be2e2572c0048dbf5f0fa464016dc..b7311c83633746855b1e7086b6824879c1870b28 100644
--- a/content/browser/renderer_host/browser_compositor_view_mac.mm
+++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -12,7 +12,7 @@
#include "base/command_line.h"
#include "base/containers/circular_deque.h"
-#include "base/lazy_instance.h"
+#include "base/no_destructor.h"
#include "base/trace_event/trace_event.h"
#include "components/viz/common/features.h"
#include "components/viz/common/surfaces/local_surface_id.h"
@@ -38,8 +38,10 @@
// signals to shut down will come in very late, long after things that the
// ui::Compositor depend on have been destroyed).
// https://crbug.com/805726
-base::LazyInstance<std::set<BrowserCompositorMac*>>::Leaky
- g_browser_compositors;
+std::set<BrowserCompositorMac*>& GetBrowserCompositors() {
+ static base::NoDestructor<std::set<BrowserCompositorMac*>> instance;
+ return *instance.get();
+}
} // namespace
@@ -54,7 +56,7 @@
: client_(client),
accelerated_widget_mac_ns_view_(accelerated_widget_mac_ns_view),
weak_factory_(this) {
- g_browser_compositors.Get().insert(this);
+ GetBrowserCompositors().insert(this);
root_layer_ = std::make_unique<ui::Layer>(ui::LAYER_SOLID_COLOR);
// Ensure that this layer draws nothing when it does not not have delegated
@@ -75,7 +77,7 @@
delegated_frame_host_.reset();
root_layer_.reset();
- size_t num_erased = g_browser_compositors.Get().erase(this);
+ size_t num_erased = GetBrowserCompositors().erase(this);
DCHECK_EQ(1u, num_erased);
}
@@ -138,9 +140,9 @@
}
if (recyclable_compositor_) {
- recyclable_compositor_->UpdateSurface(dfh_size_pixels_,
- current.device_scale_factor,
- current.display_color_spaces);
+ recyclable_compositor_->UpdateSurface(
+ dfh_size_pixels_, current.device_scale_factor,
+ current.display_color_spaces, current.display_id);
}
}
@@ -160,9 +162,9 @@
dfh_device_scale_factor_ = new_device_scale_factor;
root_layer_->SetBounds(gfx::Rect(dfh_size_dip_));
if (recyclable_compositor_) {
- recyclable_compositor_->UpdateSurface(dfh_size_pixels_,
- current.device_scale_factor,
- current.display_color_spaces);
+ recyclable_compositor_->UpdateSurface(
+ dfh_size_pixels_, current.device_scale_factor,
+ current.display_color_spaces, current.display_id);
}
}
delegated_frame_host_->EmbedSurface(
@@ -252,9 +254,9 @@
recyclable_compositor_ = std::make_unique<ui::RecyclableCompositorMac>(
content::GetContextFactory());
display::ScreenInfo current = client_->GetCurrentScreenInfo();
- recyclable_compositor_->UpdateSurface(dfh_size_pixels_,
- current.device_scale_factor,
- current.display_color_spaces);
+ recyclable_compositor_->UpdateSurface(
+ dfh_size_pixels_, current.device_scale_factor,
+ current.display_color_spaces, current.display_id);
recyclable_compositor_->compositor()->SetRootLayer(root_layer_.get());
recyclable_compositor_->compositor()->SetBackgroundColor(background_color_);
recyclable_compositor_->widget()->SetNSView(
@@ -273,9 +275,8 @@
// Ensure that the client has destroyed its BrowserCompositorViewMac before
// it dependencies are destroyed.
// https://crbug.com/805726
- while (!g_browser_compositors.Get().empty()) {
- BrowserCompositorMac* browser_compositor =
- *g_browser_compositors.Get().begin();
+ while (!GetBrowserCompositors().empty()) {
+ BrowserCompositorMac* browser_compositor = *GetBrowserCompositors().begin();
browser_compositor->client_->DestroyCompositorForShutdown();
}
}
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index c652c0dfd2e6c464c91e3522902ee96dd19b0287..e52e5b74146d0709925e87c6f4d5dc551ec8eec8 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -347,6 +347,9 @@ void Compositor::SetLayerTreeFrameSink(
display_private_->SetDisplayColorMatrix(
gfx::SkM44ToTransform(display_color_matrix_));
display_private_->SetOutputIsSecure(output_is_secure_);
+#if BUILDFLAG(IS_MAC)
+ display_private_->SetVSyncDisplayID(display_id_);
+#endif
if (has_vsync_params_) {
display_private_->SetDisplayVSyncParameters(vsync_timebase_,
vsync_interval_);
diff --git a/ui/compositor/recyclable_compositor_mac.cc b/ui/compositor/recyclable_compositor_mac.cc
index 0e30e781760d38778ec0e741ddae250e96c6d671..0c57b17778872702f887e5fe9d95dc8ad98d654f 100644
--- a/ui/compositor/recyclable_compositor_mac.cc
+++ b/ui/compositor/recyclable_compositor_mac.cc
@@ -12,6 +12,7 @@
#include "ui/compositor/compositor.h"
#include "ui/compositor/compositor_observer.h"
#include "ui/compositor/compositor_switches.h"
+#include "ui/display/types/display_constants.h"
namespace ui {
@@ -65,7 +66,8 @@ void RecyclableCompositorMac::Unsuspend() {
void RecyclableCompositorMac::UpdateSurface(
const gfx::Size& size_pixels,
float scale_factor,
- const gfx::DisplayColorSpaces& display_color_spaces) {
+ const gfx::DisplayColorSpaces& display_color_spaces,
+ int64_t display_id) {
if (size_pixels != size_pixels_ || scale_factor != scale_factor_) {
size_pixels_ = size_pixels;
scale_factor_ = scale_factor;
@@ -75,21 +77,19 @@ void RecyclableCompositorMac::UpdateSurface(
compositor()->SetScaleAndSize(scale_factor_, size_pixels_,
local_surface_id);
}
- if (display_color_spaces != display_color_spaces_) {
- display_color_spaces_ = display_color_spaces;
- compositor()->SetDisplayColorSpaces(display_color_spaces_);
- }
+ compositor()->SetDisplayColorSpaces(display_color_spaces);
+ compositor()->SetVSyncDisplayID(display_id);
}
void RecyclableCompositorMac::InvalidateSurface() {
size_pixels_ = gfx::Size();
scale_factor_ = 1.f;
local_surface_id_allocator_.Invalidate();
- display_color_spaces_ = gfx::DisplayColorSpaces();
compositor()->SetScaleAndSize(
scale_factor_, size_pixels_,
local_surface_id_allocator_.GetCurrentLocalSurfaceId());
compositor()->SetDisplayColorSpaces(gfx::DisplayColorSpaces());
+ compositor()->SetVSyncDisplayID(display::kInvalidDisplayId);
}
void RecyclableCompositorMac::OnCompositingDidCommit(
diff --git a/ui/compositor/recyclable_compositor_mac.h b/ui/compositor/recyclable_compositor_mac.h
index 891204a715de65bce5103b85490bb66de401ba0e..778842bee9395101c6f8b2c182e4b6de7a8a039e 100644
--- a/ui/compositor/recyclable_compositor_mac.h
+++ b/ui/compositor/recyclable_compositor_mac.h
@@ -49,7 +49,8 @@ class COMPOSITOR_EXPORT RecyclableCompositorMac
// Update the compositor's surface information, if needed.
void UpdateSurface(const gfx::Size& size_pixels,
float scale_factor,
- const gfx::DisplayColorSpaces& display_color_spaces);
+ const gfx::DisplayColorSpaces& display_color_spaces,
+ int64_t display_id);
private:
// Invalidate the compositor's surface information.
@@ -63,7 +64,6 @@ class COMPOSITOR_EXPORT RecyclableCompositorMac
viz::ParentLocalSurfaceIdAllocator local_surface_id_allocator_;
gfx::Size size_pixels_;
float scale_factor_ = 1.f;
- gfx::DisplayColorSpaces display_color_spaces_;
std::unique_ptr<ui::AcceleratedWidgetMac> accelerated_widget_mac_;
ui::Compositor compositor_;
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
index c6a33c2a85206295426292406291af670ce65ab0..f1f25bf0e19a918c3fcc7b7610ecf2924a880ff4 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -617,7 +617,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
content_bounds_in_screen_.size(), display_.device_scale_factor()));
compositor_->UpdateSurface(content_bounds_in_pixels,
display_.device_scale_factor(),
- display_.color_spaces());
+ display_.color_spaces(), display_.id());
}
void NativeWidgetMacNSWindowHost::DestroyCompositor() {
@@ -1173,7 +1173,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
content_bounds_in_screen_.size(), display_.device_scale_factor()));
compositor_->UpdateSurface(content_bounds_in_pixels,
display_.device_scale_factor(),
- display_.color_spaces());
+ display_.color_spaces(), display_.id());
}
if (display_id_changed) {
@@ -1187,7 +1187,6 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
if (compositor_) {
RequestVSyncParametersUpdate();
- compositor_->compositor()->SetVSyncDisplayID(display_.id());
}
}
}

Просмотреть файл

@ -1,430 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Christopher Cameron <ccameron@chromium.org>
Date: Mon, 15 May 2023 15:30:36 +0200
Subject: Use ExternalBeginFrameSourceMac on macOS
Change ExternalBeginFrameSourceMac from being a
SyntheticBeginFrameSource to being an ExternalBeginFrameSource.
Move all of the code that is responsible for updating the VSync
parameters every 10 seconds from NativeWidgetMacNSWindowHost to
ExternalBeginFrameSourceMac.
Wire up ExternalBeginFrameSourceMac::SetVSyncDisplayID to create
the DisplayLinkMac (that was previously created in
NativeWidgetMacNSWindowHost). Set the VSyncCallbackMac callback in
ExternalBeginFrameSourceMac to update the timer based VSync
parameters the same way that was done in SyntheticBeginFrameSource.
Make RootCompositorFrameSinkImpl create a ExternalBeginFrameSourceMac
instead of creating a DelayBasedBeginFrameSource.
Bug: 1404797
Change-Id: I288497d94cc66356586e8da34852d53d05cf42f3
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index 5b0a12d8b69c0b79fefcb9194e0f3fb88c4c7051..8ebcf88eadb7fbc3ce781b9094ec88f6d23134c1 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -323,6 +323,12 @@ viz_component("service") {
frameworks += [ "CoreGraphics.framework" ]
}
configs = ["//electron/build/config:mas_build"]
+ if (is_mac) {
+ sources += [
+ "frame_sinks/external_begin_frame_source_mac.cc",
+ "frame_sinks/external_begin_frame_source_mac.h",
+ ]
+ }
}
if (is_android || use_ozone) {
diff --git a/components/viz/service/frame_sinks/DEPS b/components/viz/service/frame_sinks/DEPS
index 163224a3cdb78d1eee055491c2daa7ca09fe4baa..c0e240ec70f7b7d4da92b497ac607e73d1168923 100644
--- a/components/viz/service/frame_sinks/DEPS
+++ b/components/viz/service/frame_sinks/DEPS
@@ -26,4 +26,8 @@ specific_include_rules = {
"external_begin_frame_source_android.cc": [
"+components/viz/service/service_jni_headers/ExternalBeginFrameSourceAndroid_jni.h",
],
+ "external_begin_frame_source_mac.h": [
+ "+ui/display/mac/display_link_mac.h",
+ "+ui/display/types/display_constants.h",
+ ],
}
diff --git a/components/viz/service/frame_sinks/external_begin_frame_source_mac.cc b/components/viz/service/frame_sinks/external_begin_frame_source_mac.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f5bd62e7c486b8e6bb58d59984f363867015486c
--- /dev/null
+++ b/components/viz/service/frame_sinks/external_begin_frame_source_mac.cc
@@ -0,0 +1,97 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/viz/service/frame_sinks/external_begin_frame_source_mac.h"
+
+#include <algorithm>
+#include <memory>
+#include <utility>
+
+#include "base/containers/contains.h"
+#include "base/trace_event/trace_event.h"
+
+namespace viz {
+
+ExternalBeginFrameSourceMac::ExternalBeginFrameSourceMac(
+ std::unique_ptr<DelayBasedTimeSource> time_source,
+ uint32_t restart_id)
+ : ExternalBeginFrameSource(this, restart_id),
+ time_source_(std::move(time_source)) {
+ time_source_->SetClient(this);
+}
+
+ExternalBeginFrameSourceMac::~ExternalBeginFrameSourceMac() = default;
+
+void ExternalBeginFrameSourceMac::SetDynamicBeginFrameDeadlineOffsetSource(
+ DynamicBeginFrameDeadlineOffsetSource*
+ dynamic_begin_frame_deadline_offset_source) {
+ begin_frame_args_generator_.set_dynamic_begin_frame_deadline_offset_source(
+ dynamic_begin_frame_deadline_offset_source);
+}
+
+void ExternalBeginFrameSourceMac::SetVSyncDisplayID(int64_t display_id) {
+ if (display_id_ == display_id) {
+ return;
+ }
+
+ display_id_ = display_id;
+ display_link_ = ui::DisplayLinkMac::GetForDisplay(
+ base::checked_cast<CGDirectDisplayID>(display_id_));
+ time_source_next_update_time_ = base::TimeTicks();
+ RequestTimeSourceParamsUpdate();
+}
+
+void ExternalBeginFrameSourceMac::OnNeedsBeginFrames(bool needs_begin_frames) {
+ if (needs_begin_frames_ == needs_begin_frames) {
+ return;
+ }
+ needs_begin_frames_ = needs_begin_frames;
+
+ DCHECK_NE(time_source_->Active(), needs_begin_frames_);
+ time_source_->SetActive(needs_begin_frames_);
+}
+
+void ExternalBeginFrameSourceMac::OnTimerTick() {
+ // The VSync parameters skew over time (astonishingly quickly -- 0.1 msec per
+ // second). If too much time has elapsed since the last time the vsync
+ // parameters were calculated, re-calculate them.
+ if (base::TimeTicks::Now() >= time_source_next_update_time_) {
+ RequestTimeSourceParamsUpdate();
+ }
+
+ // See comments in DelayBasedBeginFrameSource::OnTimerTick regarding the
+ // computation of `frame_time`.
+ base::TimeTicks frame_time =
+ std::max(time_source_->LastTickTime(),
+ time_source_->NextTickTime() - time_source_->Interval());
+ OnBeginFrame(begin_frame_args_generator_.GenerateBeginFrameArgs(
+ source_id(), frame_time, time_source_->NextTickTime(),
+ time_source_->Interval()));
+}
+
+void ExternalBeginFrameSourceMac::RequestTimeSourceParamsUpdate() {
+ if (!display_link_ || time_source_updater_) {
+ return;
+ }
+ time_source_updater_ = display_link_->RegisterCallback(base::BindRepeating(
+ &ExternalBeginFrameSourceMac::OnTimeSourceParamsUpdate,
+ weak_factory_.GetWeakPtr()));
+}
+
+void ExternalBeginFrameSourceMac::OnTimeSourceParamsUpdate(
+ ui::VSyncParamsMac params) {
+ time_source_next_update_time_ = base::TimeTicks::Now() + base::Seconds(10);
+ time_source_updater_ = nullptr;
+
+ if (params.display_times_valid) {
+ time_source_->SetTimebaseAndInterval(params.display_timebase,
+ params.display_interval);
+ last_timebase_ = params.display_timebase;
+ } else {
+ time_source_->SetTimebaseAndInterval(last_timebase_,
+ BeginFrameArgs::DefaultInterval());
+ }
+}
+
+} // namespace viz
diff --git a/components/viz/service/frame_sinks/external_begin_frame_source_mac.h b/components/viz/service/frame_sinks/external_begin_frame_source_mac.h
new file mode 100644
index 0000000000000000000000000000000000000000..4753f86371d97ec0470e355258bae17e10e77dcf
--- /dev/null
+++ b/components/viz/service/frame_sinks/external_begin_frame_source_mac.h
@@ -0,0 +1,74 @@
+// Copyright 2023 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_VIZ_SERVICE_FRAME_SINKS_EXTERNAL_BEGIN_FRAME_SOURCE_MAC_H_
+#define COMPONENTS_VIZ_SERVICE_FRAME_SINKS_EXTERNAL_BEGIN_FRAME_SOURCE_MAC_H_
+
+#include <memory>
+
+#include "components/viz/common/frame_sinks/begin_frame_source.h"
+#include "components/viz/service/viz_service_export.h"
+#include "ui/display/mac/display_link_mac.h"
+#include "ui/display/types/display_constants.h"
+
+namespace viz {
+
+// A begin frame source for use on macOS. This behaves like a
+// DelayBasedBeginFrameSource, but, instead of being informed externally of its
+// timebase and interval, it is informed externally of its display::DisplayId
+// and uses that to query its timebase and interval from a DisplayLinkMac.
+class VIZ_COMMON_EXPORT ExternalBeginFrameSourceMac
+ : public ExternalBeginFrameSource,
+ public ExternalBeginFrameSourceClient,
+ public DelayBasedTimeSourceClient {
+ public:
+ ExternalBeginFrameSourceMac(std::unique_ptr<DelayBasedTimeSource> time_source,
+ uint32_t restart_id);
+
+ ExternalBeginFrameSourceMac(const ExternalBeginFrameSourceMac&) = delete;
+ ExternalBeginFrameSourceMac& operator=(const ExternalBeginFrameSourceMac&) =
+ delete;
+ ~ExternalBeginFrameSourceMac() override;
+
+ // BeginFrameSource implementation.
+ void SetDynamicBeginFrameDeadlineOffsetSource(
+ DynamicBeginFrameDeadlineOffsetSource*
+ dynamic_begin_frame_deadline_offset_source) override;
+ void SetVSyncDisplayID(int64_t display_id) override;
+
+ // ExternalBeginFrameSourceClient implementation.
+ void OnNeedsBeginFrames(bool needs_begin_frames) override;
+
+ // DelayBasedTimeSourceClient implementation.
+ void OnTimerTick() override;
+
+ private:
+ // Request a callback from DisplayLinkMac, and the callback function.
+ void RequestTimeSourceParamsUpdate();
+ void OnTimeSourceParamsUpdate(ui::VSyncParamsMac params);
+
+ BeginFrameArgsGenerator begin_frame_args_generator_;
+
+ bool needs_begin_frames_ = false;
+
+ // CVDisplayLink and related structures to set timer parameters.
+ int64_t display_id_ = display::kInvalidDisplayId;
+ scoped_refptr<ui::DisplayLinkMac> display_link_;
+
+ // Timer used to drive callbacks.
+ // TODO(https://crbug.com/1404797): Only use this when it is not possible or
+ // efficient to use `display_link_`.
+ std::unique_ptr<DelayBasedTimeSource> time_source_;
+ base::TimeTicks last_timebase_;
+
+ // The callback that is used to update `time_source_`.
+ base::TimeTicks time_source_next_update_time_;
+ std::unique_ptr<ui::VSyncCallbackMac> time_source_updater_;
+
+ base::WeakPtrFactory<ExternalBeginFrameSourceMac> weak_factory_{this};
+};
+
+} // namespace viz
+
+#endif // COMPONENTS_VIZ_SERVICE_FRAME_SINKS_EXTERNAL_BEGIN_FRAME_SOURCE_MAC_H_
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
index 13962687d262434de77f76c1c5a0f39f0fd9fb43..4d07b897a158bf39d9b29e3ac90920aee3050ce0 100644
--- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
+++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
@@ -36,6 +36,10 @@
#include "components/viz/service/frame_sinks/external_begin_frame_source_ios.h"
#endif
+#if BUILDFLAG(IS_MAC)
+#include "components/viz/service/frame_sinks/external_begin_frame_source_mac.h"
+#endif
+
namespace viz {
class RootCompositorFrameSinkImpl::StandaloneBeginFrameObserver
@@ -140,6 +144,11 @@ RootCompositorFrameSinkImpl::Create(
hw_support_for_multiple_refresh_rates = true;
external_begin_frame_source =
std::make_unique<ExternalBeginFrameSourceIOS>(restart_id);
+#elif BUILDFLAG(IS_MAC)
+ external_begin_frame_source = std::make_unique<ExternalBeginFrameSourceMac>(
+ std::make_unique<DelayBasedTimeSource>(
+ base::SingleThreadTaskRunner::GetCurrentDefault().get()),
+ restart_id);
#else
if (params->disable_frame_rate_limit) {
synthetic_begin_frame_source =
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
index 0d5ef8c48f08b1eb5ed878ab8934f2ecd04083fa..30f72b9655e790d864fc7e28983b6a37074448a5 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -9,6 +9,7 @@
#import <Cocoa/Cocoa.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/graphics/IOGraphicsLib.h>
+#include <QuartzCore/CVDisplayLink.h>
#include <stdint.h>
#include <map>
@@ -27,7 +28,6 @@
#include "base/trace_event/trace_event.h"
#include "ui/display/display.h"
#include "ui/display/display_change_notifier.h"
-#include "ui/display/mac/display_link_mac.h"
#include "ui/display/util/display_util.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/icc_profile.h"
@@ -280,8 +280,22 @@ DisplayMac BuildDisplayForScreen(NSScreen* screen) {
display.set_is_monochrome(CGDisplayUsesForceToGray());
#endif
- if (auto display_link = ui::DisplayLinkMac::GetForDisplay(display_id))
- display.set_display_frequency(display_link->GetRefreshRate());
+ // Query the display's referesh rate.
+ {
+ CVDisplayLinkRef display_link = nullptr;
+ if (CVDisplayLinkCreateWithCGDisplay(display_id, &display_link) ==
+ kCVReturnSuccess) {
+ DCHECK(display_link);
+ CVTime cv_time =
+ CVDisplayLinkGetNominalOutputVideoRefreshPeriod(display_link);
+ if (!(cv_time.flags & kCVTimeIsIndefinite)) {
+ double refresh_rate = (static_cast<double>(cv_time.timeScale) /
+ static_cast<double>(cv_time.timeValue));
+ display.set_display_frequency(refresh_rate);
+ }
+ CVDisplayLinkRelease(display_link);
+ }
+ }
// CGDisplayRotation returns a double. Display::SetRotationAsDegree will
// handle the unexpected situations were the angle is not a multiple of 90.
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h
index e63b249a9bdc23545121a513156bfa32e92fec0b..e21c2df5d19bf01271bee91f792a3dbae29c55b7 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.h
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h
@@ -24,7 +24,6 @@
#include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
#include "ui/base/cocoa/accessibility_focus_overrider.h"
#include "ui/compositor/layer_owner.h"
-#include "ui/display/mac/display_link_mac.h"
#include "ui/views/cocoa/drag_drop_client_mac.h"
#include "ui/views/cocoa/native_widget_mac_event_monitor.h"
#include "ui/views/views_export.h"
@@ -421,12 +420,6 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
// ui::AcceleratedWidgetMacNSView:
void AcceleratedWidgetCALayerParamsUpdated() override;
- // If `display_link_` is valid and `display_link_updater_` does not exist,
- // create it. It will call back to OnVSyncParametersUpdated with new VSync
- // parameters.
- void RequestVSyncParametersUpdate();
- void OnVSyncParametersUpdated(ui::VSyncParamsMac params);
-
// The id that this bridge may be looked up from.
const uint64_t widget_id_;
const raw_ptr<views::NativeWidgetMac>
@@ -494,15 +487,6 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
// The display that the window is currently on.
display::Display display_;
- // Display link for getting vsync info for `display_`, and VSyncCallbackMac to
- // use for callbacks.
- scoped_refptr<ui::DisplayLinkMac> display_link_;
- std::unique_ptr<ui::VSyncCallbackMac> display_link_updater_;
-
- // Updating VSync parameters can be expensive, so set this to the next time
- // when we should update VSync parameters.
- base::TimeTicks display_link_next_update_time_;
-
// The geometry of the window and its contents view, in screen coordinates.
gfx::Rect window_bounds_in_screen_;
gfx::Rect content_bounds_in_screen_;
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
index f1f25bf0e19a918c3fcc7b7610ecf2924a880ff4..a0c9f71c5eb97091941ba7d9955854af74bd67d5 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -1163,32 +1163,19 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
void NativeWidgetMacNSWindowHost::OnWindowDisplayChanged(
const display::Display& new_display) {
- bool display_id_changed = display_.id() != new_display.id();
display_ = new_display;
- if (compositor_) {
- // Mac device scale factor is always an integer so the result here is an
- // integer pixel size.
- gfx::Size content_bounds_in_pixels =
- gfx::ToRoundedSize(gfx::ConvertSizeToPixels(
- content_bounds_in_screen_.size(), display_.device_scale_factor()));
- compositor_->UpdateSurface(content_bounds_in_pixels,
- display_.device_scale_factor(),
- display_.color_spaces(), display_.id());
+ if (!compositor_) {
+ return;
}
- if (display_id_changed) {
- display_link_ = ui::DisplayLinkMac::GetForDisplay(
- base::checked_cast<CGDirectDisplayID>(display_.id()));
- if (!display_link_) {
- // Note that on some headless systems, the display link will fail to be
- // created, so this should not be a fatal error.
- LOG(ERROR) << "Failed to create display link.";
- }
-
- if (compositor_) {
- RequestVSyncParametersUpdate();
- }
- }
+ // Mac device scale factor is always an integer so the result here is an
+ // integer pixel size.
+ gfx::Size content_bounds_in_pixels =
+ gfx::ToRoundedSize(gfx::ConvertSizeToPixels(
+ content_bounds_in_screen_.size(), display_.device_scale_factor()));
+ compositor_->UpdateSurface(content_bounds_in_pixels,
+ display_.device_scale_factor(),
+ display_.color_spaces(), display_.id());
}
void NativeWidgetMacNSWindowHost::OnWindowWillClose() {
@@ -1619,32 +1606,6 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
void NativeWidgetMacNSWindowHost::AcceleratedWidgetCALayerParamsUpdated() {
if (const auto* ca_layer_params = compositor_->widget()->GetCALayerParams())
GetNSWindowMojo()->SetCALayerParams(*ca_layer_params);
-
- // The VSync parameters skew over time (astonishingly quickly -- 0.1 msec per
- // second). If too much time has elapsed since the last time the vsync
- // parameters were calculated, re-calculate them.
- if (base::TimeTicks::Now() >= display_link_next_update_time_) {
- RequestVSyncParametersUpdate();
- }
-}
-
-void NativeWidgetMacNSWindowHost::RequestVSyncParametersUpdate() {
- if (!display_link_ || display_link_updater_) {
- return;
- }
- display_link_updater_ = display_link_->RegisterCallback(base::BindRepeating(
- &NativeWidgetMacNSWindowHost::OnVSyncParametersUpdated,
- weak_factory_for_vsync_update_.GetWeakPtr()));
-}
-
-void NativeWidgetMacNSWindowHost::OnVSyncParametersUpdated(
- ui::VSyncParamsMac params) {
- if (compositor_ && params.display_times_valid) {
- compositor_->compositor()->SetDisplayVSyncParameters(
- params.display_timebase, params.display_interval);
- display_link_next_update_time_ = base::TimeTicks::Now() + base::Seconds(10);
- }
- display_link_updater_ = nullptr;
}
} // namespace views

Просмотреть файл

@ -6,10 +6,10 @@ Subject: chore: add electron deps to gitignores
Makes things like "git status" quicker when developing electron locally
diff --git a/.gitignore b/.gitignore
index 45a7f0076b3c39a1f1fb60e6b8b232a0d30f0113..8513e03038912fb57acfe8900bd0ec6b33b5e3f1 100644
index 36fd6c0ff5673343258fd6eee4a79227aa4e52b5..3c2bfca45ff7012d953fc67f9fb01be67d41b35b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -239,6 +239,7 @@ vs-chromium-project.txt
@@ -240,6 +240,7 @@ vs-chromium-project.txt
/delegate_execute
/device/serial/device_serial_mojo.xml
/docs/website
@ -18,10 +18,10 @@ index 45a7f0076b3c39a1f1fb60e6b8b232a0d30f0113..8513e03038912fb57acfe8900bd0ec6b
/google_apis/internal
/googleurl
diff --git a/third_party/.gitignore b/third_party/.gitignore
index 9978d8b8756ed8557275d2556cdc493eec94c7f1..58a3f97ea420d19c26a4e5e604730f0244e62283 100644
index 242aa829efed37a00046ba2c72a5511855799cd9..8546bcfa6505686f2699f8c9ff63b4b114eb9831 100644
--- a/third_party/.gitignore
+++ b/third_party/.gitignore
@@ -90,6 +90,7 @@
@@ -92,6 +92,7 @@
/directxsdk
/dom_distiller_js/dist
/eigen3/src
@ -29,7 +29,7 @@ index 9978d8b8756ed8557275d2556cdc493eec94c7f1..58a3f97ea420d19c26a4e5e604730f02
/elfutils/src
/emoji-metadata/src
/emoji-segmenter/src
@@ -197,6 +198,7 @@
@@ -199,6 +200,7 @@
/mocha
/mockito/src
/nacl_sdk_binaries/
@ -37,7 +37,7 @@ index 9978d8b8756ed8557275d2556cdc493eec94c7f1..58a3f97ea420d19c26a4e5e604730f02
/nasm
/nearby/src
/neon_2_sse/src
@@ -264,6 +266,7 @@
@@ -266,6 +268,7 @@
/speex
/sqlite/src
/sqlite4java/lib/

Просмотреть файл

@ -7,7 +7,7 @@ This patch comes after Chromium removed the ScopedAllowIO API in favor
of explicitly adding ScopedAllowBlocking calls as friends.
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
index 4c9ff4452fa14cbd639207169afbf3e0ea663e2b..d6487da03dd6595272d63e0930e956948791b722 100644
index 536ee9714219fd373567b80071f453cee896060f..28764535cf3724028bd76edf036e02045c8f02c3 100644
--- a/base/threading/thread_restrictions.h
+++ b/base/threading/thread_restrictions.h
@@ -133,6 +133,7 @@ class FirefoxProfileLock;
@ -28,7 +28,7 @@ index 4c9ff4452fa14cbd639207169afbf3e0ea663e2b..d6487da03dd6595272d63e0930e95694
namespace enterprise_connectors {
class LinuxKeyRotationCommand;
} // namespace enterprise_connectors
@@ -579,6 +583,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
@@ -580,6 +584,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
friend class ::DesktopNotificationBalloon;
friend class ::FirefoxProfileLock;
friend class ::GaiaConfig;
@ -36,7 +36,7 @@ index 4c9ff4452fa14cbd639207169afbf3e0ea663e2b..d6487da03dd6595272d63e0930e95694
friend class ::ProfileImpl;
friend class ::ScopedAllowBlockingForProfile;
friend class ::StartupTabProviderImpl;
@@ -616,6 +621,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
@@ -617,6 +622,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
friend class crosapi::LacrosThreadTypeDelegate;
friend class crypto::ScopedAllowBlockingForNSS; // http://crbug.com/59847
friend class drive::FakeDriveService;

Просмотреть файл

@ -14,10 +14,10 @@ This change patches it out to prevent the DCHECK.
It can be removed once/if we see a better solution to the problem.
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index dba7e73e0fa8ee64ebb9e349417a401533708754..43fff8314998023a43634f4f9bc73542ec7e604f 100644
index a54616dcb3fcb29cc1115c52cf4b70f3723cc2cf..819e58dd173aa4f71995618e34e2d5d102f74578 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -204,7 +204,7 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForGuest(
@@ -203,7 +203,7 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForGuest(
BrowserContext* browser_context,
const StoragePartitionConfig& partition_config) {
DCHECK(browser_context);

Просмотреть файл

@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <charles@charleskerr.com>
Date: Wed, 17 May 2023 14:42:09 -0500
Subject: chore: patch out Profile methods in chrome_browser_pdf
Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4482679
Electron does not support Profiles, so this Profile::FromBrowserContext()
call is not needed and will not link. This change patches it out.
diff --git a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
index 080e5b64e5fbbe9c126996549dddf7ce312998ee..47a026798a6be7ec8b7cde5b55b29d505d4f2e4c 100644
--- a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
+++ b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
@@ -39,6 +39,7 @@ namespace {
// hierarchy is: enterprise policy > user choice > finch experiment.
bool ShouldEnableSkiaRenderer(content::WebContents* contents) {
CHECK(contents);
+#if 0
const PrefService* prefs =
Profile::FromBrowserContext(contents->GetBrowserContext())->GetPrefs();
@@ -46,6 +47,7 @@ bool ShouldEnableSkiaRenderer(content::WebContents* contents) {
if (prefs->IsManagedPreference(prefs::kPdfUseSkiaRendererEnabled)) {
return prefs->GetBoolean(prefs::kPdfUseSkiaRendererEnabled);
}
+#endif
// When the enterprise policy is not set, use finch/feature flag choice.
return base::FeatureList::IsEnabled(

Просмотреть файл

@ -8,20 +8,20 @@ is therefore not a method that will compile given we don't include
relevant files.
diff --git a/chrome/browser/profiles/profile_selections.cc b/chrome/browser/profiles/profile_selections.cc
index 10aa2b39d4033d92fe7502532a497d394c4351d9..23e70eb0b6f49b164ffe615b32d2821e83753658 100644
index 7e0a4eb93ac9444d760d13736c1a2f6381fc3a7b..d5e45f27144ee4b05b82d699071eaa0780c9401d 100644
--- a/chrome/browser/profiles/profile_selections.cc
+++ b/chrome/browser/profiles/profile_selections.cc
@@ -18,6 +18,7 @@ BASE_FEATURE(kSystemProfileSelectionDefaultNone,
base::FeatureState::FEATURE_ENABLED_BY_DEFAULT);
@@ -14,6 +14,7 @@
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
bool AreKeyedServicesDisabledForProfileByDefault(const Profile* profile) {
+#if 0
// By default disable all services for System Profile.
// Even though having no services is also the default value for Guest Profile,
// this is not really the case in practice because a lot of Service Factories
@@ -21,7 +22,7 @@ bool AreKeyedServicesDisabledForProfileByDefault(const Profile* profile) {
if (profile && profile->IsSystemProfile()) {
// The default behavior of the system profile selection depends on the value
// of `kSystemProfileSelectionDefaultNone` feature flag.
@@ -28,7 +29,7 @@ bool AreKeyedServicesDisabledForProfileByDefault(const Profile* profile) {
return system_profile_default == ProfileSelection::kNone;
return true;
}
-
+#endif

Просмотреть файл

@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Charles Kerr <charles@charleskerr.com>
Date: Thu, 18 May 2023 22:43:53 -0500
Subject: chore: patch out Profile methods in titlebar_config
Make this code linkable in Electron by removing Profile references.
diff --git a/chrome/browser/win/titlebar_config.cc b/chrome/browser/win/titlebar_config.cc
index c270ecf428b85ff95835d8a9f6219d98113743a9..dd55d15add870fa8dfcef0b193a55af679ba6737 100644
--- a/chrome/browser/win/titlebar_config.cc
+++ b/chrome/browser/win/titlebar_config.cc
@@ -21,8 +21,10 @@ BASE_FEATURE(kWindows11MicaTitlebar,
bool ShouldBrowserCustomDrawTitlebar(BrowserView* browser_view) {
return !ShouldDefaultThemeUseMicaTitlebar() ||
+#if 0
!ThemeServiceFactory::GetForProfile(browser_view->GetProfile())
->UsingSystemTheme() ||
+#endif
(!browser_view->browser()->is_type_normal() &&
!browser_view->browser()->is_type_popup() &&
!browser_view->browser()->is_type_devtools());

Просмотреть файл

@ -35,10 +35,10 @@ index 155296ba7ee5495be62045bc620bb1cd31d3ceb3..954efde9e7a58f8b556c6ceabb81643f
content::RenderFrameHost* requesting_frame,
const blink::mojom::FullscreenOptions& options) final;
diff --git a/chrome/browser/ui/ash/ash_web_view_impl.cc b/chrome/browser/ui/ash/ash_web_view_impl.cc
index 75330f607c55ce38779150a512f7c1b249dbfa39..788613af709434e086360a5a383fa7c1bb3fa517 100644
index 034562cbb05f21eec3ddf9c23f4d36182b032218..1273134d7a4c80e8be07fcb41c2318cc53c9c9e0 100644
--- a/chrome/browser/ui/ash/ash_web_view_impl.cc
+++ b/chrome/browser/ui/ash/ash_web_view_impl.cc
@@ -96,10 +96,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
@@ -100,10 +100,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@ -52,10 +52,10 @@ index 75330f607c55ce38779150a512f7c1b249dbfa39..788613af709434e086360a5a383fa7c1
/*from_user_gesture=*/true);
return true;
diff --git a/chrome/browser/ui/ash/ash_web_view_impl.h b/chrome/browser/ui/ash/ash_web_view_impl.h
index 68fec72b3b97a18563fade50dd129eba49a86bb6..d3d4af06542c73c61cf8b8ee510a0345ba666739 100644
index 257b34f41d2ae2743704484aa3a7c6e4bf1b8b34..6452a5ee6676827297842e2845614aa2b05f4d81 100644
--- a/chrome/browser/ui/ash/ash_web_view_impl.h
+++ b/chrome/browser/ui/ash/ash_web_view_impl.h
@@ -49,8 +49,7 @@ class AshWebViewImpl : public ash::AshWebView,
@@ -50,8 +50,7 @@ class AshWebViewImpl : public ash::AshWebView,
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@ -80,10 +80,10 @@ index aaaa61d5c3a1d5ade2fd355e38a3985ef5cc4e7d..b45746ba0f38a381a2ee5ca17f3a1685
}
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index a4623532f5eb5ce0a77c726ccc47f4fe6b24c42c..7f1c80ab40988510659e56d3dc00c68e51d6c10c 100644
index 71297e151bb627819fda507a4d28488d93216e7e..76948a3c16a107c7455e97f787393ad8e8f2224c 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1859,12 +1859,11 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -1858,12 +1858,11 @@ bool Browser::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@ -218,10 +218,10 @@ index 4e32d708ecf4afd3913d86ec1602ef2dc9a60998..1dd2f50fba1387b5eeb554dd540957d7
void AddNewContents(content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 3faa83e00bfd72eebfac1290846bba1452b85bdb..57a810427461b8240d5f8da88e6ae2815b06c69a 100644
index 62bdbaae3dc3d320dfd038282f3946fab5abd0b9..9dee22f645596fd2c2494c1f532e972099d89b2b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4074,8 +4074,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4077,8 +4077,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
source_site_instance, params.window_container_type,

Просмотреть файл

@ -0,0 +1,111 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Mon, 22 May 2023 13:23:57 +0200
Subject: chore: temporarily patch out ARC references
https://chromium-review.googlesource.com/c/chromium/src/+/4546398
Electron does not support ARC yet.
diff --git a/chrome/browser/icon_loader_mac.mm b/chrome/browser/icon_loader_mac.mm
index f6acf1369c2ca37687b4f4cd6b3b5763a29c07e7..3443e1597339ebd291517da52c945ae15d1392ce 100644
--- a/chrome/browser/icon_loader_mac.mm
+++ b/chrome/browser/icon_loader_mac.mm
@@ -18,9 +18,9 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_util_mac.h"
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
+// #if !defined(__has_feature) || !__has_feature(objc_arc)
+// #error "This file requires ARC support."
+// #endif
// static
IconLoader::IconGroup IconLoader::GroupForFilepath(
diff --git a/chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm b/chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm
index d9c0ffb9d3a775774545f2b0ddf35f4465a9f641..fbd51a74acfc7fec809fcd19706ae4017f0ece66 100644
--- a/chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm
+++ b/chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm
@@ -22,9 +22,9 @@
#include "media/base/media_switches.h"
#include "ui/base/cocoa/permissions_utils.h"
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
+// #if !defined(__has_feature) || !__has_feature(objc_arc)
+// #error "This file requires ARC support."
+// #endif
namespace system_media_permissions {
diff --git a/chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.mm b/chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.mm
index c8ab96a87f5e5203223bdbbf45f68b1d00226585..2c46f06d1dfd566f7e76b9d7291414c1dcdd06c6 100644
--- a/chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.mm
+++ b/chrome/browser/media/webrtc/system_media_capture_permissions_stats_mac.mm
@@ -10,9 +10,9 @@
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
+// #if !defined(__has_feature) || !__has_feature(objc_arc)
+// #error "This file requires ARC support."
+// #endif
namespace system_media_permissions {
diff --git a/chrome/browser/media/webrtc/window_icon_util_mac.mm b/chrome/browser/media/webrtc/window_icon_util_mac.mm
index b075efd130f996d01ce8204921832d02c476dfce..3b1933aa037610ca0ab9ebf969c80fea3ac0a5a3 100644
--- a/chrome/browser/media/webrtc/window_icon_util_mac.mm
+++ b/chrome/browser/media/webrtc/window_icon_util_mac.mm
@@ -11,9 +11,9 @@
#include "third_party/libyuv/include/libyuv/convert_argb.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
+// #if !defined(__has_feature) || !__has_feature(objc_arc)
+// #error "This file requires ARC support."
+// #endif
gfx::ImageSkia GetWindowIcon(content::DesktopMediaID id) {
DCHECK(id.type == content::DesktopMediaID::TYPE_WINDOW);
diff --git a/chrome/browser/platform_util_mac.mm b/chrome/browser/platform_util_mac.mm
index 57eac7e0e9a83609701c6d5d9760112f6227b4df..03955f351cc0024cabd0a83f5e243071a95ce0fb 100644
--- a/chrome/browser/platform_util_mac.mm
+++ b/chrome/browser/platform_util_mac.mm
@@ -20,9 +20,9 @@
#include "ui/views/widget/widget.h"
#include "url/gurl.h"
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
+// #if !defined(__has_feature) || !__has_feature(objc_arc)
+// #error "This file requires ARC support."
+// #endif
namespace platform_util {
diff --git a/chrome/browser/process_singleton_mac.mm b/chrome/browser/process_singleton_mac.mm
index c92f894bbc99718747bff420e1713198d0f7a2b8..032dfb8823918da92aabf6601e493b8bbf003003 100644
--- a/chrome/browser/process_singleton_mac.mm
+++ b/chrome/browser/process_singleton_mac.mm
@@ -9,9 +9,9 @@
#include "base/mac/scoped_aedesc.h"
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
+// #if !defined(__has_feature) || !__has_feature(objc_arc)
+// #error "This file requires ARC support."
+// #endif
namespace {

Просмотреть файл

@ -89,10 +89,10 @@ index 99efa6b245b9944710b76a342ec9a37947078a48..e55df93f17560a566e1dd2a63c560054
annotations, arguments, false, false));
} else {
diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm
index cab2c95eee53e6c406d6867b0a6e53a3a9fb5ce3..46935fcbf84cf1472214904cf96b03aa0e57be8f 100644
index d7351f4a912b36bb541c59a408bae85dda537fc4..49e3e819f51621ce9b5f52eeed561983533783c8 100644
--- a/components/crash/core/app/crashpad_mac.mm
+++ b/components/crash/core/app/crashpad_mac.mm
@@ -85,6 +85,8 @@
@@ -91,6 +91,8 @@
} // @autoreleasepool
return process_annotations;
}();
@ -101,7 +101,7 @@ index cab2c95eee53e6c406d6867b0a6e53a3a9fb5ce3..46935fcbf84cf1472214904cf96b03aa
return annotations;
}
@@ -155,6 +157,13 @@ bool PlatformCrashpadInitialization(
@@ -161,6 +163,13 @@ bool PlatformCrashpadInitialization(
std::vector<std::string> arguments;

Просмотреть файл

@ -7,7 +7,7 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This
to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`.
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
index d2ca2effde6f7523518c1531f86506c4f619797e..287abd4623f56ef00354c5892b3b6ac15786e915 100644
index 77a9818606c3e2cde6f74d5009a05a851b6295e9..41dbb00019c076d038380862c4953e6f2b6e2275 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -39,6 +39,7 @@
@ -18,7 +18,7 @@ index d2ca2effde6f7523518c1531f86506c4f619797e..287abd4623f56ef00354c5892b3b6ac1
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/single_thread_task_runner.h"
@@ -257,8 +258,13 @@ std::string GetSnapshotDataDescriptor(const base::CommandLine& command_line) {
@@ -258,8 +259,13 @@ std::string GetSnapshotDataDescriptor(const base::CommandLine& command_line) {
#endif
@ -33,7 +33,7 @@ index d2ca2effde6f7523518c1531f86506c4f619797e..287abd4623f56ef00354c5892b3b6ac1
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
base::FileDescriptorStore& file_descriptor_store =
base::FileDescriptorStore::GetInstance();
@@ -287,11 +293,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
@@ -288,11 +294,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
#endif // V8_USE_EXTERNAL_STARTUP_DATA
@ -48,7 +48,7 @@ index d2ca2effde6f7523518c1531f86506c4f619797e..287abd4623f56ef00354c5892b3b6ac1
#endif // V8_USE_EXTERNAL_STARTUP_DATA
}
@@ -965,7 +972,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
@@ -966,7 +973,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
return TerminateForFatalInitializationError();
#endif // BUILDFLAG(IS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
@ -102,10 +102,10 @@ index d4bb0e9a017a833b403916e1d6e64fb058f40f86..35ba35a95e39700824d6e0b480b99bc3
friend class ContentClientCreator;
friend class ContentClientInitializer;
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index 8a0a8c4f678c017d455981d723eff04d2463082a..40681f43a238784a7bd4540019e8878cbc99a63d 100644
index 0d56182a284b91e7bf5749dbf0796cbe705d2c1f..a7578102abc92cba4334459f540776dc2463cdb5 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -507,8 +507,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
@@ -514,8 +514,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
@ -115,7 +115,7 @@ index 8a0a8c4f678c017d455981d723eff04d2463082a..40681f43a238784a7bd4540019e8878c
if (g_mapped_snapshot) {
// TODO(crbug.com/802962): Confirm not loading different type of snapshot
// files in a process.
@@ -517,10 +516,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
@@ -524,10 +523,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
base::MemoryMappedFile::Region file_region;
base::File file =

Просмотреть файл

@ -17,10 +17,10 @@ only one or two specific checks fail. Then it's better to simply comment out the
failing checks and allow the rest of the target to have them enabled.
diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
index 5586af89bd658796a803c9b6098036b8266615d8..0af8417bd9440cb003ded58961a9fcd8366dd9e0 100644
index 419781eac524f82d746f86d44dad9a3d25f31d49..1b1e0d59222d69c30edef87a96f85d78adee10d3 100644
--- a/ui/base/clipboard/clipboard_win.cc
+++ b/ui/base/clipboard/clipboard_win.cc
@@ -888,10 +888,10 @@ SkBitmap ClipboardWin::ReadBitmapInternal(ClipboardBuffer buffer) const {
@@ -901,10 +901,10 @@ SkBitmap ClipboardWin::ReadBitmapInternal(ClipboardBuffer buffer) const {
void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
UINT cf_format = format.ToFormatEtc().cfFormat;

Просмотреть файл

@ -20,7 +20,7 @@ to deal with color spaces. That is being tracked at
https://crbug.com/634542 and https://crbug.com/711107.
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 16117d0b40245282ed59a8b9c0cebddc3b2e288c..dd03e12e2b2069e426401ec91a3070e0a2dc0de7 100644
index 7fe522215517ed9ac20f9895992b0b6bd1e1352c..58718799cc95768b897d94e12a4022c78ef84b54 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1919,6 +1919,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
@ -35,7 +35,7 @@ index 16117d0b40245282ed59a8b9c0cebddc3b2e288c..dd03e12e2b2069e426401ec91a3070e0
// If we are likely to software composite the resource, we use sRGB because
// software compositing is unable to perform color conversion.
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
index b85b3251a752afc1305108ad370bbe8453e4f789..e24eefabacf2fcdbd15b26e0c696579cca909dd8 100644
index 0d966e045669ee0423d6a486fa8e619938a32de2..1e46ecc1aa8447b3fd0f4e5a66f92ca5ef148887 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -96,6 +96,8 @@ class CC_EXPORT LayerTreeSettings {
@ -93,10 +93,10 @@ index 110f05ece2064a253683cf0bf52e554788c9c660..49bf6c8f4e0f198b2c7b2b1d7cf04bcb
sandbox::policy::switches::kGpuSandboxAllowSysVShm,
sandbox::policy::switches::kGpuSandboxFailuresFatal,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 88492051b80ed4a989cb9fdf8231a38534ea4c7e..58996935d6c62bec7e090e7bed50fc870bdb46fd 100644
index 15effd78c0a10f13dbd17b18daa12456a6bc19ae..bd563e0b55f707f1c72c221257e968320302895e 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -3350,6 +3350,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
@@ -3392,6 +3392,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
// Propagate the following switches to the renderer command line (along
// with any associated values) if present in the browser command line.
static const char* const kSwitchNames[] = {
@ -148,7 +148,7 @@ index 318005b66e04ed03ce6d44931d9360c0e009cb94..0d622fddb95720141ccf8a285ace4714
}
diff --git a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
index 3ebaee0026affd8a9eb4cf36432cbefc13db8f3b..0a38a4a281b5b90fea38b6a2662ec5da0087f134 100644
index 2a31606b1f5814d57ffe59026cc5735fa7cee597..272ae9f414f8d0873e30479b5bfd237c13a69dd9 100644
--- a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
+++ b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
@@ -25,6 +25,7 @@
@ -213,7 +213,7 @@ index 95d74c90b324760a0fafcf92fe3f40071ffa0187..cb138579bdb5b552a198d47fde220d81
IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB);
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
index cbdfb60d42cb16848847eba67937b95b3504bedf..16c8ff102070ce75c518f8d444cae1e51580d0b4 100644
index df3caf8fab7a1c1f6bc0efa4fd3dd60b9de66e63..ac254ec1317450a9809da5d244c42fa11a3a4f98 100644
--- a/ui/gfx/switches.cc
+++ b/ui/gfx/switches.cc
@@ -13,6 +13,8 @@ namespace switches {
@ -226,7 +226,7 @@ index cbdfb60d42cb16848847eba67937b95b3504bedf..16c8ff102070ce75c518f8d444cae1e5
// sharpness, kerning, hinting and layout.
const char kDisableFontSubpixelPositioning[] =
diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h
index df3520997950911ab8dcd81f654016b2f726ce7d..ac38f23312eef89fb9e2614744c7226fc7091bad 100644
index ebeb73e7f679280297a09332612a83181e24a4e1..79ec8deb0cab719b344a4964221c10725bd066e7 100644
--- a/ui/gfx/switches.h
+++ b/ui/gfx/switches.h
@@ -13,6 +13,7 @@
@ -235,5 +235,5 @@ index df3520997950911ab8dcd81f654016b2f726ce7d..ac38f23312eef89fb9e2614744c7226f
GFX_SWITCHES_EXPORT extern const char kAnimationDurationScale[];
+GFX_SWITCHES_EXPORT extern const char kDisableColorCorrectRendering[];
GFX_SWITCHES_EXPORT extern const char kDisableFontSubpixelPositioning[];
GFX_SWITCHES_EXPORT extern const char kDisablePPAPISharedImagesSwapChain[];
GFX_SWITCHES_EXPORT extern const char kEnableNativeGpuMemoryBuffers[];
GFX_SWITCHES_EXPORT extern const char kForcePrefersReducedMotion[];

Просмотреть файл

@ -6,12 +6,12 @@ Subject: disable_hidden.patch
Electron uses this to disable background throttling for hidden windows.
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index e45129c031d9cecd8838483ea6ba23436d59bab3..347b8d89a2ecaa6baa4779f650b8af49a6d6d118 100644
index 48e6fa3d8447e87ab2a729aa950cc5029c875673..90c6a5b6999571819ef71f859767cccf635ea883 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -800,6 +800,9 @@ void RenderWidgetHostImpl::WasHidden() {
if (is_hidden_)
@@ -812,6 +812,9 @@ void RenderWidgetHostImpl::WasHidden() {
return;
}
+ if (disable_hidden_)
+ return;
@ -20,7 +20,7 @@ index e45129c031d9cecd8838483ea6ba23436d59bab3..347b8d89a2ecaa6baa4779f650b8af49
blink::mojom::PointerLockResult::kWrongDocument);
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 308f116c4c2d746dc5da7e52f0e21e9608970db1..968a1a778d01c3ab6738ed8a3982152e2fe5809b 100644
index fd91b2f2519383ca39342937e7c89ce35ce363a7..0fac80ecc97cb6c7ff3942a311983baa397fee0d 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -900,6 +900,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@ -33,7 +33,7 @@ index 308f116c4c2d746dc5da7e52f0e21e9608970db1..968a1a778d01c3ab6738ed8a3982152e
protected:
// |routing_id| must not be MSG_ROUTING_NONE.
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index c295b6c6bd54f6e537775ce7fbee2a256873cd60..b69ec986a4d8a96677d785cb6768f0c0d154ff2a 100644
index 680ac2d851294bffa8af216568421a4dd5c01750..82e59b02f6e54f9101e3b9ea5ca0f5b21ce16095 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -607,7 +607,7 @@ void RenderWidgetHostViewAura::HideImpl() {

Просмотреть файл

@ -24,10 +24,10 @@ This patch temporarily disables the metrics so we can have green CI, and we
should continue seeking for a real fix.
diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc
index 0e23c0358cf11cdcfd555603aa2e416be3af850a..cebbec3d9a7aed408ae3e7f7c5aa28ab32989e89 100644
index 057902f871fd474bdd029ce4797bc054a803a510..d41b8bbe37445be23690d69119bb7f722d9db5bd 100644
--- a/content/browser/renderer_host/navigator.cc
+++ b/content/browser/renderer_host/navigator.cc
@@ -1244,6 +1244,7 @@ void Navigator::RecordNavigationMetrics(
@@ -1257,6 +1257,7 @@ void Navigator::RecordNavigationMetrics(
.InMilliseconds());
}
@ -35,7 +35,7 @@ index 0e23c0358cf11cdcfd555603aa2e416be3af850a..cebbec3d9a7aed408ae3e7f7c5aa28ab
// If this is a same-process navigation and we have timestamps for unload
// durations, fill those metrics out as well.
if (params.unload_start && params.unload_end &&
@@ -1293,6 +1294,7 @@ void Navigator::RecordNavigationMetrics(
@@ -1306,6 +1307,7 @@ void Navigator::RecordNavigationMetrics(
first_before_unload_start_time)
.InMilliseconds());
}

Просмотреть файл

@ -9,24 +9,24 @@ correctly tagged with MAP_JIT we need to use gins page allocator instead
of the default V8 allocator. This probably can't be usptreamed.
diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h
index 9c3575725576cddf90e5681a52342f6b8d345bd1..f89ff175d2adf88c16167e8f306c9d3451afe94f 100644
index 565f531328041edaac847d02881cce6e1e4f7d54..5a40be3acb11c5851daa9f8001e6a176c2d20ab1 100644
--- a/gin/public/v8_platform.h
+++ b/gin/public/v8_platform.h
@@ -31,6 +31,7 @@ class GIN_EXPORT V8Platform : public v8::Platform {
@@ -32,6 +32,7 @@ class GIN_EXPORT V8Platform : public v8::Platform {
// enabling Arm's Branch Target Instructions for executable pages. This is
// verified in the tests for gin::PageAllocator.
PageAllocator* GetPageAllocator() override;
+ static PageAllocator* GetCurrentPageAllocator();
void OnCriticalMemoryPressure() override;
v8::ZoneBackingAllocator* GetZoneBackingAllocator() override;
#if BUILDFLAG(ENABLE_THREAD_ISOLATION)
ThreadIsolatedAllocator* GetThreadIsolatedAllocator() override;
#endif
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc
index 2cf6d986102904e3aa44b3333938b3bfcbc87470..f40799e5ae37f96ec5f3c8ae2ee73776783b0e5f 100644
index a0bc00a3d1397934276517c19e0a76098b7099f5..7432989344148480bc4ff5f8808cf588ec45b868 100644
--- a/gin/v8_platform.cc
+++ b/gin/v8_platform.cc
@@ -330,6 +330,10 @@ PageAllocator* V8Platform::GetPageAllocator() {
return g_page_allocator.Pointer();
@@ -338,6 +338,10 @@ ThreadIsolatedAllocator* V8Platform::GetThreadIsolatedAllocator() {
}
#endif // BUILDFLAG(ENABLE_THREAD_ISOLATION)
+PageAllocator* V8Platform::GetCurrentPageAllocator() {
+ return g_page_allocator.Pointer();

Просмотреть файл

@ -6,10 +6,10 @@ Subject: expose V8Initializer::CodeGenerationCheckCallbackInMainThread
This is needed to blend Blink and Node's policy for code generation policy.
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
index 491fe7c8cda4899c37ad98da2b6daffc03944942..42ccef313e33f233342a8bd7bd5e4f0bc3847e85 100644
index 6cc93de0150bebc10cee83aadc3a643eb8e84ce7..ec992270b6aa54e4507ad0bad501793f72353834 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -444,8 +444,9 @@ TrustedTypesCodeGenerationCheck(v8::Local<v8::Context> context,
@@ -439,8 +439,9 @@ TrustedTypesCodeGenerationCheck(v8::Local<v8::Context> context,
return {true, V8String(context->GetIsolate(), stringified_source)};
}

Просмотреть файл

@ -12,7 +12,7 @@ Ideally we could add an embedder observer pattern here but that can be
done in future work.
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index 55650ca27d81d09f9ad315b699cade5a6d7eaca9..6fcf69200ed29b290be4e3dcbb9caabf02c1b520 100644
index acda9f8ea1789d3febc0386ae855c009ea462816..a4c7852daaf4ddef3c82150cf91ab1047de92eb5 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -165,6 +165,7 @@
@ -23,7 +23,7 @@ index 55650ca27d81d09f9ad315b699cade5a6d7eaca9..6fcf69200ed29b290be4e3dcbb9caabf
#include "third_party/blink/renderer/platform/graphics/image.h"
#include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h"
@@ -1759,6 +1760,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
@@ -1764,6 +1765,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
#if BUILDFLAG(IS_MAC)
web_view_impl->SetMaximumLegibleScale(
prefs.default_maximum_page_scale_factor);

Просмотреть файл

@ -26,7 +26,7 @@ index 4c60eb7caf5eddbdb71b753c710c7053476bee04..88dd58492d84c6da4f179a5ef651923a
}
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index f95db55b9899b7314792c99fad87e29530715d11..16f7d5c92e4380c7a705eaa6dc7bc11349d7f7f2 100644
index a337d8ff4ed81dae4455af01cc9dc72356a31f82..ca9318f403ce9e80b28b107a47f67405663e8775 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -410,6 +410,23 @@ class NATIVE_THEME_EXPORT NativeTheme {

Просмотреть файл

@ -84,7 +84,7 @@ index 6d8aa39ab75edcba3e34134566c9fcbe56a7ec57..30912cc39806b13c47b85ba1bfc848a2
DCHECK(GetZygoteForLaunch());
// Environment variables could be supported in the future, but are not
diff --git a/content/browser/child_process_launcher_helper_mac.cc b/content/browser/child_process_launcher_helper_mac.cc
index 7bac4c30d0be2d89335a3f77ac7fd84d120ca4ce..39b3927d42fe65563a2d4bb735c9432f1e8c386f 100644
index 37eb06424d5ab1fc1919dc1cde603d9287014cab..08cd71c5669de94c8aebfc37849cadfcf838cf75 100644
--- a/content/browser/child_process_launcher_helper_mac.cc
+++ b/content/browser/child_process_launcher_helper_mac.cc
@@ -123,7 +123,8 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
@ -97,7 +97,7 @@ index 7bac4c30d0be2d89335a3f77ac7fd84d120ca4ce..39b3927d42fe65563a2d4bb735c9432f
options->disclaim_responsibility = delegate_->DisclaimResponsibility();
options->enable_cpu_security_mitigations =
delegate_->EnableCpuSecurityMitigations();
@@ -184,6 +185,11 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
@@ -187,6 +188,11 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
base::StringPrintf("%s%d", sandbox::switches::kSeatbeltClient, pipe));
}
@ -163,13 +163,13 @@ index fee8640ccee0a24e1f1e282e9bad3a26bd721df8..4b6a3e7aaf686ea23500b7e051156e59
}
diff --git a/content/browser/service_process_host_impl.cc b/content/browser/service_process_host_impl.cc
index 4d4c17b8fe687e01f7403335c88453998259d647..22c1e5fd0c6f16a101b2578675704f185e812791 100644
index 01e62d7e8df65efb900e9cd0d34bcd8e0ed3e7da..9af6784707f125046d9a734165fc2b08cf3c97bf 100644
--- a/content/browser/service_process_host_impl.cc
+++ b/content/browser/service_process_host_impl.cc
@@ -198,6 +198,15 @@ void LaunchServiceProcess(mojo::GenericPendingReceiver receiver,
host->SetExtraCommandLineSwitches(std::move(options.extra_switches));
if (options.child_flags)
host->set_child_flags(*options.child_flags);
@@ -208,6 +208,15 @@ void LaunchServiceProcess(mojo::GenericPendingReceiver receiver,
host->SetPinUser32();
}
#endif // BUILDFLAG(IS_WIN)
+#if BUILDFLAG(IS_WIN)
+ host->SetStdioHandles(std::move(options.stdout_handle), std::move(options.stderr_handle));
+#elif BUILDFLAG(IS_POSIX)
@ -183,7 +183,7 @@ index 4d4c17b8fe687e01f7403335c88453998259d647..22c1e5fd0c6f16a101b2578675704f18
host->GetChildProcess()->BindServiceInterface(std::move(receiver));
}
diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc
index 475614df3115ac27fafa4cf23f65be8e794e9f90..d3a5fd8531754c07aa1fa7e175d4a650cbbeb885 100644
index c223138472a6d4f64c65e645bb842a6be876e6b4..255ed2faa4b7b9d97800f34d1bd921a8b5925861 100644
--- a/content/browser/utility_process_host.cc
+++ b/content/browser/utility_process_host.cc
@@ -156,11 +156,13 @@ const ChildProcessData& UtilityProcessHost::GetData() {
@ -202,7 +202,7 @@ index 475614df3115ac27fafa4cf23f65be8e794e9f90..d3a5fd8531754c07aa1fa7e175d4a650
bool UtilityProcessHost::Start() {
return StartProcess();
@@ -216,6 +218,24 @@ void UtilityProcessHost::SetZygoteForTesting(ZygoteCommunication* handle) {
@@ -226,6 +228,24 @@ void UtilityProcessHost::SetZygoteForTesting(ZygoteCommunication* handle) {
}
#endif // BUILDFLAG(USE_ZYGOTE)
@ -227,7 +227,7 @@ index 475614df3115ac27fafa4cf23f65be8e794e9f90..d3a5fd8531754c07aa1fa7e175d4a650
mojom::ChildProcess* UtilityProcessHost::GetChildProcess() {
return static_cast<ChildProcessHostImpl*>(process_->GetHost())
->child_process();
@@ -431,9 +451,22 @@ bool UtilityProcessHost::StartProcess() {
@@ -441,9 +461,22 @@ bool UtilityProcessHost::StartProcess() {
}
#endif // BUILDFLAG(IS_LINUX)
@ -249,10 +249,10 @@ index 475614df3115ac27fafa4cf23f65be8e794e9f90..d3a5fd8531754c07aa1fa7e175d4a650
+ sandbox_type_, env_, current_directory_, *cmd_line,
+ inherit_environment_);
#if BUILDFLAG(USE_ZYGOTE)
if (zygote_for_testing_.has_value()) {
#if BUILDFLAG(IS_WIN)
if (!preload_libraries_.empty()) {
diff --git a/content/browser/utility_process_host.h b/content/browser/utility_process_host.h
index 65e59b1cbf33c065a500b7d304ed6618d0a24808..e3b1aa7963b4ab9daafdd3340ecfaee07d93f8ea 100644
index 45b85c90b5d01a0b1311e15705794ab4c9369fa1..d13dbd7a917e53a4dbee21ad0f98a5bd2ab1d1b9 100644
--- a/content/browser/utility_process_host.h
+++ b/content/browser/utility_process_host.h
@@ -35,6 +35,10 @@
@ -282,7 +282,7 @@ index 65e59b1cbf33c065a500b7d304ed6618d0a24808..e3b1aa7963b4ab9daafdd3340ecfaee0
// Starts the utility process.
bool Start();
@@ -146,6 +154,16 @@ class CONTENT_EXPORT UtilityProcessHost
@@ -154,6 +162,16 @@ class CONTENT_EXPORT UtilityProcessHost
void SetZygoteForTesting(ZygoteCommunication* handle);
#endif // BUILDFLAG(USE_ZYGOTE)
@ -299,7 +299,7 @@ index 65e59b1cbf33c065a500b7d304ed6618d0a24808..e3b1aa7963b4ab9daafdd3340ecfaee0
// Returns a control interface for the running child process.
mojom::ChildProcess* GetChildProcess();
@@ -194,6 +212,22 @@ class CONTENT_EXPORT UtilityProcessHost
@@ -209,6 +227,22 @@ class CONTENT_EXPORT UtilityProcessHost
absl::optional<raw_ptr<ZygoteCommunication>> zygote_for_testing_;
#endif // BUILDFLAG(USE_ZYGOTE)
@ -323,7 +323,7 @@ index 65e59b1cbf33c065a500b7d304ed6618d0a24808..e3b1aa7963b4ab9daafdd3340ecfaee0
// launch failed.
enum class LaunchState {
diff --git a/content/browser/utility_sandbox_delegate.cc b/content/browser/utility_sandbox_delegate.cc
index 5a8f79cce1e6635e4656383cea8ab8763d09aa59..665904af73916b269adfb2b793c5792bbb26e862 100644
index 1caf159300af5f8910d0c691c6eb5b2475d9f9a0..d3e4adfad23176d6e7989eb20d1f08d780d8831b 100644
--- a/content/browser/utility_sandbox_delegate.cc
+++ b/content/browser/utility_sandbox_delegate.cc
@@ -29,13 +29,15 @@ UtilitySandboxedProcessLauncherDelegate::
@ -346,7 +346,7 @@ index 5a8f79cce1e6635e4656383cea8ab8763d09aa59..665904af73916b269adfb2b793c5792b
#if DCHECK_IS_ON()
bool supported_sandbox_type =
sandbox_type_ == sandbox::mojom::Sandbox::kNoSandbox ||
@@ -97,11 +99,17 @@ UtilitySandboxedProcessLauncherDelegate::GetSandboxType() {
@@ -96,11 +98,17 @@ UtilitySandboxedProcessLauncherDelegate::GetSandboxType() {
return sandbox_type_;
}
@ -367,10 +367,10 @@ index 5a8f79cce1e6635e4656383cea8ab8763d09aa59..665904af73916b269adfb2b793c5792b
#if BUILDFLAG(USE_ZYGOTE)
ZygoteCommunication* UtilitySandboxedProcessLauncherDelegate::GetZygote() {
diff --git a/content/browser/utility_sandbox_delegate.h b/content/browser/utility_sandbox_delegate.h
index aaf1549544051226c83e78d5d6dedac6f03618c9..517f1c05ed2bcf726a3f5aaed932adcd310a5e82 100644
index 49b9f8429ebdd238e0e9ffb00cdf1848bda898a8..f79c7f0298ee76b2faaead195990925350306e49 100644
--- a/content/browser/utility_sandbox_delegate.h
+++ b/content/browser/utility_sandbox_delegate.h
@@ -26,7 +26,9 @@ class UtilitySandboxedProcessLauncherDelegate
@@ -27,7 +27,9 @@ class UtilitySandboxedProcessLauncherDelegate
public:
UtilitySandboxedProcessLauncherDelegate(sandbox::mojom::Sandbox sandbox_type,
const base::EnvironmentMap& env,
@ -381,7 +381,7 @@ index aaf1549544051226c83e78d5d6dedac6f03618c9..517f1c05ed2bcf726a3f5aaed932adcd
~UtilitySandboxedProcessLauncherDelegate() override;
sandbox::mojom::Sandbox GetSandboxType() override;
@@ -46,25 +48,25 @@ class UtilitySandboxedProcessLauncherDelegate
@@ -54,18 +56,16 @@ class UtilitySandboxedProcessLauncherDelegate
ZygoteCommunication* GetZygote() override;
#endif // BUILDFLAG(USE_ZYGOTE)
@ -400,7 +400,9 @@ index aaf1549544051226c83e78d5d6dedac6f03618c9..517f1c05ed2bcf726a3f5aaed932adcd
base::EnvironmentMap env_;
-#endif // BUILDFLAG(IS_POSIX)
#if BUILDFLAG(USE_ZYGOTE)
#if BUILDFLAG(IS_WIN)
std::vector<base::FilePath> preload_libraries_;
@@ -76,8 +76,10 @@ class UtilitySandboxedProcessLauncherDelegate
absl::optional<raw_ptr<ZygoteCommunication>> zygote_;
#endif // BUILDFLAG(USE_ZYGOTE)
@ -434,7 +436,7 @@ index 498f60227d13eb2e476413f88eaa58cc0babf461..619639ad5d22a1121b0e0d5f2c9e3c10
} // namespace content
diff --git a/content/public/browser/service_process_host.cc b/content/public/browser/service_process_host.cc
index b11ee73bed669057c02a9b3294a172003a339447..a33456d43a70fb01506c4c081f4f07f789801e87 100644
index e6bd27288a8d29dcf263a0677d2629d0aa7cf7c4..24d5acf41ea3fb825d813a040644aef1c9d6d4ee 100644
--- a/content/public/browser/service_process_host.cc
+++ b/content/public/browser/service_process_host.cc
@@ -52,12 +52,45 @@ ServiceProcessHost::Options::WithExtraCommandLineSwitches(
@ -480,11 +482,11 @@ index b11ee73bed669057c02a9b3294a172003a339447..a33456d43a70fb01506c4c081f4f07f7
+ return *this;
+}
+
ServiceProcessHost::Options ServiceProcessHost::Options::Pass() {
return std::move(*this);
}
#if BUILDFLAG(IS_WIN)
ServiceProcessHost::Options&
ServiceProcessHost::Options::WithPreloadedLibraries(
diff --git a/content/public/browser/service_process_host.h b/content/public/browser/service_process_host.h
index 123bb6fe8287b65b9c47f726fc3f29e3f3976ad9..a3fd4878dbaa5e28b3111c2ffd3718653628e18d 100644
index 32fad70cbdf15d587eb32fa74b2995d30b27f694..2df65c405acdf896c5a66dcd3d0aaf44031bc2f7 100644
--- a/content/public/browser/service_process_host.h
+++ b/content/public/browser/service_process_host.h
@@ -13,6 +13,7 @@
@ -495,9 +497,9 @@ index 123bb6fe8287b65b9c47f726fc3f29e3f3976ad9..a3fd4878dbaa5e28b3111c2ffd371865
#include "base/process/process_handle.h"
#include "base/strings/string_piece.h"
#include "build/chromecast_buildflags.h"
@@ -30,6 +31,10 @@
#include "mojo/public/cpp/system/message_pipe.h"
#endif
@@ -35,6 +36,10 @@
#include "base/types/pass_key.h"
#endif // BUILDFLAG(IS_WIN)
+#if BUILDFLAG(IS_WIN)
+#include "base/win/scoped_handle.h"
@ -506,7 +508,7 @@ index 123bb6fe8287b65b9c47f726fc3f29e3f3976ad9..a3fd4878dbaa5e28b3111c2ffd371865
namespace base {
class Process;
} // namespace base
@@ -93,11 +98,30 @@ class CONTENT_EXPORT ServiceProcessHost {
@@ -100,11 +105,30 @@ class CONTENT_EXPORT ServiceProcessHost {
// Specifies extra command line switches to append before launch.
Options& WithExtraCommandLineSwitches(std::vector<std::string> switches);
@ -534,10 +536,10 @@ index 123bb6fe8287b65b9c47f726fc3f29e3f3976ad9..a3fd4878dbaa5e28b3111c2ffd371865
+ Options& WithEnvironment(const base::EnvironmentMap& environment,
+ bool new_environment);
+
// Passes the contents of this Options object to a newly returned Options
// value. This must be called when moving a built Options object into a call
// to |Launch()|.
@@ -107,7 +131,16 @@ class CONTENT_EXPORT ServiceProcessHost {
#if BUILDFLAG(IS_WIN)
// Specifies libraries to preload before the sandbox is locked down. Paths
// should be absolute paths. Libraries will be preloaded before sandbox
@@ -131,11 +155,20 @@ class CONTENT_EXPORT ServiceProcessHost {
absl::optional<GURL> site;
absl::optional<int> child_flags;
std::vector<std::string> extra_switches;
@ -548,6 +550,10 @@ index 123bb6fe8287b65b9c47f726fc3f29e3f3976ad9..a3fd4878dbaa5e28b3111c2ffd371865
+ base::FileHandleMappingVector fds_to_remap;
+#endif
base::OnceCallback<void(const base::Process&)> process_callback;
#if BUILDFLAG(IS_WIN)
std::vector<base::FilePath> preload_libraries;
bool pin_user32;
#endif // BUILDFLAG(IS_WIN)
+ base::FilePath current_directory;
+ base::EnvironmentMap environment;
+ bool clear_environment = false;
@ -621,10 +627,10 @@ index cb43aa14c9742f3788ae58c3e49b890cd532f327..6a738f7aade504f2ff3bb6647a0da8f8
#if BUILDFLAG(IS_MAC)
// Whether or not to disclaim TCC responsibility for the process, defaults to
diff --git a/sandbox/policy/win/sandbox_win.cc b/sandbox/policy/win/sandbox_win.cc
index eba9f9ae775bace82cddbb86c4c9d0df2ce2ac2c..bd3f981c9e56740582716c2fc68ba8ed8ff589d1 100644
index 4d566d8c23762d0310b4973a1ebfbdf8c4bc4cea..0efa9564bab43c7b2e29db193bc84a47c43d2fde 100644
--- a/sandbox/policy/win/sandbox_win.cc
+++ b/sandbox/policy/win/sandbox_win.cc
@@ -729,11 +729,9 @@ ResultCode GenerateConfigForSandboxedProcess(const base::CommandLine& cmd_line,
@@ -689,11 +689,9 @@ ResultCode GenerateConfigForSandboxedProcess(const base::CommandLine& cmd_line,
// command line flag.
ResultCode LaunchWithoutSandbox(
const base::CommandLine& cmd_line,
@ -637,7 +643,7 @@ index eba9f9ae775bace82cddbb86c4c9d0df2ce2ac2c..bd3f981c9e56740582716c2fc68ba8ed
// Network process runs in a job even when unsandboxed. This is to ensure it
// does not outlive the browser, which could happen if there is a lot of I/O
// on process shutdown, in which case TerminateProcess can fail. See
@@ -960,7 +958,7 @@ bool SandboxWin::InitTargetServices(TargetServices* target_services) {
@@ -923,7 +921,7 @@ bool SandboxWin::InitTargetServices(TargetServices* target_services) {
ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
const base::CommandLine& cmd_line,
const std::string& process_type,
@ -646,7 +652,7 @@ index eba9f9ae775bace82cddbb86c4c9d0df2ce2ac2c..bd3f981c9e56740582716c2fc68ba8ed
SandboxDelegate* delegate,
TargetPolicy* policy) {
const base::CommandLine& launcher_process_command_line =
@@ -974,7 +972,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
@@ -937,7 +935,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
}
// Add any handles to be inherited to the policy.
@ -655,7 +661,7 @@ index eba9f9ae775bace82cddbb86c4c9d0df2ce2ac2c..bd3f981c9e56740582716c2fc68ba8ed
policy->AddHandleToShare(handle);
if (!policy->GetConfig()->IsConfigured()) {
@@ -989,6 +987,13 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
@@ -952,6 +950,13 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
// have no effect. These calls can fail with SBOX_ERROR_BAD_PARAMS.
policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE));
policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE));
@ -669,7 +675,7 @@ index eba9f9ae775bace82cddbb86c4c9d0df2ce2ac2c..bd3f981c9e56740582716c2fc68ba8ed
#endif
if (!delegate->PreSpawnTarget(policy))
@@ -1001,7 +1006,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
@@ -964,7 +969,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
ResultCode SandboxWin::StartSandboxedProcess(
const base::CommandLine& cmd_line,
const std::string& process_type,
@ -678,7 +684,7 @@ index eba9f9ae775bace82cddbb86c4c9d0df2ce2ac2c..bd3f981c9e56740582716c2fc68ba8ed
SandboxDelegate* delegate,
base::Process* process) {
const base::ElapsedTimer timer;
@@ -1009,13 +1014,13 @@ ResultCode SandboxWin::StartSandboxedProcess(
@@ -972,13 +977,13 @@ ResultCode SandboxWin::StartSandboxedProcess(
// Avoid making a policy if we won't use it.
if (IsUnsandboxedProcess(delegate->GetSandboxType(), cmd_line,
*base::CommandLine::ForCurrentProcess())) {
@ -695,10 +701,10 @@ index eba9f9ae775bace82cddbb86c4c9d0df2ce2ac2c..bd3f981c9e56740582716c2fc68ba8ed
return result;
diff --git a/sandbox/policy/win/sandbox_win.h b/sandbox/policy/win/sandbox_win.h
index d8842ebdd1bd4ebd2ba9e33b8bcf390033dbf4d4..771c6f366559641544f775c3b45eba617923ebdb 100644
index f45b798eaa154f25e876632fac551ed9f151fe02..24508fb22db700058da039f8644e2ec17d9b5cc3 100644
--- a/sandbox/policy/win/sandbox_win.h
+++ b/sandbox/policy/win/sandbox_win.h
@@ -50,7 +50,7 @@ class SANDBOX_POLICY_EXPORT SandboxWin {
@@ -52,7 +52,7 @@ class SANDBOX_POLICY_EXPORT SandboxWin {
static ResultCode StartSandboxedProcess(
const base::CommandLine& cmd_line,
const std::string& process_type,
@ -707,7 +713,7 @@ index d8842ebdd1bd4ebd2ba9e33b8bcf390033dbf4d4..771c6f366559641544f775c3b45eba61
SandboxDelegate* delegate,
base::Process* process);
@@ -64,7 +64,7 @@ class SANDBOX_POLICY_EXPORT SandboxWin {
@@ -66,7 +66,7 @@ class SANDBOX_POLICY_EXPORT SandboxWin {
static ResultCode GeneratePolicyForSandboxedProcess(
const base::CommandLine& cmd_line,
const std::string& process_type,

Просмотреть файл

@ -87,10 +87,10 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217
private:
const HWND hwnd_;
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
index f2fe76f53dac7380cbd5d3d42a630efbb55af173..06e4c47bd5f37c041d93808cf712e9eb028ff1b2 100644
index 5583233391b2133acd30d76ce4c3c5d87e0ffbc8..9551e3ea2e5f3de9bff158fc0f443df69a27f93a 100644
--- a/components/viz/service/BUILD.gn
+++ b/components/viz/service/BUILD.gn
@@ -139,6 +139,8 @@ viz_component("service") {
@@ -141,6 +141,8 @@ viz_component("service") {
"display_embedder/skia_output_surface_impl_on_gpu_debug_capture.h",
"display_embedder/skia_render_copy_results.cc",
"display_embedder/skia_render_copy_results.h",
@ -513,10 +513,10 @@ index d4d4c1444e7a169d154bb9062f09f2270e7e9734..01943e14de567afd7b14f6a92eec651d
waiting_on_draw_ack_ = true;
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
index 0c438dbab1340ccc06c112d5dbc9e8f44bcb920b..13962687d262434de77f76c1c5a0f39f0fd9fb43 100644
index 36673e93a8380d4e6d086fe3029a53fa483ccddb..ad91be73ec89f45c2ce083eaa3a8aba6b6f53877 100644
--- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
+++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
@@ -90,7 +90,8 @@ RootCompositorFrameSinkImpl::Create(
@@ -94,7 +94,8 @@ RootCompositorFrameSinkImpl::Create(
params->gpu_compositing, params->widget);
auto output_surface = output_surface_provider->CreateOutputSurface(
params->widget, params->gpu_compositing, display_client.get(),
@ -527,10 +527,10 @@ index 0c438dbab1340ccc06c112d5dbc9e8f44bcb920b..13962687d262434de77f76c1c5a0f39f
// Creating output surface failed. The host can send a new request, possibly
// with a different compositing mode.
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc
index a45fa7c141777bc6ebc5c34ba73c2e6cc602c2b0..a4bbec572b63a22e2b920e7b139c0c9b6ec34e0c 100644
index 1aae81c4b1d540fa54e4e8dd5642089369fef14e..6bfc201e9e38dc945875b74a851ce460a68d76f8 100644
--- a/content/browser/compositor/viz_process_transport_factory.cc
+++ b/content/browser/compositor/viz_process_transport_factory.cc
@@ -397,8 +397,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
@@ -402,8 +402,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
mojo::AssociatedRemote<viz::mojom::DisplayPrivate> display_private;
root_params->display_private =
display_private.BindNewEndpointAndPassReceiver();
@ -560,13 +560,13 @@ index 350fa67c492490bbd5e8d13ea4368df798261071..d5718735b288d27055af05411a160377
// Sends the created child window to the browser process so that it can be
diff --git a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
index b8037d39c0d763b25d3db09f73b1819a0907904d..2ecad8b7bda880b6aceb316e17a05a99575285b7 100644
index f4c967e69e91a09c3cdb3295f353939e77ae1afb..eb87b444ec2f3142e19765f5a27c2cbe76141f5b 100644
--- a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
+++ b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
@@ -30,6 +30,7 @@ struct RootCompositorFrameSinkParams {
bool send_swap_size_notifications = false;
// Disables begin frame rate limiting for the display compositor.
@@ -32,6 +32,7 @@ struct RootCompositorFrameSinkParams {
bool disable_frame_rate_limit = false;
// Whether to use variable refresh rates when generating begin frames.
bool enable_variable_refresh_rate = false;
+ bool offscreen = false;
[EnableIf=is_android]

Просмотреть файл

@ -12,10 +12,10 @@ We attempt to migrate the safe storage key from the old account, if that migrati
Existing apps that aren't built for the app store should be unimpacted, there is one edge case where a user uses BOTH an AppStore and a darwin build of the same app only one will keep it's access to the safestorage key as during the migration we delete the old account. This is an acceptable edge case as no one should be actively using two versions of the same app.
diff --git a/components/os_crypt/sync/keychain_password_mac.mm b/components/os_crypt/sync/keychain_password_mac.mm
index 1895fc822281ccc9e36500e755f028fb2f877060..8d02e232dcb53e3d753b64c8548a5b98d2bb571f 100644
index e62a56a505e364dff7e1a9eb3043c01c2e3bc39f..2fa4598c4c38cf8dc0b03dad8ecd4faa69f0bb89 100644
--- a/components/os_crypt/sync/keychain_password_mac.mm
+++ b/components/os_crypt/sync/keychain_password_mac.mm
@@ -22,6 +22,12 @@
@@ -26,6 +26,12 @@
using KeychainNameContainerType = const base::NoDestructor<std::string>;
#endif
@ -28,7 +28,7 @@ index 1895fc822281ccc9e36500e755f028fb2f877060..8d02e232dcb53e3d753b64c8548a5b98
namespace {
// These two strings ARE indeed user facing. But they are used to access
@@ -82,11 +88,18 @@
@@ -86,11 +92,18 @@
std::string KeychainPassword::GetPassword() const {
UInt32 password_length = 0;
void* password_data = nullptr;
@ -43,13 +43,13 @@ index 1895fc822281ccc9e36500e755f028fb2f877060..8d02e232dcb53e3d753b64c8548a5b98
- GetAccountName().size(), GetAccountName().c_str(), &password_length,
+ service_name.size(), service_name.c_str(),
+ suffixed_account_name.size(), suffixed_account_name.c_str(), &password_length,
&password_data, nullptr);
&password_data, /*item=*/nullptr);
+ // If it exists we can return it immediately
if (error == noErr) {
std::string password =
std::string(static_cast<char*>(password_data), password_length);
@@ -94,9 +107,52 @@
@@ -98,9 +111,52 @@
return password;
}

Просмотреть файл

@ -17,7 +17,7 @@ headers, moving forward we should find a way in upstream to provide
access to these headers for loader clients created on the browser process.
diff --git a/services/network/public/cpp/resource_request.cc b/services/network/public/cpp/resource_request.cc
index 6d42ae691a2c4a8cf51501bc4c690aca328001f5..71ac9d67eaa87346e7348e63d10157fbc6e8f836 100644
index f59007a90f6a99cafb450f3e79b528b84ad563d0..e5a6e03f3ffbe49caa251ac0a87416af7b6f55e6 100644
--- a/services/network/public/cpp/resource_request.cc
+++ b/services/network/public/cpp/resource_request.cc
@@ -137,6 +137,7 @@ ResourceRequest::TrustedParams& ResourceRequest::TrustedParams::operator=(
@ -37,10 +37,10 @@ index 6d42ae691a2c4a8cf51501bc4c690aca328001f5..71ac9d67eaa87346e7348e63d10157fb
allow_cookies_from_browser == other.allow_cookies_from_browser &&
client_security_state == other.client_security_state;
diff --git a/services/network/public/cpp/resource_request.h b/services/network/public/cpp/resource_request.h
index 97bc15e4dbd30364a3ea9d2cc2961d8e0dce2473..c84bc3991722a252c03ebc61451cf8933e55e6f9 100644
index b4d389b1fd8de80490b3b1d4e8d0bc632a7f9de1..d44c070c5f6ab52fdddf79f5149884176e763368 100644
--- a/services/network/public/cpp/resource_request.h
+++ b/services/network/public/cpp/resource_request.h
@@ -65,6 +65,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
@@ -66,6 +66,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
bool disable_secure_dns = false;
bool has_user_activation = false;
bool allow_cookies_from_browser = false;
@ -49,7 +49,7 @@ index 97bc15e4dbd30364a3ea9d2cc2961d8e0dce2473..c84bc3991722a252c03ebc61451cf893
mojo::PendingRemote<mojom::TrustTokenAccessObserver> trust_token_observer;
mojo::PendingRemote<mojom::URLLoaderNetworkServiceObserver>
diff --git a/services/network/public/cpp/url_request_mojom_traits.cc b/services/network/public/cpp/url_request_mojom_traits.cc
index e716df9998d8ec8125c7c5ceb46a0abfcd8a1538..780ffaae2f608f7e153a62adf4e61fad42d01888 100644
index 645984438efabd1f4a0813c1c0137d37973b2126..52479f4657bdceab9d93fc1e9efde111e44e7545 100644
--- a/services/network/public/cpp/url_request_mojom_traits.cc
+++ b/services/network/public/cpp/url_request_mojom_traits.cc
@@ -90,6 +90,7 @@ bool StructTraits<network::mojom::TrustedUrlRequestParamsDataView,
@ -61,10 +61,10 @@ index e716df9998d8ec8125c7c5ceb46a0abfcd8a1538..780ffaae2f608f7e153a62adf4e61fad
mojo::PendingRemote<network::mojom::CookieAccessObserver>>();
out->trust_token_observer = data.TakeTrustTokenObserver<
diff --git a/services/network/public/cpp/url_request_mojom_traits.h b/services/network/public/cpp/url_request_mojom_traits.h
index fc841300bd332d240ff73dfb2991151dbc853110..4b6f6df75b42bc167da145c4e95310a10e4c91ef 100644
index f4ad62d0093e3e6c2440b2f9307770ee6ae8ef57..fa57f132b7615d779defda35dd42515edfc77e29 100644
--- a/services/network/public/cpp/url_request_mojom_traits.h
+++ b/services/network/public/cpp/url_request_mojom_traits.h
@@ -71,6 +71,10 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
@@ -72,6 +72,10 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
const network::ResourceRequest::TrustedParams& trusted_params) {
return trusted_params.allow_cookies_from_browser;
}
@ -76,7 +76,7 @@ index fc841300bd332d240ff73dfb2991151dbc853110..4b6f6df75b42bc167da145c4e95310a1
cookie_observer(
const network::ResourceRequest::TrustedParams& trusted_params) {
diff --git a/services/network/public/mojom/url_request.mojom b/services/network/public/mojom/url_request.mojom
index 515e4b9d26b26e23d41a43e601c667c765b0dff1..d3f1d984e663121b97a9129b576142963ad72612 100644
index 7b684ab387bfe37bf486f1ea5424fb7551383b2d..c2e0727104e83c0dad384794e31ffbd5e1d3136d 100644
--- a/services/network/public/mojom/url_request.mojom
+++ b/services/network/public/mojom/url_request.mojom
@@ -72,6 +72,9 @@ struct TrustedUrlRequestParams {

Просмотреть файл

@ -6,10 +6,10 @@ Subject: fix: allow guest webcontents to enter fullscreen
This can be upstreamed, a guest webcontents can't technically become the focused webContents. This DCHECK should allow all guest webContents to request fullscreen entrance.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index a114c8a72670037fe0f4b9d95c16a67094f4c13c..c91c66006ee4b08bc2b1ee7a8346a15ba763e9f4 100644
index 4181b7dd3c8ba467e3e762e5875a97df630e62dc..9ef1f3ebeb74f4e793abc46097c7fd617ef4447f 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3595,7 +3595,7 @@ void WebContentsImpl::EnterFullscreenMode(
@@ -3598,7 +3598,7 @@ void WebContentsImpl::EnterFullscreenMode(
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
DCHECK(CanEnterFullscreenMode(requesting_frame, options));
DCHECK(requesting_frame->IsActive());

Просмотреть файл

@ -17,10 +17,10 @@ policy->CanCommitOriginAndUrl.
Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856266.
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
index 8a754a2e41aeacd4d115652806ff57b5a382693b..7cd9c5fd32b7db79e1059cf9f7bf411c75416f1e 100644
index ce02660be0a16e84f813260b8482e2de856c4856..81b0730eda5e13760721c5e48db244ab74ffd039 100644
--- a/content/browser/renderer_host/navigation_request.cc
+++ b/content/browser/renderer_host/navigation_request.cc
@@ -7489,10 +7489,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
@@ -7500,10 +7500,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
if (IsForMhtmlSubframe())
return origin_with_debug_info;
@ -37,10 +37,10 @@ index 8a754a2e41aeacd4d115652806ff57b5a382693b..7cd9c5fd32b7db79e1059cf9f7bf411c
}
diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h
index 60b89be83a94a5f8442b945f0783853b6effa775..8ac27ed07e62c8c1f1f12e3020386ac657386290 100644
index 617e2ca9866c76095930cdd7fe5f8fbb652ef588..ba83832f9b2b08b0ec17bff50e513bce3fd39cb8 100644
--- a/content/browser/renderer_host/render_frame_host_impl.h
+++ b/content/browser/renderer_host/render_frame_host_impl.h
@@ -2911,6 +2911,17 @@ class CONTENT_EXPORT RenderFrameHostImpl
@@ -2914,6 +2914,17 @@ class CONTENT_EXPORT RenderFrameHostImpl
// last committed document.
CookieChangeListener::CookieChangeInfo GetCookieChangeInfo();
@ -58,7 +58,7 @@ index 60b89be83a94a5f8442b945f0783853b6effa775..8ac27ed07e62c8c1f1f12e3020386ac6
// Sets a ResourceCache in the renderer. `this` must be active and there must
// be no pending navigation. `remote` must have the same and process
// isolation policy.
@@ -3280,17 +3291,6 @@ class CONTENT_EXPORT RenderFrameHostImpl
@@ -3287,17 +3298,6 @@ class CONTENT_EXPORT RenderFrameHostImpl
// relevant.
void ResetWaitingState();

Просмотреть файл

@ -15,10 +15,10 @@ node does not change in this case.
chromium-bug: https://crbug.com/1369605
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
index 7d471653b3dfadaa91cbe7dfdd5ff324d0fbe1bb..08251f85beef09719808db3fb042c9f6f45c218e 100644
index 8f57ba0f182fa1ae687b628c3b050d58f9ab5426..865dba163fb68ca2ab3bde5b54a0024dc650cde1 100644
--- a/content/browser/renderer_host/render_widget_host_view_child_frame.cc
+++ b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -994,6 +994,12 @@ RenderWidgetHostViewChildFrame::DidUpdateVisualProperties(
@@ -996,6 +996,12 @@ RenderWidgetHostViewChildFrame::DidUpdateVisualProperties(
return viz::ScopedSurfaceIdAllocator(std::move(allocation_task));
}
@ -32,7 +32,7 @@ index 7d471653b3dfadaa91cbe7dfdd5ff324d0fbe1bb..08251f85beef09719808db3fb042c9f6
if (!text_input_manager_)
return ui::TEXT_INPUT_TYPE_NONE;
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.h b/content/browser/renderer_host/render_widget_host_view_child_frame.h
index 2ca4e42342ff6bf3f2ad104208944e36d572aa3c..7421cc779873b580d6f5a109d57ff7445dde9d58 100644
index 7935adbe496cacd9b02390439f759186e77ba336..a16bc977a807cf23aff0f1611ffab2fb3bca679f 100644
--- a/content/browser/renderer_host/render_widget_host_view_child_frame.h
+++ b/content/browser/renderer_host/render_widget_host_view_child_frame.h
@@ -181,6 +181,8 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame
@ -45,10 +45,10 @@ index 2ca4e42342ff6bf3f2ad104208944e36d572aa3c..7421cc779873b580d6f5a109d57ff744
// RenderFrameMetadataProvider::Observer implementation.
void OnRenderFrameMetadataChangedBeforeActivation(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index c91c66006ee4b08bc2b1ee7a8346a15ba763e9f4..e555731a945bef8450b2ebd879b1193199c1de5f 100644
index 9ef1f3ebeb74f4e793abc46097c7fd617ef4447f..4b6408c650e7d9deadc927dd38031e9447b39b48 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -8103,7 +8103,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
@@ -8097,7 +8097,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
"WebContentsImpl::OnFocusedElementChangedInFrame",
"render_frame_host", frame);
RenderWidgetHostViewBase* root_view =

Просмотреть файл

@ -8,7 +8,7 @@ v8::Value instead of base::Value.
Refs https://bugs.chromium.org/p/chromium/issues/detail?id=1323953
diff --git a/extensions/renderer/script_injection.cc b/extensions/renderer/script_injection.cc
index e9371fb6de28abf0cc0d35cf144427b65fe7dc04..892c1bbae90725a97db6dbcb82e732303f20199f 100644
index 34777e89362b14587979cef76d8cd71b634cca8c..3d5e44883bab30eebdfaba70f3933435fe946ca1 100644
--- a/extensions/renderer/script_injection.cc
+++ b/extensions/renderer/script_injection.cc
@@ -275,6 +275,7 @@ void ScriptInjection::InjectJs(std::set<std::string>* executing_scripts,
@ -20,7 +20,7 @@ index e9371fb6de28abf0cc0d35cf144427b65fe7dc04..892c1bbae90725a97db6dbcb82e73230
injector_->ExpectsResults(), injector_->ShouldWaitForPromise());
}
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
index 157a7a90f3e5e70b0fa80e0030e1a3f65239664c..e65e857e83568dc0b621bf8f98c2b5247836f829 100644
index 0fb81902e569ed974c98b33e980546d210765e83..d27cf6d13b26ce8a828e62e3ddf15d082c5874e1 100644
--- a/third_party/blink/public/web/web_local_frame.h
+++ b/third_party/blink/public/web/web_local_frame.h
@@ -436,6 +436,7 @@ class BLINK_EXPORT WebLocalFrame : public WebFrame {
@ -64,10 +64,10 @@ index 4cd668a127a50e5462e3878c3f1dcb7384926768..dfbec49249404df8f8ebdbd26e6e865c
#endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index 54cb4d1ef90ded89b85243ac1296dfb7787b08dc..32cf879b41bc6d01c93d4be3c89c28d07cebbefb 100644
index d7ba7113f69e23b0fe47d135a4f51b9d50fa45b2..3efd8610623abb804af26d6ce4461b2d8d89c43a 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -2703,6 +2703,7 @@ void LocalFrame::RequestExecuteScript(
@@ -2704,6 +2704,7 @@ void LocalFrame::RequestExecuteScript(
mojom::blink::EvaluationTiming evaluation_timing,
mojom::blink::LoadEventBlockingOption blocking_option,
WebScriptExecutionCallback callback,
@ -75,7 +75,7 @@ index 54cb4d1ef90ded89b85243ac1296dfb7787b08dc..32cf879b41bc6d01c93d4be3c89c28d0
BackForwardCacheAware back_forward_cache_aware,
mojom::blink::WantResultOption want_result_option,
mojom::blink::PromiseResultOption promise_behavior) {
@@ -2733,7 +2734,8 @@ void LocalFrame::RequestExecuteScript(
@@ -2734,7 +2735,8 @@ void LocalFrame::RequestExecuteScript(
PausableScriptExecutor::CreateAndRun(
ToScriptState(DomWindow(), *world), std::move(script_sources),
execute_script_policy, user_gesture, evaluation_timing, blocking_option,
@ -86,10 +86,10 @@ index 54cb4d1ef90ded89b85243ac1296dfb7787b08dc..32cf879b41bc6d01c93d4be3c89c28d0
void LocalFrame::SetEvictCachedSessionStorageOnFreezeOrUnload() {
diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
index 3d2e44d5221078ed54ab4ba1e7e2a495eb79fae9..46bd501ba79aed310340f23ff8d2751a5ee760ec 100644
index 50e103a3b58a9953e18bf76c713af21b1c9caf95..2dd4567b486804794e15ae389f95000e62930f40 100644
--- a/third_party/blink/renderer/core/frame/local_frame.h
+++ b/third_party/blink/renderer/core/frame/local_frame.h
@@ -781,6 +781,7 @@ class CORE_EXPORT LocalFrame final
@@ -787,6 +787,7 @@ class CORE_EXPORT LocalFrame final
mojom::blink::EvaluationTiming,
mojom::blink::LoadEventBlockingOption,
WebScriptExecutionCallback,
@ -205,10 +205,10 @@ index 1e4d9e098463d61dcab787afcc46fea63b27e012..3f1ebf493ddd7d1c209acee2fb1255a0
const mojom::blink::UserActivationOption user_activation_option_;
const mojom::blink::LoadEventBlockingOption blocking_option_;
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
index 7ebcc1cdedf3e2ff2e7a6ff2edc90158815dae94..55f5860485e5013295506e4936bba34e5134aff3 100644
index 1760444eb05fbe202181d0b67b446a56d919ba8c..46e1e4bfeb3f7b052ffe688a9dc15d602e49ff65 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -1148,14 +1148,15 @@ void WebLocalFrameImpl::RequestExecuteScript(
@@ -1131,14 +1131,15 @@ void WebLocalFrameImpl::RequestExecuteScript(
mojom::blink::EvaluationTiming evaluation_timing,
mojom::blink::LoadEventBlockingOption blocking_option,
WebScriptExecutionCallback callback,
@ -227,7 +227,7 @@ index 7ebcc1cdedf3e2ff2e7a6ff2edc90158815dae94..55f5860485e5013295506e4936bba34e
v8::MaybeLocal<v8::Value> WebLocalFrameImpl::CallFunctionEvenIfScriptDisabled(
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
index aa8c03c35518b6c3163d7b28dc09a5cbb9d8a54d..8657a6f7191fac4263d47d34629223a165dda2e1 100644
index 8ce3bef8acad36edf728d5a511431d902db3ab03..6dc7cd67f15d4ed0a18af953b16a374224d7aa0c 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
@@ -195,6 +195,7 @@ class CORE_EXPORT WebLocalFrameImpl final

Просмотреть файл

@ -6,10 +6,10 @@ Subject: frame_host_manager.patch
Allows embedder to intercept site instances created by chromium.
diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc
index 1e6180116afda2ebd23b6b9a22b65b05cf72e642..603ad21be099547004abfb0cb98a9eabd7d5e4ed 100644
index fea976a03235c8212f45c605249e31aa134e69a8..10271c810c11c383750b5d43570b23b71495e3de 100644
--- a/content/browser/renderer_host/render_frame_host_manager.cc
+++ b/content/browser/renderer_host/render_frame_host_manager.cc
@@ -3911,6 +3911,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -3934,6 +3934,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
request->ResetStateForSiteInstanceChange();
}
@ -20,10 +20,10 @@ index 1e6180116afda2ebd23b6b9a22b65b05cf72e642..603ad21be099547004abfb0cb98a9eab
}
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 294986a55d49a9f57592cf209b6c0db42620f61e..28ba30415d519fb3d6d7d388006b7dee5f807944 100644
index 8daca4d7fad172c8436b9261022c4d1114b36f07..cfd8751df862219bba4e9cb30a5f61a207911828 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -302,6 +302,11 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -303,6 +303,11 @@ class CONTENT_EXPORT ContentBrowserClient {
virtual ~ContentBrowserClient() = default;

Просмотреть файл

@ -38,10 +38,10 @@ index 10caab6d9ef3345332c163a55dcef991248ab4ea..c9bc6e5dd7e1cf8d198afcd21cbb2497
// Returns whether `Initialize` has already been invoked in the process.
// Initialization is a one-way operation (i.e., this method cannot return
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index ee54275c61ee283e7ef1dcf4bf04ccaccabbd0d6..8a0a8c4f678c017d455981d723eff04d2463082a 100644
index ba3ab6adff0db46c8a1fca2e1bf3b3cb4a41fbdd..0d56182a284b91e7bf5749dbf0796cbe705d2c1f 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -395,7 +395,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
@@ -402,7 +402,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
// static
void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
const std::string js_command_line_flags,
@ -51,7 +51,7 @@ index ee54275c61ee283e7ef1dcf4bf04ccaccabbd0d6..8a0a8c4f678c017d455981d723eff04d
static bool v8_is_initialized = false;
if (v8_is_initialized)
return;
@@ -405,7 +406,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
@@ -412,7 +413,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
// See https://crbug.com/v8/11043
SetFlags(mode, js_command_line_flags);

Просмотреть файл

@ -6,7 +6,7 @@ Subject: gritsettings_resource_ids.patch
Add electron resources file to the list of resource ids generation.
diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
index 179bddf7519bbb381cfc1c33c496e5ea250f8f5a..b7b1a8e628c8d404917424d12bb1273ad8073b87 100644
index c9ebf891962bef2e91bfe51584638f3a8949acf5..e8a75fcc43f13b5ca5e238e73111f0dfd3829ceb 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -1143,6 +1143,11 @@

Просмотреть файл

@ -11,10 +11,10 @@ If removing this patch causes no sync failures, it's safe to delete :+1:
Ref https://chromium-review.googlesource.com/c/chromium/src/+/2953903
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
index 4d70ae5f394e7744cdc5db93cb0a1ef97e5aa259..25d52d6323198aaf24e5ecb1977453771599d96f 100755
index c615f9a19854f3e9c0bc70340835cb2117c41ed0..b8ceb570450d88405999cd566ce2e5469b27f89d 100755
--- a/tools/clang/scripts/update.py
+++ b/tools/clang/scripts/update.py
@@ -305,6 +305,8 @@ def GetDefaultHostOs():
@@ -306,6 +306,8 @@ def GetDefaultHostOs():
'win32': 'win',
}
default_host_os = _PLATFORM_HOST_OS_MAP.get(sys.platform, sys.platform)

Просмотреть файл

@ -9,10 +9,10 @@ but due to the nature of electron, we need to load the v8 snapshot
in the browser process.
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
index 38c5f465d8e4538995ce54c134bccd591eb71261..d2ca2effde6f7523518c1531f86506c4f619797e 100644
index fa26be0ffd110911af50a4c8a05666b94249cab6..77a9818606c3e2cde6f74d5009a05a851b6295e9 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -278,11 +278,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) {
@@ -279,11 +279,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) {
bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
const std::string& process_type) {

Просмотреть файл

@ -6,7 +6,7 @@ Subject: mas: avoid usage of CGDisplayUsesForceToGray
Removes usage of the CGDisplayUsesForceToGray private API.
diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm
index 2185525edaf5e14b57055e1043db0299bed87fd8..0d5ef8c48f08b1eb5ed878ab8934f2ecd04083fa 100644
index 4a7d465c5f5690709eca8aa4ac90e905ab7d199e..30f72b9655e790d864fc7e28983b6a37074448a5 100644
--- a/ui/display/mac/screen_mac.mm
+++ b/ui/display/mac/screen_mac.mm
@@ -268,7 +268,17 @@ DisplayMac BuildDisplayForScreen(NSScreen* screen) {
@ -25,5 +25,5 @@ index 2185525edaf5e14b57055e1043db0299bed87fd8..0d5ef8c48f08b1eb5ed878ab8934f2ec
display.set_is_monochrome(CGDisplayUsesForceToGray());
+#endif
if (auto display_link = ui::DisplayLinkMac::GetForDisplay(display_id))
display.set_display_frequency(display_link->GetRefreshRate());
// Query the display's referesh rate.
{

Просмотреть файл

@ -39,7 +39,7 @@ index 91a65a1e700cf1accb8e4541e0ceca4e0a734b16..323b9b48214aa013ad8f7da2f63cca2e
} // namespace base
diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
index d2b217adce962850647ddfd7898414c86b90baa4..45c81cebf3e776f2ca9de34252971ad5e959d915 100644
index be594941e41d59cfc6bc34ce1fc21ca1b2d399c0..f46b0979f66fdb77bfdbd22358f306c6cf505816 100644
--- a/base/mac/foundation_util.mm
+++ b/base/mac/foundation_util.mm
@@ -28,12 +28,6 @@

Просмотреть файл

@ -95,7 +95,7 @@ index 58e974137f318b0f990e0b77630fe3a51db62c8c..8638f9ee32bea5fca67a377f27f3e24b
// The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that
// can only be accomplished by overriding methods.
diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
index 3b1f523659e1199ac41637e2c4cc1c059c0a2807..47486ff72d496c10c3f238b7be89d5c241c373c7 100644
index e90c7946c683f23852c785769e1c2809ec4f4961..6ebef9ed0e77fd215f3ee58c542549345d5e630c 100644
--- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
+++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
@@ -96,7 +96,9 @@ void OrderChildWindow(NSWindow* child_window,
@ -108,7 +108,7 @@ index 3b1f523659e1199ac41637e2c4cc1c059c0a2807..47486ff72d496c10c3f238b7be89d5c2
- (BOOL)hasKeyAppearance;
- (long long)_resizeDirectionForMouseLocation:(CGPoint)location;
- (BOOL)_isConsideredOpenForPersistentState;
@@ -129,6 +131,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event {
@@ -134,6 +136,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event {
}
@end
@ -117,7 +117,7 @@ index 3b1f523659e1199ac41637e2c4cc1c059c0a2807..47486ff72d496c10c3f238b7be89d5c2
@implementation NativeWidgetMacNSWindowTitledFrame
- (void)mouseDown:(NSEvent*)event {
if (self.window.isMovable)
@@ -155,6 +159,8 @@ - (BOOL)usesCustomDrawing {
@@ -160,6 +164,8 @@ - (BOOL)usesCustomDrawing {
}
@end
@ -126,7 +126,7 @@ index 3b1f523659e1199ac41637e2c4cc1c059c0a2807..47486ff72d496c10c3f238b7be89d5c2
@implementation NativeWidgetMacNSWindow {
@private
base::scoped_nsobject<CommandDispatcher> _commandDispatcher;
@@ -347,6 +353,8 @@ - (NSAccessibilityRole)accessibilityRole {
@@ -355,6 +361,8 @@ - (NSAccessibilityRole)accessibilityRole {
// NSWindow overrides.
@ -135,7 +135,7 @@ index 3b1f523659e1199ac41637e2c4cc1c059c0a2807..47486ff72d496c10c3f238b7be89d5c2
+ (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
if (windowStyle & NSWindowStyleMaskTitled) {
if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class])
@@ -358,6 +366,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
@@ -366,6 +374,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
return [super frameViewClassForStyleMask:windowStyle];
}

Просмотреть файл

@ -44,7 +44,7 @@ index 3600a7ce7b3e6540767f64c631f352aa62240459..3147961f3d1c2c1690b5adf16a9a58f7
} // namespace
diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
index f13ccec0334aa6b47cce180630b15298b86a4162..fa76a984f3dea99bdb337b44ceb8e397cae6a4ec 100644
index 6a27c02614d29631de16e1c4b9b863c76de9aa24..672ecaf054d5317f957decb1fd84772bc34105b7 100644
--- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
+++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
@@ -572,10 +572,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
@ -213,10 +213,10 @@ index a7cbd153f799d8e6da61fb255c3d1d70c18fa514..2e3a87b7694f105a684ac2500ae5fb68
///////////////////////////////////////////////////////////////////////////////
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index cd69e2430bec3724f43a08318254272c0512e980..056a7b1bd399510688841cb68da3985690deb0c7 100644
index c10eb3bb795c3a6178f50b972eaf4b70808ccf37..9ffa8129d29ecda50f91355ffd01ce9926a70b11 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -368,6 +368,13 @@ component("base") {
@@ -374,6 +374,13 @@ component("base") {
sources += [ "resource/resource_bundle_lacros.cc" ]
}
@ -251,10 +251,10 @@ index aa09619a3137d1878c9f5c111a348703965dd16f..6553de29e861c15028564ffe4a4b9b01
+
#endif // UI_BASE_COCOA_REMOTE_ACCESSIBILITY_API_H_
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h
index aa89421a689ad3f0872e51fa19624d2371948c21..e63b249a9bdc23545121a513156bfa32e92fec0b 100644
index 4b06ace2dac87685a3a5b26ead3d977e035a9c21..faa5b59e81c463d93000b23dc2697192e9cedb1f 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.h
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h
@@ -32,7 +32,9 @@
@@ -31,7 +31,9 @@
#include "ui/views/window/dialog_observer.h"
@class NativeWidgetMacNSWindow;
@ -264,7 +264,7 @@ index aa89421a689ad3f0872e51fa19624d2371948c21..e63b249a9bdc23545121a513156bfa32
@class NSView;
namespace remote_cocoa {
@@ -458,11 +460,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
@@ -451,11 +453,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
mojo::AssociatedRemote<remote_cocoa::mojom::NativeWidgetNSWindow>
remote_ns_window_remote_;
@ -279,10 +279,10 @@ index aa89421a689ad3f0872e51fa19624d2371948c21..e63b249a9bdc23545121a513156bfa32
// Used to force the NSApplication's focused accessibility element to be the
// views::Views accessibility tree when the NSView for this is focused.
diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
index dca21f43003231445b2c6fe0cfe07cd9ad9247ba..c6a33c2a85206295426292406291af670ce65ab0 100644
index 68663d9ee9c528b55fe98e880c9e6f736fc6dc35..d932bd087e3b127dc8f9cbf3bc8acacd25e028fc 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -339,14 +339,22 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
@@ -339,7 +339,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
NativeWidgetMacNSWindowHost::GetNativeViewAccessibleForNSView() const {
if (in_process_ns_window_bridge_)
return in_process_ns_window_bridge_->ns_view();
@ -294,9 +294,10 @@ index dca21f43003231445b2c6fe0cfe07cd9ad9247ba..c6a33c2a85206295426292406291af67
}
gfx::NativeViewAccessible
NativeWidgetMacNSWindowHost::GetNativeViewAccessibleForNSWindow() const {
if (in_process_ns_window_bridge_)
return in_process_ns_window_bridge_->ns_window();
@@ -354,7 +358,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
return [in_process_ns_window_bridge_->ns_view() window];
}
+#if !IS_MAS_BUILD()
return remote_window_accessible_.get();
+#else
@ -305,7 +306,7 @@ index dca21f43003231445b2c6fe0cfe07cd9ad9247ba..c6a33c2a85206295426292406291af67
}
remote_cocoa::mojom::NativeWidgetNSWindow*
@@ -1333,6 +1341,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
@@ -1326,6 +1334,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens(
const std::vector<uint8_t>& window_token,
const std::vector<uint8_t>& view_token) {
@ -313,7 +314,7 @@ index dca21f43003231445b2c6fe0cfe07cd9ad9247ba..c6a33c2a85206295426292406291af67
remote_window_accessible_ =
ui::RemoteAccessibility::GetRemoteElementFromToken(window_token);
remote_view_accessible_ =
@@ -1340,14 +1349,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
@@ -1333,14 +1342,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
[remote_view_accessible_ setWindowUIElement:remote_window_accessible_.get()];
[remote_view_accessible_
setTopLevelUIElement:remote_window_accessible_.get()];

Просмотреть файл

@ -41,7 +41,7 @@ index 6c0ab25b4faeee4095beaa10a57932021d690785..09fa4b7fb10790c2349edab7108e9d21
gfx::Size pixel_size_;
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
index 7ecc5ff37d7a6c156f432e9968bcce340a38b533..f5de541a91c72ef80941434b6cb55b298d8744f7 100644
index 8c2c3758cdd7fb194db1360b98b59a08c781fc7b..bc05822738f3984b8c116fac9c152de3d1bee6d3 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
@@ -55,7 +55,9 @@
@ -73,7 +73,7 @@ index 7ecc5ff37d7a6c156f432e9968bcce340a38b533..f5de541a91c72ef80941434b6cb55b29
#if BUILDFLAG(IS_MAC)
if (features::UseGpuVsync()) {
@@ -175,9 +182,13 @@
@@ -177,9 +184,13 @@
TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers", TRACE_EVENT_SCOPE_THREAD,
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
"width", pixel_size_.width());

Просмотреть файл

@ -9,10 +9,10 @@ system font by checking if it's kCTFontPriorityAttribute is set to
system priority.
diff --git a/ui/gfx/platform_font_mac.mm b/ui/gfx/platform_font_mac.mm
index 1c563484862eedcd260db03036769778c6a48991..cd47d4c83bd99587c3e5b77941c4b4bbb01280b8 100644
index 1e1bfb0068096b7ff8c8e1913ee884a245cfb226..2a30628c84d8f6bc2fd5548e838d2d13824bc7d3 100644
--- a/ui/gfx/platform_font_mac.mm
+++ b/ui/gfx/platform_font_mac.mm
@@ -27,9 +27,11 @@
@@ -32,9 +32,11 @@
using Weight = Font::Weight;
@ -24,7 +24,7 @@ index 1c563484862eedcd260db03036769778c6a48991..cd47d4c83bd99587c3e5b77941c4b4bb
namespace {
@@ -243,7 +245,13 @@ CTFontRef SystemFontForConstructorOfType(PlatformFontMac::SystemFontType type) {
@@ -249,7 +251,13 @@ CTFontRef SystemFontForConstructorOfType(PlatformFontMac::SystemFontType type) {
// TODO(avi, etienneb): Figure out this font stuff.
base::ScopedCFTypeRef<CTFontDescriptorRef> descriptor(
CTFontCopyFontDescriptor(font));

Просмотреть файл

@ -133,10 +133,10 @@ index bbd2aa78722fc0a14ac815ca0243b83965ad8d7c..b6e0a2fce3a0fb9c449aa1bef6a0f970
const GURL& document_url,
const WeakDocumentPtr& weak_document_ptr,
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index acd1beec90cac362a126b3569a86016f0328cd0c..73435bda2d393fb22ce4cff0917d90e6ec111c69 100644
index da1be3451a2be4a9e02bca28456906e398f2ebd1..2ff019b77e65e7ac2915c83cfc4f467c7789b678 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2135,7 +2135,7 @@ void RenderProcessHostImpl::CreateNotificationService(
@@ -2148,7 +2148,7 @@ void RenderProcessHostImpl::CreateNotificationService(
case RenderProcessHost::NotificationServiceCreatorType::kSharedWorker:
case RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker: {
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
@ -145,7 +145,7 @@ index acd1beec90cac362a126b3569a86016f0328cd0c..73435bda2d393fb22ce4cff0917d90e6
creator_type, std::move(receiver));
break;
}
@@ -2143,7 +2143,7 @@ void RenderProcessHostImpl::CreateNotificationService(
@@ -2156,7 +2156,7 @@ void RenderProcessHostImpl::CreateNotificationService(
CHECK(rfh);
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(

Просмотреть файл

@ -8,10 +8,10 @@ needed in chromium but our autofill implementation uses them. This patch can be
our autofill implementation to work like Chromium's.
diff --git a/ui/color/color_id.h b/ui/color/color_id.h
index ea088b263d70c0aae6ceae7e15ebe74a906ebc90..5aaced24d344f37f089579e3627b864ce502c53f 100644
index 112fccec57bdeb25857516c70f984d31bcc3cbeb..fdb578b491dc7cc431319b20eec483131ca4096b 100644
--- a/ui/color/color_id.h
+++ b/ui/color/color_id.h
@@ -355,6 +355,10 @@
@@ -359,6 +359,10 @@
E_CPONLY(kColorScrollbarThumbInactive) \
E_CPONLY(kColorScrollbarThumbPressed) \
E_CPONLY(kColorScrollbarTrack) \
@ -19,10 +19,10 @@ index ea088b263d70c0aae6ceae7e15ebe74a906ebc90..5aaced24d344f37f089579e3627b864c
+ E_CPONLY(kColorResultsTableHoveredBackground) \
+ E_CPONLY(kColorResultsTableNormalText) \
+ E_CPONLY(kColorResultsTableDimmedText) \
E_CPONLY(kColorSeparator) \
E_CPONLY(kColorShadowBase) \
E_CPONLY(kColorShadowValueAmbientShadowElevationSixteen) \
@@ -428,6 +432,7 @@
E_CPONLY(kColorSegmentedButtonBorder) \
E_CPONLY(kColorSegmentedButtonFocus) \
E_CPONLY(kColorSegmentedButtonForegroundChecked) \
@@ -445,6 +449,7 @@
E_CPONLY(kColorTreeNodeForeground) \
E_CPONLY(kColorTreeNodeForegroundSelectedFocused) \
E_CPONLY(kColorTreeNodeForegroundSelectedUnfocused) \
@ -31,10 +31,10 @@ index ea088b263d70c0aae6ceae7e15ebe74a906ebc90..5aaced24d344f37f089579e3627b864c
#if BUILDFLAG(IS_CHROMEOS)
diff --git a/ui/color/ui_color_mixer.cc b/ui/color/ui_color_mixer.cc
index 7b250f1ac38e0c16a5412660876ec0dc9367d353..dc51327e0e87b204ee42afe665a4ea493c21ac14 100644
index b98320a87ce8601e28038cc15fd29d442bd57e34..d70fabe9f709ba5af1200db1a953d7ef7b65cffb 100644
--- a/ui/color/ui_color_mixer.cc
+++ b/ui/color/ui_color_mixer.cc
@@ -219,6 +219,17 @@ void AddUiColorMixer(ColorProvider* provider,
@@ -207,6 +207,17 @@ void AddUiColorMixer(ColorProvider* provider,
: SkColorSetA(SK_ColorBLACK, 0x80)};
mixer[kColorScrollbarTrack] = {dark_mode ? SkColorSetRGB(0x42, 0x42, 0x42)
: SkColorSetRGB(0xF1, 0xF1, 0xF1)};
@ -52,7 +52,7 @@ index 7b250f1ac38e0c16a5412660876ec0dc9367d353..dc51327e0e87b204ee42afe665a4ea49
mixer[kColorSeparator] = {kColorMidground};
mixer[kColorShadowBase] = {dark_mode ? SK_ColorBLACK : gfx::kGoogleGrey800};
mixer[kColorShadowValueAmbientShadowElevationThree] =
@@ -316,6 +327,7 @@ void AddUiColorMixer(ColorProvider* provider,
@@ -304,6 +315,7 @@ void AddUiColorMixer(ColorProvider* provider,
mixer[kColorTreeNodeForegroundSelectedFocused] = {kColorTreeNodeForeground};
mixer[kColorTreeNodeForegroundSelectedUnfocused] = {
kColorTreeNodeForegroundSelectedFocused};
@ -61,10 +61,10 @@ index 7b250f1ac38e0c16a5412660876ec0dc9367d353..dc51327e0e87b204ee42afe665a4ea49
}
diff --git a/ui/color/win/native_color_mixers_win.cc b/ui/color/win/native_color_mixers_win.cc
index 1a26abccb3008e78881d2ddfadba904d5c9b422e..b9ff42c4a65972ad937bb379ad5318bd15e5a22a 100644
index a688e73fe91dc4a0279a2544e54fc42bc9404d84..331770a1218100c9e52e776213662cf622276b08 100644
--- a/ui/color/win/native_color_mixers_win.cc
+++ b/ui/color/win/native_color_mixers_win.cc
@@ -203,6 +203,10 @@ void AddNativeUiColorMixer(ColorProvider* provider,
@@ -199,6 +199,10 @@ void AddNativeUiColorMixer(ColorProvider* provider,
SetAlpha(kColorNotificationInputForeground, gfx::kGoogleGreyAlpha700);
mixer[kColorSliderTrack] = AlphaBlend(
kColorNativeHighlight, kColorNativeWindow, gfx::kGoogleGreyAlpha400);
@ -75,7 +75,7 @@ index 1a26abccb3008e78881d2ddfadba904d5c9b422e..b9ff42c4a65972ad937bb379ad5318bd
// Window Background
mixer[kColorBubbleFooterBackground] = {kColorNativeWindow};
@@ -211,6 +215,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
@@ -207,6 +211,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
mixer[kColorFrameInactive] = {ui::kColorNativeWindow};
mixer[kColorPrimaryBackground] = {kColorNativeWindow};
mixer[kColorTooltipBackground] = {kColorNativeWindow};
@ -83,7 +83,7 @@ index 1a26abccb3008e78881d2ddfadba904d5c9b422e..b9ff42c4a65972ad937bb379ad5318bd
// Window Text
mixer[kColorAlertLowSeverity] = {kColorNativeWindowText};
@@ -224,6 +229,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
@@ -220,6 +225,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
mixer[kColorTableGroupingIndicator] = {kColorNativeWindowText};
mixer[kColorThrobber] = {kColorNativeWindowText};
mixer[kColorTooltipForeground] = {kColorNativeWindowText};
@ -91,7 +91,7 @@ index 1a26abccb3008e78881d2ddfadba904d5c9b422e..b9ff42c4a65972ad937bb379ad5318bd
// Hyperlinks
mixer[kColorLinkForeground] = {kColorNativeHotlight};
@@ -266,6 +272,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
@@ -262,6 +268,7 @@ void AddNativeUiColorMixer(ColorProvider* provider,
mixer[kColorTextfieldForeground] = {kColorNativeBtnText};
mixer[kColorTextfieldForegroundPlaceholder] = {kColorNativeBtnText};
mixer[kColorTextfieldForegroundDisabled] = {kColorNativeBtnText};

Просмотреть файл

@ -11,7 +11,7 @@ majority of changes originally come from these PRs:
This patch also fixes callback for manual user cancellation and success.
diff --git a/BUILD.gn b/BUILD.gn
index 9c4b529ba6998cd0078b2b686008d14ee3fa204c..b598c88e4992d0ba327b8c1f23c826fe3ee50e0e 100644
index ea3d57d0937407a40e3c78bdffa18bb46a92300f..48e582b206dd31014f7e61f15725a2676f222587 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -974,7 +974,6 @@ if (is_win) {
@ -34,10 +34,10 @@ index 9c4b529ba6998cd0078b2b686008d14ee3fa204c..b598c88e4992d0ba327b8c1f23c826fe
}
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc
index b496ff49232f449fd6cea9dc1927b833c049497b..4c12ca65c1f800ddbbb792716f09f63fff8fa7d4 100644
index 3a66a52b8d3c6da9cd8d7e9afdc8d59f528ec3d5..facaa6fbca8ee7c04f83607e62b81b9594727ada 100644
--- a/chrome/browser/printing/print_job.cc
+++ b/chrome/browser/printing/print_job.cc
@@ -91,6 +91,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
@@ -93,6 +93,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
return base::FeatureList::IsEnabled(features::kPrintWithReducedRasterization);
}
@ -45,7 +45,7 @@ index b496ff49232f449fd6cea9dc1927b833c049497b..4c12ca65c1f800ddbbb792716f09f63f
PrefService* GetPrefsForWebContents(content::WebContents* web_contents) {
// TODO(thestig): Figure out why crbug.com/1083911 occurred, which is likely
// because `web_contents` was null. As a result, this section has many more
@@ -105,6 +106,7 @@ content::WebContents* GetWebContents(content::GlobalRenderFrameHostId rfh_id) {
@@ -107,6 +108,7 @@ content::WebContents* GetWebContents(content::GlobalRenderFrameHostId rfh_id) {
auto* rfh = content::RenderFrameHost::FromID(rfh_id);
return rfh ? content::WebContents::FromRenderFrameHost(rfh) : nullptr;
}
@ -53,7 +53,20 @@ index b496ff49232f449fd6cea9dc1927b833c049497b..4c12ca65c1f800ddbbb792716f09f63f
#endif // BUILDFLAG(IS_WIN)
@@ -363,8 +365,10 @@ void PrintJob::StartPdfToEmfConversion(
@@ -147,10 +149,8 @@ void PrintJob::Initialize(std::unique_ptr<PrinterQuery> query,
#if BUILDFLAG(IS_WIN)
pdf_page_mapping_ = PageNumber::GetPages(settings->ranges(), page_count);
- PrefService* prefs = GetPrefsForWebContents(GetWebContents(rfh_id_));
- if (prefs && prefs->IsManagedPreference(prefs::kPdfUseSkiaRendererEnabled)) {
- use_skia_ = prefs->GetBoolean(prefs::kPdfUseSkiaRendererEnabled);
- }
+ // TODO(codebytere): should we enable this later?
+ use_skia_ = false;
#endif
auto new_doc = base::MakeRefCounted<PrintedDocument>(std::move(settings),
@@ -374,8 +374,10 @@ void PrintJob::StartPdfToEmfConversion(
const PrintSettings& settings = document()->settings();
@ -65,7 +78,7 @@ index b496ff49232f449fd6cea9dc1927b833c049497b..4c12ca65c1f800ddbbb792716f09f63f
using RenderMode = PdfRenderSettings::Mode;
RenderMode mode = print_with_reduced_rasterization
@@ -454,8 +458,10 @@ void PrintJob::StartPdfToPostScriptConversion(
@@ -465,8 +467,10 @@ void PrintJob::StartPdfToPostScriptConversion(
if (ps_level2) {
mode = PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2;
} else {
@ -78,7 +91,7 @@ index b496ff49232f449fd6cea9dc1927b833c049497b..4c12ca65c1f800ddbbb792716f09f63f
: PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3;
}
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576ec12ac3a 100644
index d7a3961a5c79e4d4f9f0fc5fbd6f1c55ab65ca9d..cf200ee43464bcde31dc13c18524e58d4ac2479b 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -23,7 +23,9 @@
@ -91,7 +104,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
#include "chrome/browser/printing/print_job.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/print_view_manager_common.h"
@@ -79,6 +81,20 @@ namespace printing {
@@ -83,6 +85,20 @@ namespace printing {
namespace {
@ -112,7 +125,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
void OnDidGetDefaultPrintSettings(
scoped_refptr<PrintQueriesQueue> queue,
bool want_pdf_settings,
@@ -87,9 +103,11 @@ void OnDidGetDefaultPrintSettings(
@@ -91,9 +107,11 @@ void OnDidGetDefaultPrintSettings(
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (printer_query->last_status() != mojom::ResultCode::kSuccess) {
@ -124,7 +137,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
std::move(callback).Run(nullptr);
return;
}
@@ -99,9 +117,11 @@ void OnDidGetDefaultPrintSettings(
@@ -103,9 +121,11 @@ void OnDidGetDefaultPrintSettings(
params->document_cookie = printer_query->cookie();
if (!PrintMsgPrintParamsIsValid(*params)) {
@ -136,7 +149,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
std::move(callback).Run(nullptr);
return;
}
@@ -118,7 +138,7 @@ void OnDidScriptedPrint(
@@ -122,7 +142,7 @@ void OnDidScriptedPrint(
if (printer_query->last_status() != mojom::ResultCode::kSuccess ||
!printer_query->settings().dpi()) {
@ -145,7 +158,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return;
}
@@ -128,12 +148,13 @@ void OnDidScriptedPrint(
@@ -132,12 +152,13 @@ void OnDidScriptedPrint(
params->params.get());
params->params->document_cookie = printer_query->cookie();
if (!PrintMsgPrintParamsIsValid(*params->params)) {
@ -161,7 +174,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
queue->QueuePrinterQuery(std::move(printer_query));
}
@@ -170,9 +191,11 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
@@ -174,9 +195,11 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
: PrintManager(web_contents),
queue_(g_browser_process->print_job_manager()->queue()) {
DCHECK(queue_);
@ -174,9 +187,9 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
PrintViewManagerBase::~PrintViewManagerBase() {
@@ -180,7 +203,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
DisconnectFromCurrentPrintJob();
@@ -199,7 +222,10 @@ void PrintViewManagerBase::DisableThirdPartyBlocking() {
}
#endif // BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
-bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
+bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh,
@ -186,7 +199,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
// Remember the ID for `rfh`, to enable checking that the `RenderFrameHost`
// is still valid after a possible inner message loop runs in
// `DisconnectFromCurrentPrintJob()`.
@@ -208,7 +234,12 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
@@ -227,7 +253,12 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
#endif
SetPrintingRFH(rfh);
@ -199,7 +212,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return true;
}
@@ -432,7 +463,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
@@ -451,7 +482,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
void PrintViewManagerBase::ScriptedPrintReply(
ScriptedPrintCallback callback,
int process_id,
@ -209,7 +222,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
#if BUILDFLAG(ENABLE_OOP_PRINTING)
@@ -447,12 +479,15 @@ void PrintViewManagerBase::ScriptedPrintReply(
@@ -466,12 +498,15 @@ void PrintViewManagerBase::ScriptedPrintReply(
return;
}
@ -227,7 +240,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
}
@@ -588,10 +623,12 @@ void PrintViewManagerBase::DidPrintDocument(
@@ -607,10 +642,12 @@ void PrintViewManagerBase::DidPrintDocument(
void PrintViewManagerBase::GetDefaultPrintSettings(
GetDefaultPrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@ -240,7 +253,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
#if BUILDFLAG(ENABLE_OOP_PRINTING)
if (printing::features::kEnableOopPrintDriversJobPrint.Get() &&
#if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
@@ -643,10 +680,12 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -661,10 +698,12 @@ void PrintViewManagerBase::UpdatePrintSettings(
base::Value::Dict job_settings,
UpdatePrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@ -253,7 +266,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
absl::optional<int> printer_type_value =
job_settings.FindInt(kSettingPrinterType);
@@ -657,6 +696,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -675,6 +714,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
mojom::PrinterType printer_type =
static_cast<mojom::PrinterType>(*printer_type_value);
@ -261,7 +274,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
if (printer_type != mojom::PrinterType::kExtension &&
printer_type != mojom::PrinterType::kPdf &&
printer_type != mojom::PrinterType::kLocal) {
@@ -676,6 +716,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -694,6 +734,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
if (value > 0)
job_settings.Set(kSettingRasterizePdfDpi, value);
}
@ -269,7 +282,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
std::unique_ptr<PrintSettings> print_settings =
PrintSettingsFromJobSettings(job_settings);
@@ -725,7 +766,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -743,7 +784,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
void PrintViewManagerBase::IsPrintingEnabled(
IsPrintingEnabledCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@ -278,7 +291,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
@@ -741,14 +782,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
@@ -759,14 +800,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
// didn't happen for some reason.
bad_message::ReceivedBadMessage(
render_process_host, bad_message::PVMB_SCRIPTED_PRINT_FENCED_FRAME);
@ -295,7 +308,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return;
}
#endif
@@ -786,6 +827,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
@@ -801,6 +842,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
PrintManager::PrintingFailed(cookie, reason);
@ -303,7 +316,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
// `PrintingFailed()` can occur because asynchronous compositing results
// don't complete until after a print job has already failed and been
// destroyed. In such cases the error notification to the user will
@@ -795,7 +837,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
@@ -810,7 +852,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
print_job_->document()->cookie() == cookie) {
ShowPrintErrorDialogForGenericError();
}
@ -312,7 +325,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
ReleasePrinterQuery();
}
@@ -807,15 +849,24 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
@@ -822,15 +864,24 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
observers_.RemoveObserver(&observer);
}
@ -337,7 +350,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
void PrintViewManagerBase::RenderFrameDeleted(
@@ -867,7 +918,12 @@ void PrintViewManagerBase::OnJobDone() {
@@ -882,7 +933,12 @@ void PrintViewManagerBase::OnJobDone() {
// Printing is done, we don't need it anymore.
// print_job_->is_job_pending() may still be true, depending on the order
// of object registration.
@ -351,7 +364,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
ReleasePrintJob();
}
@@ -876,9 +932,10 @@ void PrintViewManagerBase::OnCanceling() {
@@ -891,9 +947,10 @@ void PrintViewManagerBase::OnCanceling() {
}
void PrintViewManagerBase::OnFailed() {
@ -363,7 +376,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
TerminatePrintJob(true);
}
@@ -888,7 +945,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
@@ -903,7 +960,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
// Is the document already complete?
if (print_job_->document() && print_job_->document()->IsComplete()) {
@ -372,7 +385,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return true;
}
@@ -936,7 +993,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -951,7 +1008,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
// Disconnect the current `print_job_`.
auto weak_this = weak_ptr_factory_.GetWeakPtr();
@ -384,7 +397,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
if (!weak_this)
return false;
@@ -957,7 +1017,7 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -972,7 +1032,7 @@ bool PrintViewManagerBase::CreateNewPrintJob(
#endif
print_job_->AddObserver(*this);
@ -393,7 +406,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return true;
}
@@ -1019,6 +1079,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -1034,6 +1094,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
}
#endif
@ -405,7 +418,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
if (!print_job_)
return;
@@ -1026,7 +1091,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -1041,7 +1106,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
// printing_rfh_ should only ever point to a RenderFrameHost with a live
// RenderFrame.
DCHECK(rfh->IsRenderFrameLive());
@ -414,7 +427,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
print_job_->RemoveObserver(*this);
@@ -1068,7 +1133,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
@@ -1083,7 +1148,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
}
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
@ -423,7 +436,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
return true;
if (!cookie) {
@@ -1176,7 +1241,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
@@ -1191,7 +1256,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
}
void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) {
@ -432,7 +445,7 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
for (auto& observer : GetObservers())
observer.OnPrintNow(rfh);
@@ -1224,7 +1289,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis(
@@ -1239,7 +1304,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis(
bool allowed) {
if (!allowed || !printing_rfh_ || IsCrashed() ||
!printing_rfh_->IsRenderFrameLive()) {
@ -442,10 +455,10 @@ index 6756967e1df3d985eab45aaaefcf5dd2f7025b9a..5dcee39d6778684f7cd171b97c68e576
}
CompleteScriptedPrint(printing_rfh_, std::move(params), std::move(callback));
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296cc9133923 100644
index 0b07b29da7df2595270391aed19e6eecd53b9f02..a5fb7fb6aac719df0dfed116daf798314a07b244 100644
--- a/chrome/browser/printing/print_view_manager_base.h
+++ b/chrome/browser/printing/print_view_manager_base.h
@@ -46,6 +46,8 @@ namespace printing {
@@ -47,6 +47,8 @@ namespace printing {
class PrintQueriesQueue;
class PrinterQuery;
@ -454,7 +467,7 @@ index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296c
// Base class for managing the print commands for a WebContents.
class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
public:
@@ -74,7 +76,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -80,7 +82,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// Prints the current document immediately. Since the rendering is
// asynchronous, the actual printing will not be completed on the return of
// this function. Returns false if printing is impossible at the moment.
@ -466,7 +479,7 @@ index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296c
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Prints the document in `print_data` with settings specified in
@@ -126,8 +131,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -132,8 +137,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
void IsPrintingEnabled(IsPrintingEnabledCallback callback) override;
void ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
ScriptedPrintCallback callback) override;
@ -477,7 +490,7 @@ index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296c
// Adds and removes observers for `PrintViewManagerBase` events. The order in
// which notifications are sent to observers is undefined. Observers must be
@@ -135,6 +142,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -141,6 +148,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
void AddObserver(Observer& observer);
void RemoveObserver(Observer& observer);
@ -492,7 +505,7 @@ index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296c
protected:
explicit PrintViewManagerBase(content::WebContents* web_contents);
@@ -285,7 +300,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -291,7 +306,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// Runs `callback` with `params` to reply to ScriptedPrint().
void ScriptedPrintReply(ScriptedPrintCallback callback,
int process_id,
@ -502,7 +515,7 @@ index af968282117eb3b6969b479a18765ec6908843be..59814c3f6c32c1aff0776031b37a296c
// Requests the RenderView to render all the missing pages for the print job.
// No-op if no print job is pending. Returns true if at least one page has
@@ -355,8 +371,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -361,8 +377,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// The current RFH that is printing with a system printing dialog.
raw_ptr<content::RenderFrameHost> printing_rfh_ = nullptr;
@ -620,7 +633,7 @@ index a65f892c435369b8a9a645ab4cc757ba8bdb68cc..50b51b702d565febf1b8bbe8cd58bcef
// Tells the browser printing failed.
PrintingFailed(int32 cookie, PrintFailureReason reason);
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a4021187426530b0d5 100644
index 2fc137bf2583006130b133008cb4c253e76449ed..13260dc05853f565c39f001332857c232ab73e9f 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -45,6 +45,7 @@
@ -631,7 +644,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
#include "printing/units.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
@@ -1314,7 +1315,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
@@ -1317,7 +1318,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
if (!weak_this)
return;
@ -641,7 +654,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
if (!weak_this)
return;
@@ -1345,7 +1347,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
@@ -1348,7 +1350,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
receivers_.Add(this, std::move(receiver));
}
@ -650,7 +663,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@@ -1360,7 +1362,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
@@ -1363,7 +1365,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
// plugin node and print that instead.
auto plugin = delegate_->GetPdfElement(frame);
@ -659,7 +672,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
if (!render_frame_gone_)
frame->DispatchAfterPrintEvent();
@@ -1439,7 +1441,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
@@ -1442,7 +1444,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
}
Print(frame, print_preview_context_.source_node(),
@ -669,7 +682,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
if (!render_frame_gone_)
print_preview_context_.DispatchAfterPrintEvent();
// WARNING: |this| may be gone at this point. Do not do any more work here and
@@ -1490,6 +1493,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
@@ -1493,6 +1496,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@ -678,7 +691,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
print_preview_context_.OnPrintPreview();
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -2107,7 +2112,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -2110,7 +2115,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
return;
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
@ -688,7 +701,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
// Check if |this| is still valid.
if (!weak_this)
return;
@@ -2122,7 +2128,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -2125,7 +2131,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
@ -699,7 +712,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
// If still not finished with earlier print request simply ignore.
if (prep_frame_view_)
return;
@@ -2130,7 +2138,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -2133,7 +2141,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
FrameReference frame_ref(frame);
uint32_t expected_page_count = 0;
@ -708,7 +721,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
DidFinishPrinting(FAIL_PRINT_INIT);
return; // Failed to init print page settings.
}
@@ -2149,8 +2157,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -2152,8 +2160,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
print_pages_params_->params->print_scaling_option;
auto self = weak_ptr_factory_.GetWeakPtr();
@ -793,7 +806,7 @@ index 9328ac374483e44200c6f85cb42462d2734c00a8..8eb81badf2ca16d0faca63a402118742
std::move(quit_closure).Run();
},
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
index 63376c5e434a8e2afa8e6c0f194377c6b5b8aff5..901dd4671ecee953927ab746eb974dcc1d04612a 100644
index 9376c3f858bea408d07ba09d988eaa300b4f550b..d62e09ca4ace8fe094a6b71c05e4ced1170ef056 100644
--- a/components/printing/renderer/print_render_frame_helper.h
+++ b/components/printing/renderer/print_render_frame_helper.h
@@ -253,7 +253,7 @@ class PrintRenderFrameHelper
@ -834,10 +847,10 @@ index 63376c5e434a8e2afa8e6c0f194377c6b5b8aff5..901dd4671ecee953927ab746eb974dcc
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Set options for print preset from source PDF document.
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index aa0030b7e54a411afd858803fa884f7e25783115..b2f8d8dab348d031510b3ff8a5cf5854feb77282 100644
index 7f8aea52f3aa4e3538125de9faa9215a9bb19af5..6c5c6f0771c72ac300e07398d4ed9bd3ce9a6ae3 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -2868,8 +2868,9 @@ source_set("browser") {
@@ -2881,8 +2881,9 @@ source_set("browser") {
"//ppapi/shared_impl",
]

Просмотреть файл

@ -30,23 +30,24 @@ index fe010b1f001130fbdeaf4ef9ce7798e4baf958b5..28f1305f439be7f669e482ac0e4804c0
// RenderWidgetHost on the primary main frame, and false otherwise.
virtual bool IsWidgetForPrimaryMainFrame(RenderWidgetHostImpl*);
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 347b8d89a2ecaa6baa4779f650b8af49a6d6d118..07b6f899132ab4b94fb9474d441461c8fcf53705 100644
index 90c6a5b6999571819ef71f859767cccf635ea883..d08149b8cb57ca357a2304fc9a8b8be4524b18f9 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2066,6 +2066,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) {
void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
if (view_)
@@ -2130,6 +2130,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
if (view_) {
view_->UpdateCursor(cursor);
+ if (delegate_)
}
+ if (delegate_) {
+ delegate_->OnCursorChanged(cursor);
+ }
}
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 87dcf40a7619ad8e9999cf07e2aa7a16e380125e..3faa83e00bfd72eebfac1290846bba1452b85bdb 100644
index fc91e5302297863c395982818a00e9c2946638f0..62bdbaae3dc3d320dfd038282f3946fab5abd0b9 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4759,6 +4759,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
@@ -4762,6 +4762,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
return text_input_manager_.get();
}
@ -59,10 +60,10 @@ index 87dcf40a7619ad8e9999cf07e2aa7a16e380125e..3faa83e00bfd72eebfac1290846bba14
RenderWidgetHostImpl* render_widget_host) {
return render_widget_host == GetPrimaryMainFrame()->GetRenderWidgetHost();
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index ea889f23e73044b6812c7e514956bee89ebb9396..69f9ffbf4826421491118a0b200d6c71e41f8950 100644
index 3eb26a731cf955241918f5018f6aaa17588c62fe..86c233a7cccf3146387b56b5427fe7d558379250 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -972,6 +972,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
@@ -971,6 +971,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
void SendScreenRects() override;
void SendActiveState(bool active) override;
TextInputManager* GetTextInputManager() override;

Просмотреть файл

@ -9,7 +9,7 @@ change to move more of //chrome spellchecker logic into //components so
that we can further separate our dependency from //chrome.
diff --git a/chrome/browser/profiles/profile_keyed_service_factory.cc b/chrome/browser/profiles/profile_keyed_service_factory.cc
index f14db439624e395bd6cd9d10d5aff480e0384293..ec860cd4033ac09f96be031147d70d2ccefb06c8 100644
index 30a7e6a641e7b17a47fb5c66fb44d3d5899b9e78..85764a533585df0abe398758e4fd510c711de375 100644
--- a/chrome/browser/profiles/profile_keyed_service_factory.cc
+++ b/chrome/browser/profiles/profile_keyed_service_factory.cc
@@ -22,6 +22,9 @@ ProfileKeyedServiceFactory::~ProfileKeyedServiceFactory() = default;
@ -23,10 +23,10 @@ index f14db439624e395bd6cd9d10d5aff480e0384293..ec860cd4033ac09f96be031147d70d2c
+#endif
}
diff --git a/chrome/browser/profiles/profile_selections.cc b/chrome/browser/profiles/profile_selections.cc
index b0515bd0a6c7c09e828c7e67f5f75e6b0a9ea46c..10aa2b39d4033d92fe7502532a497d394c4351d9 100644
index 7ecd897db8830378f82733d519c00c17093636cb..7e0a4eb93ac9444d760d13736c1a2f6381fc3a7b 100644
--- a/chrome/browser/profiles/profile_selections.cc
+++ b/chrome/browser/profiles/profile_selections.cc
@@ -181,6 +181,7 @@ Profile* ProfileSelections::ApplyProfileSelection(Profile* profile) const {
@@ -121,6 +121,7 @@ Profile* ProfileSelections::ApplyProfileSelection(Profile* profile) const {
ProfileSelection ProfileSelections::GetProfileSelection(
const Profile* profile) const {
@ -34,7 +34,7 @@ index b0515bd0a6c7c09e828c7e67f5f75e6b0a9ea46c..10aa2b39d4033d92fe7502532a497d39
#if BUILDFLAG(IS_CHROMEOS_ASH)
// This check has to be performed before the check on
// `profile->IsRegularProfile()` because profiles that are internal ASH
@@ -226,6 +227,7 @@ ProfileSelection ProfileSelections::GetProfileSelection(
@@ -156,6 +157,7 @@ ProfileSelection ProfileSelections::GetProfileSelection(
}
NOTREACHED();

Просмотреть файл

@ -10,7 +10,7 @@ kinds of utility windows. Similarly for `disableAutoHideCursor`.
Additionally, disables usage of some private APIs in MAS builds.
diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
index 311d9c2c7cf8fbe70861a67d43a6f82d430f98b2..179c909acfc0c0aef1c778aa2249bd758032c077 100644
index b95ab55cbffb41b9f13147c3ecf2675a5fe3d2a5..3adf9a51b72f732d425e93c477afdab2cec11dd1 100644
--- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
+++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
@@ -155,6 +155,15 @@ void ExtractUnderlines(NSAttributedString* string,
@ -61,7 +61,7 @@ index 311d9c2c7cf8fbe70861a67d43a6f82d430f98b2..179c909acfc0c0aef1c778aa2249bd75
// We only handle key down events and just simply forward other events.
if (eventType != NSEventTypeKeyDown) {
_hostHelper->ForwardKeyboardEvent(event, latency_info);
@@ -1801,9 +1821,11 @@ - (NSAccessibilityRole)accessibilityRole {
@@ -1819,9 +1839,11 @@ - (NSAccessibilityRole)accessibilityRole {
// Since this implementation doesn't have to wait any IPC calls, this doesn't
// make any key-typing jank. --hbono 7/23/09
//
@ -73,7 +73,7 @@ index 311d9c2c7cf8fbe70861a67d43a6f82d430f98b2..179c909acfc0c0aef1c778aa2249bd75
- (NSArray*)validAttributesForMarkedText {
// This code is just copied from WebKit except renaming variables.
@@ -1812,7 +1834,10 @@ - (NSArray*)validAttributesForMarkedText {
@@ -1830,7 +1852,10 @@ - (NSArray*)validAttributesForMarkedText {
initWithObjects:NSUnderlineStyleAttributeName,
NSUnderlineColorAttributeName,
NSMarkedClauseSegmentAttributeName,

Просмотреть файл

@ -52,10 +52,10 @@ Some alternatives to this patch:
None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index a1e405e63884f9f3af9b4c0803271ccf51158661..cde7a97b2fee1c7be9d8ff9c081b6739545ab22b 100644
index a0db274a53134fb1f1085185fc1030f6bc78917b..884bccba58c66861b43b3b50a7535cba543302e2 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -1587,7 +1587,7 @@ if (is_chrome_branded && !is_android) {
@@ -1599,7 +1599,7 @@ if (is_chrome_branded && !is_android) {
}
}
@ -64,7 +64,7 @@ index a1e405e63884f9f3af9b4c0803271ccf51158661..cde7a97b2fee1c7be9d8ff9c081b6739
chrome_paks("packed_resources") {
if (is_mac) {
output_dir = "$root_gen_dir/repack"
@@ -1616,6 +1616,12 @@ if (!is_android) {
@@ -1628,6 +1628,12 @@ if (!is_android) {
}
}

Просмотреть файл

@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
Patch to make scrollBounce option work.
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 484bed7f0e151b76af957537d38e4224ec83adbf..a5bf64d73a97a4100b72ae453005536facb873b0 100644
index 6b37ab029be690c4b773d54775730ea38181122c..67a98e4b6f8de2112c85e3786b4cdae112835a21 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -1352,7 +1352,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
@@ -1361,7 +1361,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
}
bool RenderThreadImpl::IsElasticOverscrollEnabled() {

Просмотреть файл

@ -22,10 +22,10 @@ However, the patch would need to be reviewed by the security team, as it
does touch a security-sensitive class.
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 73435bda2d393fb22ce4cff0917d90e6ec111c69..88492051b80ed4a989cb9fdf8231a38534ea4c7e 100644
index 2ff019b77e65e7ac2915c83cfc4f467c7789b678..15effd78c0a10f13dbd17b18daa12456a6bc19ae 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1820,9 +1820,15 @@ bool RenderProcessHostImpl::Init() {
@@ -1833,9 +1833,15 @@ bool RenderProcessHostImpl::Init() {
std::unique_ptr<SandboxedProcessLauncherDelegate> sandbox_delegate =
std::make_unique<RendererSandboxedProcessLauncherDelegateWin>(
*cmd_line, IsPdf(), IsJitDisabled());
@ -42,7 +42,7 @@ index 73435bda2d393fb22ce4cff0917d90e6ec111c69..88492051b80ed4a989cb9fdf8231a385
auto file_data = std::make_unique<ChildProcessLauncherFileData>();
diff --git a/content/browser/renderer_host/renderer_sandboxed_process_launcher_delegate.cc b/content/browser/renderer_host/renderer_sandboxed_process_launcher_delegate.cc
index c297e3fc2ffabb53e94908d7021ef3e750d4c0f1..4b723edd68f9c5668c5e8f3b12984a6f18392252 100644
index 5d96b358a52b01af0cb853125782af6202ae77b7..32b8ed19e9f265dc8f371c4e9c07f71487eb36f6 100644
--- a/content/browser/renderer_host/renderer_sandboxed_process_launcher_delegate.cc
+++ b/content/browser/renderer_host/renderer_sandboxed_process_launcher_delegate.cc
@@ -33,6 +33,9 @@ namespace content {

Просмотреть файл

@ -7,11 +7,11 @@ Make chrome's install-sysroot scripts point to our custom sysroot builds,
which include extra deps that Electron needs (e.g. libnotify)
diff --git a/build/linux/sysroot_scripts/install-sysroot.py b/build/linux/sysroot_scripts/install-sysroot.py
index 42842a184deb12b55c88b82134ef29f0d10c1a18..4dca0c2b63425b1592d0ee48b721402b8bebe347 100755
index 67d52b47a7531453a1baa83b6863441ef1fadea7..da0b2142ca3fa9d4228e2592b8be9930ee1acdb3 100755
--- a/build/linux/sysroot_scripts/install-sysroot.py
+++ b/build/linux/sysroot_scripts/install-sysroot.py
@@ -40,9 +40,11 @@ except ImportError:
from urllib2 import urlopen
@@ -33,9 +33,11 @@ import sys
from urllib.request import urlopen
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
+SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(SCRIPT_DIR)))
@ -22,9 +22,9 @@ index 42842a184deb12b55c88b82134ef29f0d10c1a18..4dca0c2b63425b1592d0ee48b721402b
+URL_PREFIX = 'https://dev-cdn.electronjs.org'
+URL_PATH = 'linux-sysroots'
VALID_ARCHS = ('arm', 'arm64', 'i386', 'amd64', 'mips', 'mips64el')
VALID_ARCHS = ('amd64', 'i386', 'armhf', 'arm64', 'armel', 'mipsel', 'mips64el')
@@ -106,7 +108,7 @@ def GetSysrootDict(target_platform, target_arch):
@@ -100,7 +102,7 @@ def GetSysrootDict(target_platform, target_arch):
if target_arch not in VALID_ARCHS:
raise Error('Unknown architecture: %s' % target_arch)

Просмотреть файл

@ -9,10 +9,10 @@ is needed for OSR.
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 57a810427461b8240d5f8da88e6ae2815b06c69a..a114c8a72670037fe0f4b9d95c16a67094f4c13c 100644
index 9dee22f645596fd2c2494c1f532e972099d89b2b..4181b7dd3c8ba467e3e762e5875a97df630e62dc 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3213,6 +3213,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
@@ -3216,6 +3216,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
params.main_frame_name, GetOpener(), primary_main_frame_policy,
base::UnguessableToken::Create());
@ -26,7 +26,7 @@ index 57a810427461b8240d5f8da88e6ae2815b06c69a..a114c8a72670037fe0f4b9d95c16a670
std::unique_ptr<WebContentsViewDelegate> delegate =
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
@@ -3223,6 +3230,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
@@ -3226,6 +3233,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
view_ = CreateWebContentsView(this, std::move(delegate),
&render_view_host_delegate_view_);
}
@ -35,7 +35,7 @@ index 57a810427461b8240d5f8da88e6ae2815b06c69a..a114c8a72670037fe0f4b9d95c16a670
CHECK(view_.get());
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 8baf744895c941df36d770ad17fca925a1dfd45f..44d75c043805f9bfb4b08741fc652aafc6c50740 100644
index c998b0813ca0448edcf5387f49b23c845f657b52..bcb06c6397eea9ef190b059b8e8c9238650d803f 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -96,10 +96,13 @@ class BrowserContext;

Просмотреть файл

@ -8,7 +8,7 @@ This allows dragging and dropping between <webview>s.
Originally landed in https://github.com/electron/libchromiumcontent/pull/267
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index d85232514f1a272e435489f7baecfa12b61288b8..07c20acd985351117edd270f65d9569c138742c4 100644
index 9c62577a692d58d7e16687782fdd715f9513bc96..f429cb79b89f1516a112e0b890d6b61aaeda8d3b 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -919,10 +919,7 @@ bool WebContentsViewAura::IsValidDragTarget(
@ -24,7 +24,7 @@ index d85232514f1a272e435489f7baecfa12b61288b8..07c20acd985351117edd270f65d9569c
////////////////////////////////////////////////////////////////////////////////
diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm
index 4a7153d7b6e23c372c6f4dd4b5d02eb2ed372ca0..aa165434b4db9a4663e890a4729badb322832af2 100644
index 786f17d53f81bd534b156e9959cfd9ed1c28d725..68adff99738dc2c215cf5f9532e95266e6239faa 100644
--- a/content/browser/web_contents/web_drag_dest_mac.mm
+++ b/content/browser/web_contents/web_drag_dest_mac.mm
@@ -386,9 +386,7 @@ - (void)resetDragStartTrackers {

Просмотреть файл

@ -14,10 +14,10 @@ Note that we also need to manually update embedder's
`api::WebContents::IsFullscreenForTabOrPending` value.
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
index 166293ad0d6246bcf477e6af57a9e6801b6f6f7b..2e56b99d9d8699cf4c115ceccd5f5d60ced08018 100644
index 6e4e9686134ba56655e28c47a215059fe76251c4..1b306473728f72564f22b3104c09a892edae38bb 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -6998,6 +6998,17 @@ void RenderFrameHostImpl::EnterFullscreen(
@@ -7020,6 +7020,17 @@ void RenderFrameHostImpl::EnterFullscreen(
}
}

Просмотреть файл

@ -10,10 +10,10 @@ An attempt to upstream this was made, but rejected:
https://chromium-review.googlesource.com/c/chromium/src/+/1954347
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
index 77f2c4fbf8c886c5c622f41d0b9da67d09b7d331..7aa2059f33dfa92828beec95f4716775e7291fed 100644
index 834a07bb92d77eceb37d0378e9fe2bf13a74a64d..13815369562c1f78c2411cde8e14d9e8795eff38 100644
--- a/content/public/renderer/content_renderer_client.h
+++ b/content/public/renderer/content_renderer_client.h
@@ -373,6 +373,11 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -371,6 +371,11 @@ class CONTENT_EXPORT ContentRendererClient {
virtual void DidInitializeWorkerContextOnWorkerThread(
v8::Local<v8::Context> context) {}
@ -26,10 +26,10 @@ index 77f2c4fbf8c886c5c622f41d0b9da67d09b7d331..7aa2059f33dfa92828beec95f4716775
// An empty URL is returned if the URL is not overriden.
virtual GURL OverrideFlashEmbedWithHTML(const GURL& url);
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
index 93de85d84231556a22becc3a60d798d4c954cedd..8b94565a7dc696ed80780de776201faab02c3803 100644
index 58caad274969fd4d5aa95b4a3c34d16a50aa0f5c..ef5350399cd32f72601be7256f94018b84b8ef29 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -827,6 +827,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
@@ -813,6 +813,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread();
}
@ -43,10 +43,10 @@ index 93de85d84231556a22becc3a60d798d4c954cedd..8b94565a7dc696ed80780de776201faa
const v8::Local<v8::Context>& worker) {
GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
index 0067dcb8b5c6b0079118c5f1ae1da98c72cef4a1..19822bd314f014e4433ec5c6271e71af12a4822e 100644
index 2a01122b6219089aef3d1992a76a056d99f2f993..b4c7fbebb3751d5c749da0d228989df27e93c01b 100644
--- a/content/renderer/renderer_blink_platform_impl.h
+++ b/content/renderer/renderer_blink_platform_impl.h
@@ -176,6 +176,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@@ -175,6 +175,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
void DidStartWorkerThread() override;
void WillStopWorkerThread() override;
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
@ -55,10 +55,10 @@ index 0067dcb8b5c6b0079118c5f1ae1da98c72cef4a1..19822bd314f014e4433ec5c6271e71af
const blink::WebSecurityOrigin& script_origin) override;
blink::ProtocolHandlerSecurityLevel GetProtocolHandlerSecurityLevel()
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
index 78eb25f4005fd40f8ff54c4dae3d49cdeab0de16..6ee3894d45f457726bdaf6899b69c381ef9aea3f 100644
index 1620ec518a7ef7f1421a84d66ae14761262524e3..030151f6c2617cd90ba953fc900e6918f0eb22ea 100644
--- a/third_party/blink/public/platform/platform.h
+++ b/third_party/blink/public/platform/platform.h
@@ -633,6 +633,7 @@ class BLINK_PLATFORM_EXPORT Platform {
@@ -622,6 +622,7 @@ class BLINK_PLATFORM_EXPORT Platform {
virtual void DidStartWorkerThread() {}
virtual void WillStopWorkerThread() {}
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}

Просмотреть файл

@ -19,10 +19,10 @@ that clearly establishes the worker script is ready for evaluation with the scop
initialized.
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
index 7aa2059f33dfa92828beec95f4716775e7291fed..df919b894d4f29274696806444d034d4fefb7ff9 100644
index 13815369562c1f78c2411cde8e14d9e8795eff38..42a3226c270b39658306db0b39df24b891086b21 100644
--- a/content/public/renderer/content_renderer_client.h
+++ b/content/public/renderer/content_renderer_client.h
@@ -373,6 +373,11 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -371,6 +371,11 @@ class CONTENT_EXPORT ContentRendererClient {
virtual void DidInitializeWorkerContextOnWorkerThread(
v8::Local<v8::Context> context) {}
@ -35,10 +35,10 @@ index 7aa2059f33dfa92828beec95f4716775e7291fed..df919b894d4f29274696806444d034d4
// from the worker thread.
virtual void WillDestroyWorkerContextOnWorkerThread(
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
index 8b94565a7dc696ed80780de776201faab02c3803..03b96e829bfc835cf96d3372849a91db3ce68500 100644
index ef5350399cd32f72601be7256f94018b84b8ef29..8227aece602f5b5ab876ac2cd07d6efd0a51f157 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -839,6 +839,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
@@ -825,6 +825,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
worker);
}
@ -52,10 +52,10 @@ index 8b94565a7dc696ed80780de776201faab02c3803..03b96e829bfc835cf96d3372849a91db
const blink::WebSecurityOrigin& script_origin) {
return GetContentClient()->renderer()->AllowScriptExtensionForServiceWorker(
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
index 19822bd314f014e4433ec5c6271e71af12a4822e..9d900d10c02928648d925e025322a614772ad98d 100644
index b4c7fbebb3751d5c749da0d228989df27e93c01b..44f5104bc1945ced2072a0f4f205148077ed6fa0 100644
--- a/content/renderer/renderer_blink_platform_impl.h
+++ b/content/renderer/renderer_blink_platform_impl.h
@@ -176,6 +176,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@@ -175,6 +175,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
void DidStartWorkerThread() override;
void WillStopWorkerThread() override;
void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
@ -65,10 +65,10 @@ index 19822bd314f014e4433ec5c6271e71af12a4822e..9d900d10c02928648d925e025322a614
bool AllowScriptExtensionForServiceWorker(
const blink::WebSecurityOrigin& script_origin) override;
diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
index 6ee3894d45f457726bdaf6899b69c381ef9aea3f..f311d98c18b4955f5257029a950644fd4423cbd6 100644
index 030151f6c2617cd90ba953fc900e6918f0eb22ea..a30bc4d59ef311bab43cf9f507f2a68c8f9c0848 100644
--- a/third_party/blink/public/platform/platform.h
+++ b/third_party/blink/public/platform/platform.h
@@ -633,6 +633,8 @@ class BLINK_PLATFORM_EXPORT Platform {
@@ -622,6 +622,8 @@ class BLINK_PLATFORM_EXPORT Platform {
virtual void DidStartWorkerThread() {}
virtual void WillStopWorkerThread() {}
virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}

Просмотреть файл

@ -36,10 +36,10 @@ index b22591ee606ef449817aef1f9bd5ff0c024d1c05..a14c0e0a381ae838d44d4c7f2cc252c2
import '../../ui/legacy/components/source_frame/source_frame-meta.js';
import '../../panels/console_counters/console_counters-meta.js';
diff --git a/front_end/ui/legacy/BUILD.gn b/front_end/ui/legacy/BUILD.gn
index 95f598ae7f4c01012d61e78bb83887fca5ca50ab..35e963c4289b538561b78c5e84d0d411e4da43ba 100644
index c0ff2a3161a654589c90077e2c1d50cfa8a0aba0..1e1204d315736c44d2299aeb33052e735efc08fa 100644
--- a/front_end/ui/legacy/BUILD.gn
+++ b/front_end/ui/legacy/BUILD.gn
@@ -184,5 +184,6 @@ devtools_entrypoint("legacy") {
@@ -185,5 +185,6 @@ devtools_entrypoint("legacy") {
visibility = [
"../..:legacy_entrypoints",
"../../legacy_test_runner/*",

Просмотреть файл

@ -34,3 +34,4 @@ fix_adapt_debugger_tests_for_upstream_v8_changes.patch
fix_libc_buffer_overflow_in_string_view_ctor.patch
fix_preventing_potential_oob_in_ada_no_scheme_parsing.patch
chore_remove_--no-harmony-atomics_related_code.patch
fix_account_for_createexternalizablestring_v8_global.patch

Просмотреть файл

@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Tue, 23 May 2023 18:21:17 +0200
Subject: fix: account for createExternalizableString V8 global
Introduced in https://chromium-review.googlesource.com/c/v8/v8/+/4531903.
This patch can be removed when Node.js upgrades to a version of V8 with the above
CL - they'll need to make the same change.
diff --git a/test/parallel/test-fs-write.js b/test/parallel/test-fs-write.js
index a321f1b27adaa3f376f5e61ce5d9c1ceb3427cc7..85e8603023854de120219a98449ee64fb7372200 100644
--- a/test/parallel/test-fs-write.js
+++ b/test/parallel/test-fs-write.js
@@ -40,7 +40,7 @@ const constants = fs.constants;
const { externalizeString, isOneByteString } = global;
// Account for extra globals exposed by --expose_externalize_string.
-common.allowGlobals(externalizeString, isOneByteString, global.x);
+common.allowGlobals(createExternalizableString, externalizeString, isOneByteString, global.x);
{
const expected = 'ümlaut sechzig'; // Must be a unique string.

Просмотреть файл

@ -791,7 +791,7 @@ index 2f2e443a7f6482c26f3a065520c8764d8402a91f..ccfe79ac65a223139f293f7dd034096f
+ legacyObjectCheck.serialNumberPattern);
}
diff --git a/test/parallel/test-crypto.js b/test/parallel/test-crypto.js
index a8ceb169de2b3de73f062083c42292babc673e73..a3bb574d0e5dc85b4ba3fb0b3bd8782fbb8c8700 100644
index a8ceb169de2b3de73f062083c42292babc673e73..8fb950d0814e5014faf5c1ef576b65795857da1b 100644
--- a/test/parallel/test-crypto.js
+++ b/test/parallel/test-crypto.js
@@ -67,7 +67,7 @@ assert.throws(() => {
@ -839,7 +839,24 @@ index a8ceb169de2b3de73f062083c42292babc673e73..a3bb574d0e5dc85b4ba3fb0b3bd8782f
(error) => {
assert.ok(!('opensslErrorStack' in error));
if (common.hasFipsCrypto) {
@@ -240,15 +238,15 @@ assert.throws(() => {
@@ -219,7 +217,7 @@ assert.throws(
return true;
}
);
-
+/*
assert.throws(() => {
const priv = [
'-----BEGIN RSA PRIVATE KEY-----',
@@ -232,6 +230,7 @@ assert.throws(() => {
].join('\n');
crypto.createSign('SHA256').update('test').sign(priv);
}, (err) => {
+ console.log(err)
if (!common.hasOpenSSL3)
assert.ok(!('opensslErrorStack' in err));
assert.throws(() => { throw err; }, common.hasOpenSSL3 ? {
@@ -240,10 +239,10 @@ assert.throws(() => {
library: 'rsa routines',
} : {
name: 'Error',
@ -854,13 +871,7 @@ index a8ceb169de2b3de73f062083c42292babc673e73..a3bb574d0e5dc85b4ba3fb0b3bd8782f
code: 'ERR_OSSL_RSA_DIGEST_TOO_BIG_FOR_RSA_KEY'
});
return true;
});
-
+/*
if (!common.hasOpenSSL3) {
assert.throws(() => {
// The correct header inside `rsa_private_pkcs8_bad.pem` should have been
@@ -276,7 +274,7 @@ if (!common.hasOpenSSL3) {
@@ -276,7 +275,7 @@ if (!common.hasOpenSSL3) {
return true;
});
}

Просмотреть файл

@ -9,10 +9,10 @@ necessary for native modules to load.
Also change visibility on mksnapshot in order to target mksnapshot for mksnapshot zip.
diff --git a/BUILD.gn b/BUILD.gn
index d75f44b55a89828845f69f148da147ea29d523e2..3140abb0868eb81976edacafc625bc80159b5aea 100644
index 337910a6431ca42017ccd15cd23b1f461d6db15d..b136baf5363c0d7a53f758ad4bdf790af2bbd6b5 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -714,7 +714,7 @@ config("internal_config") {
@@ -715,7 +715,7 @@ config("internal_config") {
":cppgc_header_features",
]
@ -21,7 +21,7 @@ index d75f44b55a89828845f69f148da147ea29d523e2..3140abb0868eb81976edacafc625bc80
defines += [ "BUILDING_V8_SHARED" ]
}
@@ -6463,7 +6463,7 @@ if (current_toolchain == v8_generator_toolchain) {
@@ -6493,7 +6493,7 @@ if (current_toolchain == v8_generator_toolchain) {
"src/interpreter/bytecodes.h",
]
@ -30,7 +30,7 @@ index d75f44b55a89828845f69f148da147ea29d523e2..3140abb0868eb81976edacafc625bc80
deps = [
":v8_libbase",
@@ -6475,7 +6475,6 @@ if (current_toolchain == v8_generator_toolchain) {
@@ -6505,7 +6505,6 @@ if (current_toolchain == v8_generator_toolchain) {
if (current_toolchain == v8_snapshot_toolchain) {
v8_executable("mksnapshot") {

Просмотреть файл

@ -12,10 +12,10 @@ This patch can be safely removed if, when it is removed, `node.lib` does not
contain any standard C++ library exports (e.g. `std::ostringstream`).
diff --git a/BUILD.gn b/BUILD.gn
index 3140abb0868eb81976edacafc625bc80159b5aea..e3c367dd8ccc4a091a940891ceb3409051f5e553 100644
index b136baf5363c0d7a53f758ad4bdf790af2bbd6b5..a6f3f600a87a48d88005cb0910401848b81359a4 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -714,6 +714,10 @@ config("internal_config") {
@@ -715,6 +715,10 @@ config("internal_config") {
":cppgc_header_features",
]

Просмотреть файл

@ -6,10 +6,10 @@ Subject: fix: usage of c++ [[deprecated]] attribute for older msvc versions
This attribute can only be used in all contexts in Visual Studio 2019
diff --git a/include/v8config.h b/include/v8config.h
index bee208ffa95a78be3b643a12850a48f32d169648..07590723fcab48a93e4ab39e91511d5436dc0c94 100644
index 41e7ac3645293fa181fb98ce74a9535aaa4074b4..890567c25e1a07dcd92bbcc21eade1054cf9d0e1 100644
--- a/include/v8config.h
+++ b/include/v8config.h
@@ -536,10 +536,13 @@ path. Add it with -I<path> to the command line
@@ -538,10 +538,13 @@ path. Add it with -I<path> to the command line
# define V8_PRESERVE_MOST /* NOT SUPPORTED */
#endif
@ -25,7 +25,7 @@ index bee208ffa95a78be3b643a12850a48f32d169648..07590723fcab48a93e4ab39e91511d54
#else
# define V8_DEPRECATED(message)
#endif
@@ -547,7 +550,11 @@ path. Add it with -I<path> to the command line
@@ -549,7 +552,11 @@ path. Add it with -I<path> to the command line
// A macro (V8_DEPRECATE_SOON) to make it easier to see what will be deprecated.
#if defined(V8_IMMINENT_DEPRECATION_WARNINGS)
@ -38,7 +38,7 @@ index bee208ffa95a78be3b643a12850a48f32d169648..07590723fcab48a93e4ab39e91511d54
#else
# define V8_DEPRECATE_SOON(message)
#endif
@@ -581,7 +588,7 @@ path. Add it with -I<path> to the command line
@@ -583,7 +590,7 @@ path. Add it with -I<path> to the command line
END_ALLOW_USE_DEPRECATED()

Просмотреть файл

@ -1,44 +1,44 @@
{
"bullseye_amd64": {
"Key": "20230329T085712Z-0",
"Sha1Sum": "39d343162ed5ed1cf5337e49917321e39eb424c7",
"Key": "20230329T085712Z-1",
"Sha1Sum": "dcd5767244034c6f9b42b64a85423d6cb849fa1e",
"SysrootDir": "debian_bullseye_amd64-sysroot",
"Tarball": "debian_bullseye_amd64_sysroot.tar.xz"
},
"bullseye_arm": {
"Key": "20230329T085712Z-0",
"Sha1Sum": "4c378886e1fcab051e99c5e8c4f0b66f2f3fb738",
"SysrootDir": "debian_bullseye_arm-sysroot",
"Tarball": "debian_bullseye_arm_sysroot.tar.xz"
},
"bullseye_arm64": {
"Key": "20230329T085712Z-0",
"Sha1Sum": "2354ab6674a0725d0c4f304b47f908eba6e3b8c7",
"Key": "20230329T085712Z-1",
"Sha1Sum": "3531a8b78fa72e7939f8082a56c9041e5bff423a",
"SysrootDir": "debian_bullseye_arm64-sysroot",
"Tarball": "debian_bullseye_arm64_sysroot.tar.xz"
},
"bullseye_armel": {
"Key": "20230329T085712Z-0",
"Sha1Sum": "933d6944cabe6bf2f9bc667ca52b258b52cd05e9",
"Key": "20230329T085712Z-1",
"Sha1Sum": "cf3a1348649eb26f40e358459c96afbb8e58017e",
"SysrootDir": "debian_bullseye_armel-sysroot",
"Tarball": "debian_bullseye_armel_sysroot.tar.xz"
},
"bullseye_armhf": {
"Key": "20230329T085712Z-1",
"Sha1Sum": "3fe59c416d0472dd4115fa3d42a29aa34191c0bf",
"SysrootDir": "debian_bullseye_armhf-sysroot",
"Tarball": "debian_bullseye_armhf_sysroot.tar.xz"
},
"bullseye_i386": {
"Key": "20230329T085712Z-0",
"Sha1Sum": "86c07fcc29a500e6ff24962c811ba82f806df00c",
"Key": "20230329T085712Z-1",
"Sha1Sum": "9b158682e7c111748e16914977546120429c9287",
"SysrootDir": "debian_bullseye_i386-sysroot",
"Tarball": "debian_bullseye_i386_sysroot.tar.xz"
},
"bullseye_mips": {
"Key": "20230329T085712Z-0",
"Sha1Sum": "1b44b9ddfd3571acc17036866e0373120fd9aa03",
"SysrootDir": "debian_bullseye_mips-sysroot",
"Tarball": "debian_bullseye_mips_sysroot.tar.xz"
},
"bullseye_mips64el": {
"Key": "20230329T085712Z-0",
"Sha1Sum": "cd0803ae938dd75247f474feb299bcaa74fa2290",
"Key": "20230329T085712Z-1",
"Sha1Sum": "c0d04d577608226d9fb0649b455800493fba2cde",
"SysrootDir": "debian_bullseye_mips64el-sysroot",
"Tarball": "debian_bullseye_mips64el_sysroot.tar.xz"
},
"bullseye_mipsel": {
"Key": "20230329T085712Z-1",
"Sha1Sum": "65f095e4edf23f0e789b22290dde9eb455aa54a0",
"SysrootDir": "debian_bullseye_mipsel-sysroot",
"Tarball": "debian_bullseye_mipsel_sysroot.tar.xz"
}
}

Просмотреть файл

@ -6,9 +6,9 @@
#include "shell/app/electron_library_main.h"
#include "base/apple/bundle_locations.h"
#include "base/at_exit.h"
#include "base/i18n/icu_util.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "content/public/app/content_main.h"
#include "electron/fuses.h"
@ -35,7 +35,7 @@ int ElectronInitializeICUandStartNode(int argc, char* argv[]) {
base::AtExitManager atexit_manager;
base::mac::ScopedNSAutoreleasePool pool;
base::mac::SetOverrideFrameworkBundlePath(
base::apple::SetOverrideFrameworkBundlePath(
electron::MainApplicationBundlePath()
.Append("Contents")
.Append("Frameworks")

Просмотреть файл

@ -9,13 +9,13 @@
#include <string>
#include <utility>
#include "base/apple/bundle_locations.h"
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/debug/stack_trace.h"
#include "base/environment.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/path_service.h"
#include "base/strings/string_split.h"
#include "chrome/common/chrome_paths.h"
@ -216,7 +216,7 @@ std::string LoadResourceBundle(const std::string& locale) {
base::FilePath pak_dir;
#if BUILDFLAG(IS_MAC)
pak_dir =
base::mac::FrameworkBundlePath().Append(FILE_PATH_LITERAL("Resources"));
base::apple::FrameworkBundlePath().Append(FILE_PATH_LITERAL("Resources"));
#else
base::PathService::Get(base::DIR_MODULE, &pak_dir);
#endif

Просмотреть файл

@ -6,9 +6,9 @@
#include <string>
#include "base/apple/bundle_locations.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/path_service.h"
@ -54,7 +54,7 @@ base::FilePath GetHelperAppPath(const base::FilePath& frameworks_path,
} // namespace
void ElectronMainDelegate::OverrideFrameworkBundlePath() {
base::mac::SetOverrideFrameworkBundlePath(
base::apple::SetOverrideFrameworkBundlePath(
GetFrameworksPath().Append(ELECTRON_PRODUCT_NAME " Framework.framework"));
}

Просмотреть файл

@ -2617,7 +2617,7 @@ std::string WebContents::GetMediaSourceID(
request_frame_host->GetRoutingID(),
url::Origin::Create(request_frame_host->GetLastCommittedURL()
.DeprecatedGetOriginAsURL()),
media_id, "", content::kRegistryStreamTypeTab);
media_id, content::kRegistryStreamTypeTab);
return id;
}

Просмотреть файл

@ -203,6 +203,13 @@ void Browser::DidFinishLaunching(base::Value::Dict launch_info) {
}
for (BrowserObserver& observer : observers_)
observer.OnFinishLaunching(launch_info.Clone());
#if BUILDFLAG(IS_MAC)
if (dock_icon_) {
DockSetIconImage(*dock_icon_);
dock_icon_.reset();
}
#endif
}
v8::Local<v8::Value> Browser::WhenReady(v8::Isolate* isolate) {

Просмотреть файл

@ -25,7 +25,9 @@
#endif
#if BUILDFLAG(IS_MAC)
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/base/cocoa/secure_password_input.h"
#include "ui/gfx/image/image.h"
#endif
namespace base {
@ -339,6 +341,10 @@ class Browser : public WindowListObserver {
void OnWindowCloseCancelled(NativeWindow* window) override;
void OnWindowAllClosed() override;
#if BUILDFLAG(IS_MAC)
void DockSetIconImage(gfx::Image const& icon);
#endif
// Observers of the browser.
base::ObserverList<BrowserObserver> observers_;
@ -364,6 +370,10 @@ class Browser : public WindowListObserver {
#if BUILDFLAG(IS_MAC)
std::unique_ptr<ui::ScopedPasswordInputEnabler> password_input_enabler_;
base::Time last_dock_show_;
// DockSetIcon() can't set the icon if is_ready_ is false.
// This field caches it until the browser is ready. (#26604)
absl::optional<gfx::Image> dock_icon_;
#endif
base::Value::Dict about_panel_options_;

Просмотреть файл

@ -8,8 +8,8 @@
#include <string>
#include <utility>
#include "base/apple/bundle_locations.h"
#include "base/i18n/rtl.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
#include "base/mac/mac_util.mm"
@ -169,7 +169,7 @@ void Browser::ClearRecentDocuments() {
bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
gin::Arguments* args) {
NSString* identifier = [base::mac::MainBundle() bundleIdentifier];
NSString* identifier = [base::apple::MainBundle() bundleIdentifier];
if (!identifier)
return false;
@ -207,7 +207,7 @@ bool Browser::SetAsDefaultProtocolClient(const std::string& protocol,
if (protocol.empty())
return false;
NSString* identifier = [base::mac::MainBundle() bundleIdentifier];
NSString* identifier = [base::apple::MainBundle() bundleIdentifier];
if (!identifier)
return false;
@ -222,7 +222,7 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol,
if (protocol.empty())
return false;
NSString* identifier = [base::mac::MainBundle() bundleIdentifier];
NSString* identifier = [base::apple::MainBundle() bundleIdentifier];
if (!identifier)
return false;
@ -381,10 +381,10 @@ void Browser::SetLoginItemSettings(LoginItemSettings settings) {
}
#else
if (settings.open_at_login) {
base::mac::AddToLoginItems(base::mac::MainBundlePath(),
base::mac::AddToLoginItems(base::apple::MainBundlePath(),
settings.open_as_hidden);
} else {
base::mac::RemoveFromLoginItems(base::mac::MainBundlePath());
base::mac::RemoveFromLoginItems(base::apple::MainBundlePath());
}
#endif
}
@ -501,12 +501,14 @@ void Browser::DockSetIcon(v8::Isolate* isolate, v8::Local<v8::Value> icon) {
image = native_image->image();
}
// This is needed when this fn is called before the browser
// process is ready, since supported scales are normally set
// by ui::ResourceBundle::InitSharedInstance
// during browser process startup.
if (!is_ready())
gfx::ImageSkia::SetSupportedScales({1.0f});
DockSetIconImage(image);
}
void Browser::DockSetIconImage(gfx::Image const& image) {
if (!is_ready_) {
dock_icon_ = image;
return;
}
[[AtomApplication sharedApplication]
setApplicationIconImage:image.AsNSImage()];

Просмотреть файл

@ -191,6 +191,11 @@ network::NetworkQualityTracker* BrowserProcessImpl::network_quality_tracker() {
return nullptr;
}
embedder_support::OriginTrialsSettingsStorage*
BrowserProcessImpl::GetOriginTrialsSettingsStorage() {
return &origin_trials_settings_storage_;
}
policy::ChromeBrowserPolicyConnector*
BrowserProcessImpl::browser_policy_connector() {
return nullptr;

Просмотреть файл

@ -15,6 +15,7 @@
#include "base/command_line.h"
#include "chrome/browser/browser_process.h"
#include "components/embedder_support/origin_trials/origin_trials_settings_storage.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/value_map_pref_store.h"
#include "printing/buildflags/buildflags.h"
@ -68,6 +69,8 @@ class BrowserProcessImpl : public BrowserProcess {
NotificationPlatformBridge* notification_platform_bridge() override;
SystemNetworkContextManager* system_network_context_manager() override;
network::NetworkQualityTracker* network_quality_tracker() override;
embedder_support::OriginTrialsSettingsStorage*
GetOriginTrialsSettingsStorage() override;
policy::ChromeBrowserPolicyConnector* browser_policy_connector() override;
policy::PolicyService* policy_service() override;
IconManager* icon_manager() override;
@ -117,6 +120,7 @@ class BrowserProcessImpl : public BrowserProcess {
std::unique_ptr<device::GeolocationManager> geolocation_manager_;
std::string locale_;
std::string system_locale_;
embedder_support::OriginTrialsSettingsStorage origin_trials_settings_storage_;
};
#endif // ELECTRON_SHELL_BROWSER_BROWSER_PROCESS_IMPL_H_

Просмотреть файл

@ -724,8 +724,7 @@ void ElectronBrowserClient::SiteInstanceGotProcess(
return;
extensions::ProcessMap::Get(browser_context)
->Insert(extension->id(), site_instance->GetProcess()->GetID(),
site_instance->GetId());
->Insert(extension->id(), site_instance->GetProcess()->GetID());
}
#endif // BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
}
@ -777,32 +776,6 @@ base::FilePath ElectronBrowserClient::GetLoggingFileName(
return logging::GetLogFileName(cmd_line);
}
void ElectronBrowserClient::SiteInstanceDeleting(
content::SiteInstance* site_instance) {
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
// Don't do anything if we're shutting down.
if (content::BrowserMainRunner::ExitedMainMessageLoop())
return;
auto* browser_context =
static_cast<ElectronBrowserContext*>(site_instance->GetBrowserContext());
if (!browser_context->IsOffTheRecord()) {
// If this isn't an extension renderer there's nothing to do.
extensions::ExtensionRegistry* registry =
extensions::ExtensionRegistry::Get(browser_context);
const extensions::Extension* extension =
registry->enabled_extensions().GetExtensionOrAppByURL(
site_instance->GetSiteURL());
if (!extension)
return;
extensions::ProcessMap::Get(browser_context)
->Remove(extension->id(), site_instance->GetProcess()->GetID(),
site_instance->GetId());
}
#endif
}
std::unique_ptr<net::ClientCertStore>
ElectronBrowserClient::CreateClientCertStore(
content::BrowserContext* browser_context) {

Просмотреть файл

@ -169,7 +169,6 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
std::vector<std::string>* additional_schemes) override;
void GetAdditionalWebUISchemes(
std::vector<std::string>* additional_schemes) override;
void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
content::BrowserContext* browser_context) override;
std::unique_ptr<device::LocationProvider> OverrideSystemLocationProvider()

Просмотреть файл

@ -23,6 +23,7 @@
#include "chrome/browser/ui/color/chrome_color_mixers.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "components/embedder_support/origin_trials/origin_trials_settings_storage.h"
#include "components/os_crypt/sync/key_storage_config_linux.h"
#include "components/os_crypt/sync/os_crypt.h"
#include "content/browser/browser_main_loop.h" // nogncheck
@ -190,6 +191,18 @@ void UpdateDarkThemeSetting() {
}
#endif
// A fake BrowserProcess object that used to feed the source code from chrome.
class FakeBrowserProcessImpl : public BrowserProcessImpl {
public:
embedder_support::OriginTrialsSettingsStorage*
GetOriginTrialsSettingsStorage() override {
return &origin_trials_settings_storage_;
}
private:
embedder_support::OriginTrialsSettingsStorage origin_trials_settings_storage_;
};
} // namespace
#if BUILDFLAG(IS_LINUX)

Просмотреть файл

@ -6,7 +6,7 @@
#include <string>
#include "base/mac/bundle_locations.h"
#include "base/apple/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "base/path_service.h"
#include "services/device/public/cpp/geolocation/system_geolocation_source_mac.h"
@ -49,7 +49,7 @@ void ElectronBrowserMainParts::RegisterURLHandler() {
// Replicates NSApplicationMain, but doesn't start a run loop.
void ElectronBrowserMainParts::InitializeMainNib() {
auto infoDictionary = base::mac::OuterBundle().infoDictionary;
auto infoDictionary = base::apple::OuterBundle().infoDictionary;
auto principalClass =
NSClassFromString([infoDictionary objectForKey:@"NSPrincipalClass"]);
@ -61,19 +61,19 @@ void ElectronBrowserMainParts::InitializeMainNib() {
@try {
mainNib = [[NSNib alloc] initWithNibNamed:mainNibName
bundle:base::mac::FrameworkBundle()];
bundle:base::apple::FrameworkBundle()];
// Handle failure of initWithNibNamed on SMB shares
// TODO(codebytere): Remove when
// https://bugs.chromium.org/p/chromium/issues/detail?id=932935 is fixed
} @catch (NSException* exception) {
NSString* nibPath =
[NSString stringWithFormat:@"Resources/%@.nib", mainNibName];
nibPath = [base::mac::FrameworkBundle().bundlePath
nibPath = [base::apple::FrameworkBundle().bundlePath
stringByAppendingPathComponent:nibPath];
NSData* data = [NSData dataWithContentsOfFile:nibPath];
mainNib = [[NSNib alloc] initWithNibData:data
bundle:base::mac::FrameworkBundle()];
bundle:base::apple::FrameworkBundle()];
}
[mainNib instantiateWithOwner:application topLevelObjects:nil];

Просмотреть файл

@ -13,7 +13,6 @@
#include <utility>
#include <vector>
#include "base/cxx17_backports.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
@ -1074,7 +1073,7 @@ void NativeWindowMac::InvalidateShadow() {
}
void NativeWindowMac::SetOpacity(const double opacity) {
const double boundedOpacity = base::clamp(opacity, 0.0, 1.0);
const double boundedOpacity = std::clamp(opacity, 0.0, 1.0);
[window_ setAlphaValue:boundedOpacity];
}

Просмотреть файл

@ -13,7 +13,6 @@
#include <utility>
#include <vector>
#include "base/cxx17_backports.h"
#include "base/memory/raw_ptr.h"
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
@ -1132,7 +1131,7 @@ bool NativeWindowViews::HasShadow() {
void NativeWindowViews::SetOpacity(const double opacity) {
#if BUILDFLAG(IS_WIN)
const double boundedOpacity = base::clamp(opacity, 0.0, 1.0);
const double boundedOpacity = std::clamp(opacity, 0.0, 1.0);
HWND hwnd = GetAcceleratedWidget();
if (!layered_) {
LONG ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);

Просмотреть файл

@ -6,7 +6,6 @@
#include <memory>
#include <vector>
#include "base/cxx17_backports.h"
#include "base/feature_list.h"
#include "base/i18n/rtl.h"
#include "components/autofill/core/common/autofill_features.h"
@ -44,8 +43,8 @@ void CalculatePopupXAndWidthHorizontallyCentered(
// The preferred horizontal starting point for the pop-up is at the horizontal
// center of the field.
int preferred_starting_point =
base::clamp(element_bounds.x() + (element_bounds.size().width() / 2),
content_area_bounds.x(), content_area_bounds.right());
std::clamp(element_bounds.x() + (element_bounds.size().width() / 2),
content_area_bounds.x(), content_area_bounds.right());
// The space available to the left and to the right.
int space_to_right = content_area_bounds.right() - preferred_starting_point;
@ -85,11 +84,11 @@ void CalculatePopupXAndWidth(int popup_preferred_width,
const gfx::Rect& element_bounds,
bool is_rtl,
gfx::Rect* popup_bounds) {
int right_growth_start = base::clamp(
int right_growth_start = std::clamp(
element_bounds.x(), content_area_bounds.x(), content_area_bounds.right());
int left_growth_end =
base::clamp(element_bounds.right(), content_area_bounds.x(),
content_area_bounds.right());
std::clamp(element_bounds.right(), content_area_bounds.x(),
content_area_bounds.right());
int right_available = content_area_bounds.right() - right_growth_start;
int left_available = left_growth_end - content_area_bounds.x();
@ -118,11 +117,11 @@ void CalculatePopupYAndHeight(int popup_preferred_height,
const gfx::Rect& content_area_bounds,
const gfx::Rect& element_bounds,
gfx::Rect* popup_bounds) {
int top_growth_end = base::clamp(element_bounds.y(), content_area_bounds.y(),
content_area_bounds.bottom());
int top_growth_end = std::clamp(element_bounds.y(), content_area_bounds.y(),
content_area_bounds.bottom());
int bottom_growth_start =
base::clamp(element_bounds.bottom(), content_area_bounds.y(),
content_area_bounds.bottom());
std::clamp(element_bounds.bottom(), content_area_bounds.y(),
content_area_bounds.bottom());
int top_available = top_growth_end - content_area_bounds.y();
int bottom_available = content_area_bounds.bottom() - bottom_growth_start;

Просмотреть файл

@ -28,17 +28,6 @@ class ElectronBundleMover {
static bool ShouldContinueMove(gin_helper::ErrorThrower thrower,
BundlerMoverConflictType type,
gin::Arguments* args);
static bool IsInApplicationsFolder(NSString* bundlePath);
static NSString* ContainingDiskImageDevice(NSString* bundlePath);
static void Relaunch(NSString* destinationPath);
static NSString* ShellQuotedString(NSString* string);
static bool CopyBundle(NSString* srcPath, NSString* dstPath);
static bool AuthorizedInstall(NSString* srcPath,
NSString* dstPath,
bool* canceled);
static bool IsApplicationAtPathRunning(NSString* bundlePath);
static bool DeleteOrTrash(NSString* path);
static bool Trash(NSString* path);
};
} // namespace electron

Просмотреть файл

@ -36,6 +36,293 @@ struct Converter<electron::BundlerMoverConflictType> {
} // namespace gin
namespace {
NSString* ContainingDiskImageDevice(NSString* bundlePath) {
NSString* containingPath = [bundlePath stringByDeletingLastPathComponent];
struct statfs fs;
if (statfs([containingPath fileSystemRepresentation], &fs) ||
(fs.f_flags & MNT_ROOTFS))
return nil;
NSString* device = [[NSFileManager defaultManager]
stringWithFileSystemRepresentation:fs.f_mntfromname
length:strlen(fs.f_mntfromname)];
NSTask* hdiutil = [[[NSTask alloc] init] autorelease];
[hdiutil setLaunchPath:@"/usr/bin/hdiutil"];
[hdiutil setArguments:[NSArray arrayWithObjects:@"info", @"-plist", nil]];
[hdiutil setStandardOutput:[NSPipe pipe]];
[hdiutil launch];
[hdiutil waitUntilExit];
NSData* data =
[[[hdiutil standardOutput] fileHandleForReading] readDataToEndOfFile];
NSDictionary* info =
[NSPropertyListSerialization propertyListWithData:data
options:NSPropertyListImmutable
format:NULL
error:NULL];
if (![info isKindOfClass:[NSDictionary class]])
return nil;
NSArray* images = (NSArray*)[info objectForKey:@"images"];
if (![images isKindOfClass:[NSArray class]])
return nil;
for (NSDictionary* image in images) {
if (![image isKindOfClass:[NSDictionary class]])
return nil;
id systemEntities = [image objectForKey:@"system-entities"];
if (![systemEntities isKindOfClass:[NSArray class]])
return nil;
for (NSDictionary* systemEntity in systemEntities) {
if (![systemEntity isKindOfClass:[NSDictionary class]])
return nil;
NSString* devEntry = [systemEntity objectForKey:@"dev-entry"];
if (![devEntry isKindOfClass:[NSString class]])
return nil;
if ([devEntry isEqualToString:device])
return device;
}
}
return nil;
}
NSString* ResolvePath(NSString* path) {
NSString* standardizedPath = [path stringByStandardizingPath];
char resolved[PATH_MAX];
if (realpath([standardizedPath UTF8String], resolved) == NULL)
return path;
return @(resolved);
}
bool IsInApplicationsFolder(NSString* bundlePath) {
// Check all the normal Application directories
NSArray* applicationDirs = NSSearchPathForDirectoriesInDomains(
NSApplicationDirectory, NSAllDomainsMask, true);
NSString* resolvedBundlePath = ResolvePath(bundlePath);
for (NSString* appDir in applicationDirs) {
if ([resolvedBundlePath hasPrefix:appDir])
return true;
}
// Also, handle the case that the user has some other Application directory
// (perhaps on a separate data partition).
if ([[resolvedBundlePath pathComponents] containsObject:@"Applications"])
return true;
return false;
}
bool AuthorizedInstall(NSString* srcPath, NSString* dstPath, bool* canceled) {
if (canceled)
*canceled = false;
// Make sure that the destination path is an app bundle. We're essentially
// running 'sudo rm -rf' so we really don't want to screw this up.
if (![[dstPath pathExtension] isEqualToString:@"app"])
return false;
// Do some more checks
if ([[dstPath stringByTrimmingCharactersInSet:[NSCharacterSet
whitespaceCharacterSet]]
length] == 0)
return false;
if ([[srcPath stringByTrimmingCharactersInSet:[NSCharacterSet
whitespaceCharacterSet]]
length] == 0)
return false;
int pid, status;
AuthorizationRef myAuthorizationRef;
// Get the authorization
OSStatus err =
AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
kAuthorizationFlagDefaults, &myAuthorizationRef);
if (err != errAuthorizationSuccess)
return false;
AuthorizationItem myItems = {kAuthorizationRightExecute, 0, NULL, 0};
AuthorizationRights myRights = {1, &myItems};
AuthorizationFlags myFlags =
(AuthorizationFlags)(kAuthorizationFlagInteractionAllowed |
kAuthorizationFlagExtendRights |
kAuthorizationFlagPreAuthorize);
err = AuthorizationCopyRights(myAuthorizationRef, &myRights, NULL, myFlags,
NULL);
if (err != errAuthorizationSuccess) {
if (err == errAuthorizationCanceled && canceled)
*canceled = true;
goto fail;
}
static OSStatus (*security_AuthorizationExecuteWithPrivileges)(
AuthorizationRef authorization, const char* pathToTool,
AuthorizationFlags options, char* const* arguments,
FILE** communicationsPipe) = NULL;
if (!security_AuthorizationExecuteWithPrivileges) {
// On 10.7, AuthorizationExecuteWithPrivileges is deprecated. We want to
// still use it since there's no good alternative (without requiring code
// signing). We'll look up the function through dyld and fail if it is no
// longer accessible. If Apple removes the function entirely this will fail
// gracefully. If they keep the function and throw some sort of exception,
// this won't fail gracefully, but that's a risk we'll have to take for now.
security_AuthorizationExecuteWithPrivileges = (OSStatus(*)(
AuthorizationRef, const char*, AuthorizationFlags, char* const*,
FILE**))dlsym(RTLD_DEFAULT, "AuthorizationExecuteWithPrivileges");
}
if (!security_AuthorizationExecuteWithPrivileges)
goto fail;
// Delete the destination
{
char rf[] = "-rf";
char* args[] = {rf, (char*)[dstPath fileSystemRepresentation], NULL};
err = security_AuthorizationExecuteWithPrivileges(
myAuthorizationRef, "/bin/rm", kAuthorizationFlagDefaults, args, NULL);
if (err != errAuthorizationSuccess)
goto fail;
// Wait until it's done
pid = wait(&status);
if (pid == -1 || !WIFEXITED(status))
goto fail; // We don't care about exit status as the destination most
// likely does not exist
}
// Copy
{
char pR[] = "-pR";
char* args[] = {pR, (char*)[srcPath fileSystemRepresentation],
(char*)[dstPath fileSystemRepresentation], NULL};
err = security_AuthorizationExecuteWithPrivileges(
myAuthorizationRef, "/bin/cp", kAuthorizationFlagDefaults, args, NULL);
if (err != errAuthorizationSuccess)
goto fail;
// Wait until it's done
pid = wait(&status);
if (pid == -1 || !WIFEXITED(status) || WEXITSTATUS(status))
goto fail;
}
AuthorizationFree(myAuthorizationRef, kAuthorizationFlagDefaults);
return true;
fail:
AuthorizationFree(myAuthorizationRef, kAuthorizationFlagDefaults);
return false;
}
bool CopyBundle(NSString* srcPath, NSString* dstPath) {
NSFileManager* fileManager = [NSFileManager defaultManager];
NSError* error = nil;
return [fileManager copyItemAtPath:srcPath toPath:dstPath error:&error];
}
NSString* ShellQuotedString(NSString* string) {
return [NSString
stringWithFormat:@"'%@'",
[string stringByReplacingOccurrencesOfString:@"'"
withString:@"'\\''"]];
}
void Relaunch(NSString* destinationPath) {
// The shell script waits until the original app process terminates.
// This is done so that the relaunched app opens as the front-most app.
int pid = [[NSProcessInfo processInfo] processIdentifier];
// Command run just before running open /final/path
NSString* preOpenCmd = @"";
NSString* quotedDestinationPath = ShellQuotedString(destinationPath);
// Before we launch the new app, clear xattr:com.apple.quarantine to avoid
// duplicate "scary file from the internet" dialog.
preOpenCmd = [NSString
stringWithFormat:@"/usr/bin/xattr -d -r com.apple.quarantine %@",
quotedDestinationPath];
NSString* script =
[NSString stringWithFormat:
@"(while /bin/kill -0 %d >&/dev/null; do /bin/sleep 0.1; "
@"done; %@; /usr/bin/open %@) &",
pid, preOpenCmd, quotedDestinationPath];
[NSTask
launchedTaskWithLaunchPath:@"/bin/sh"
arguments:[NSArray arrayWithObjects:@"-c", script, nil]];
}
bool Trash(NSString* path) {
bool result = false;
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_8) {
result = [[NSFileManager defaultManager]
trashItemAtURL:[NSURL fileURLWithPath:path]
resultingItemURL:NULL
error:NULL];
}
// As a last resort try trashing with AppleScript.
// This allows us to trash the app in macOS Sierra even when the app is
// running inside an app translocation image.
if (!result) {
auto* code = R"str(
set theFile to POSIX file "%@"
tell application "Finder"
move theFile to trash
end tell
)str";
NSAppleScript* appleScript = [[[NSAppleScript alloc]
initWithSource:[NSString stringWithFormat:@(code), path]] autorelease];
NSDictionary* errorDict = nil;
NSAppleEventDescriptor* scriptResult =
[appleScript executeAndReturnError:&errorDict];
result = (scriptResult != nil);
}
return result;
}
bool DeleteOrTrash(NSString* path) {
NSError* error;
if ([[NSFileManager defaultManager] removeItemAtPath:path error:&error]) {
return true;
} else {
return Trash(path);
}
}
bool IsApplicationAtPathRunning(NSString* bundlePath) {
bundlePath = [bundlePath stringByStandardizingPath];
for (NSRunningApplication* runningApplication in
[[NSWorkspace sharedWorkspace] runningApplications]) {
NSString* runningAppBundlePath =
[[[runningApplication bundleURL] path] stringByStandardizingPath];
if ([runningAppBundlePath isEqualToString:bundlePath]) {
return true;
}
}
return false;
}
} // namespace
namespace electron {
bool ElectronBundleMover::ShouldContinueMove(gin_helper::ErrorThrower thrower,
@ -182,289 +469,4 @@ bool ElectronBundleMover::IsCurrentAppInApplicationsFolder() {
return IsInApplicationsFolder([[NSBundle mainBundle] bundlePath]);
}
NSString* resolvePath(NSString* path) {
NSString* standardizedPath = [path stringByStandardizingPath];
char resolved[PATH_MAX];
if (realpath([standardizedPath UTF8String], resolved) == NULL)
return path;
return @(resolved);
}
bool ElectronBundleMover::IsInApplicationsFolder(NSString* bundlePath) {
// Check all the normal Application directories
NSArray* applicationDirs = NSSearchPathForDirectoriesInDomains(
NSApplicationDirectory, NSAllDomainsMask, true);
NSString* resolvedBundlePath = resolvePath(bundlePath);
for (NSString* appDir in applicationDirs) {
if ([resolvedBundlePath hasPrefix:appDir])
return true;
}
// Also, handle the case that the user has some other Application directory
// (perhaps on a separate data partition).
if ([[resolvedBundlePath pathComponents] containsObject:@"Applications"])
return true;
return false;
}
NSString* ElectronBundleMover::ContainingDiskImageDevice(NSString* bundlePath) {
NSString* containingPath = [bundlePath stringByDeletingLastPathComponent];
struct statfs fs;
if (statfs([containingPath fileSystemRepresentation], &fs) ||
(fs.f_flags & MNT_ROOTFS))
return nil;
NSString* device = [[NSFileManager defaultManager]
stringWithFileSystemRepresentation:fs.f_mntfromname
length:strlen(fs.f_mntfromname)];
NSTask* hdiutil = [[[NSTask alloc] init] autorelease];
[hdiutil setLaunchPath:@"/usr/bin/hdiutil"];
[hdiutil setArguments:[NSArray arrayWithObjects:@"info", @"-plist", nil]];
[hdiutil setStandardOutput:[NSPipe pipe]];
[hdiutil launch];
[hdiutil waitUntilExit];
NSData* data =
[[[hdiutil standardOutput] fileHandleForReading] readDataToEndOfFile];
NSDictionary* info =
[NSPropertyListSerialization propertyListWithData:data
options:NSPropertyListImmutable
format:NULL
error:NULL];
if (![info isKindOfClass:[NSDictionary class]])
return nil;
NSArray* images = (NSArray*)[info objectForKey:@"images"];
if (![images isKindOfClass:[NSArray class]])
return nil;
for (NSDictionary* image in images) {
if (![image isKindOfClass:[NSDictionary class]])
return nil;
id systemEntities = [image objectForKey:@"system-entities"];
if (![systemEntities isKindOfClass:[NSArray class]])
return nil;
for (NSDictionary* systemEntity in systemEntities) {
if (![systemEntity isKindOfClass:[NSDictionary class]])
return nil;
NSString* devEntry = [systemEntity objectForKey:@"dev-entry"];
if (![devEntry isKindOfClass:[NSString class]])
return nil;
if ([devEntry isEqualToString:device])
return device;
}
}
return nil;
}
bool ElectronBundleMover::AuthorizedInstall(NSString* srcPath,
NSString* dstPath,
bool* canceled) {
if (canceled)
*canceled = false;
// Make sure that the destination path is an app bundle. We're essentially
// running 'sudo rm -rf' so we really don't want to screw this up.
if (![[dstPath pathExtension] isEqualToString:@"app"])
return false;
// Do some more checks
if ([[dstPath stringByTrimmingCharactersInSet:[NSCharacterSet
whitespaceCharacterSet]]
length] == 0)
return false;
if ([[srcPath stringByTrimmingCharactersInSet:[NSCharacterSet
whitespaceCharacterSet]]
length] == 0)
return false;
int pid, status;
AuthorizationRef myAuthorizationRef;
// Get the authorization
OSStatus err =
AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
kAuthorizationFlagDefaults, &myAuthorizationRef);
if (err != errAuthorizationSuccess)
return false;
AuthorizationItem myItems = {kAuthorizationRightExecute, 0, NULL, 0};
AuthorizationRights myRights = {1, &myItems};
AuthorizationFlags myFlags =
(AuthorizationFlags)(kAuthorizationFlagInteractionAllowed |
kAuthorizationFlagExtendRights |
kAuthorizationFlagPreAuthorize);
err = AuthorizationCopyRights(myAuthorizationRef, &myRights, NULL, myFlags,
NULL);
if (err != errAuthorizationSuccess) {
if (err == errAuthorizationCanceled && canceled)
*canceled = true;
goto fail;
}
static OSStatus (*security_AuthorizationExecuteWithPrivileges)(
AuthorizationRef authorization, const char* pathToTool,
AuthorizationFlags options, char* const* arguments,
FILE** communicationsPipe) = NULL;
if (!security_AuthorizationExecuteWithPrivileges) {
// On 10.7, AuthorizationExecuteWithPrivileges is deprecated. We want to
// still use it since there's no good alternative (without requiring code
// signing). We'll look up the function through dyld and fail if it is no
// longer accessible. If Apple removes the function entirely this will fail
// gracefully. If they keep the function and throw some sort of exception,
// this won't fail gracefully, but that's a risk we'll have to take for now.
security_AuthorizationExecuteWithPrivileges = (OSStatus(*)(
AuthorizationRef, const char*, AuthorizationFlags, char* const*,
FILE**))dlsym(RTLD_DEFAULT, "AuthorizationExecuteWithPrivileges");
}
if (!security_AuthorizationExecuteWithPrivileges)
goto fail;
// Delete the destination
{
char rf[] = "-rf";
char* args[] = {rf, (char*)[dstPath fileSystemRepresentation], NULL};
err = security_AuthorizationExecuteWithPrivileges(
myAuthorizationRef, "/bin/rm", kAuthorizationFlagDefaults, args, NULL);
if (err != errAuthorizationSuccess)
goto fail;
// Wait until it's done
pid = wait(&status);
if (pid == -1 || !WIFEXITED(status))
goto fail; // We don't care about exit status as the destination most
// likely does not exist
}
// Copy
{
char pR[] = "-pR";
char* args[] = {pR, (char*)[srcPath fileSystemRepresentation],
(char*)[dstPath fileSystemRepresentation], NULL};
err = security_AuthorizationExecuteWithPrivileges(
myAuthorizationRef, "/bin/cp", kAuthorizationFlagDefaults, args, NULL);
if (err != errAuthorizationSuccess)
goto fail;
// Wait until it's done
pid = wait(&status);
if (pid == -1 || !WIFEXITED(status) || WEXITSTATUS(status))
goto fail;
}
AuthorizationFree(myAuthorizationRef, kAuthorizationFlagDefaults);
return true;
fail:
AuthorizationFree(myAuthorizationRef, kAuthorizationFlagDefaults);
return false;
}
bool ElectronBundleMover::CopyBundle(NSString* srcPath, NSString* dstPath) {
NSFileManager* fileManager = [NSFileManager defaultManager];
NSError* error = nil;
return [fileManager copyItemAtPath:srcPath toPath:dstPath error:&error];
}
NSString* ElectronBundleMover::ShellQuotedString(NSString* string) {
return [NSString
stringWithFormat:@"'%@'",
[string stringByReplacingOccurrencesOfString:@"'"
withString:@"'\\''"]];
}
void ElectronBundleMover::Relaunch(NSString* destinationPath) {
// The shell script waits until the original app process terminates.
// This is done so that the relaunched app opens as the front-most app.
int pid = [[NSProcessInfo processInfo] processIdentifier];
// Command run just before running open /final/path
NSString* preOpenCmd = @"";
NSString* quotedDestinationPath = ShellQuotedString(destinationPath);
// Before we launch the new app, clear xattr:com.apple.quarantine to avoid
// duplicate "scary file from the internet" dialog.
preOpenCmd = [NSString
stringWithFormat:@"/usr/bin/xattr -d -r com.apple.quarantine %@",
quotedDestinationPath];
NSString* script =
[NSString stringWithFormat:
@"(while /bin/kill -0 %d >&/dev/null; do /bin/sleep 0.1; "
@"done; %@; /usr/bin/open %@) &",
pid, preOpenCmd, quotedDestinationPath];
[NSTask
launchedTaskWithLaunchPath:@"/bin/sh"
arguments:[NSArray arrayWithObjects:@"-c", script, nil]];
}
bool ElectronBundleMover::IsApplicationAtPathRunning(NSString* bundlePath) {
bundlePath = [bundlePath stringByStandardizingPath];
for (NSRunningApplication* runningApplication in
[[NSWorkspace sharedWorkspace] runningApplications]) {
NSString* runningAppBundlePath =
[[[runningApplication bundleURL] path] stringByStandardizingPath];
if ([runningAppBundlePath isEqualToString:bundlePath]) {
return true;
}
}
return false;
}
bool ElectronBundleMover::Trash(NSString* path) {
bool result = false;
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_8) {
result = [[NSFileManager defaultManager]
trashItemAtURL:[NSURL fileURLWithPath:path]
resultingItemURL:NULL
error:NULL];
}
// As a last resort try trashing with AppleScript.
// This allows us to trash the app in macOS Sierra even when the app is
// running inside an app translocation image.
if (!result) {
auto* code = R"str(
set theFile to POSIX file "%@"
tell application "Finder"
move theFile to trash
end tell
)str";
NSAppleScript* appleScript = [[[NSAppleScript alloc]
initWithSource:[NSString stringWithFormat:@(code), path]] autorelease];
NSDictionary* errorDict = nil;
NSAppleEventDescriptor* scriptResult =
[appleScript executeAndReturnError:&errorDict];
result = (scriptResult != nil);
}
return result;
}
bool ElectronBundleMover::DeleteOrTrash(NSString* path) {
NSError* error;
if ([[NSFileManager defaultManager] removeItemAtPath:path error:&error]) {
return true;
} else {
return Trash(path);
}
}
} // namespace electron

Просмотреть файл

@ -97,13 +97,12 @@ const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4;
// Stores all instances of InspectableWebContents.
InspectableWebContents::List g_web_contents_instances_;
base::Value RectToDictionary(const gfx::Rect& bounds) {
base::Value::Dict dict;
dict.Set("x", bounds.x());
dict.Set("y", bounds.y());
dict.Set("width", bounds.width());
dict.Set("height", bounds.height());
return base::Value(std::move(dict));
base::Value::Dict RectToDictionary(const gfx::Rect& bounds) {
return base::Value::Dict{}
.Set("x", bounds.x())
.Set("y", bounds.y())
.Set("width", bounds.width())
.Set("height", bounds.height());
}
gfx::Rect DictionaryToRect(const base::Value::Dict& dict) {
@ -338,7 +337,7 @@ const InspectableWebContents::List& InspectableWebContents::GetAll() {
// static
void InspectableWebContents::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterDictionaryPref(kDevToolsBoundsPref,
RectToDictionary(gfx::Rect(0, 0, 800, 600)));
RectToDictionary(gfx::Rect{0, 0, 800, 600}));
registry->RegisterDoublePref(kDevToolsZoomPref, 0.);
registry->RegisterDictionaryPref(kDevToolsPreferences);
}
@ -544,7 +543,8 @@ gfx::Rect InspectableWebContents::GetDevToolsBounds() const {
}
void InspectableWebContents::SaveDevToolsBounds(const gfx::Rect& bounds) {
pref_service_->Set(kDevToolsBoundsPref, RectToDictionary(bounds));
pref_service_->Set(kDevToolsBoundsPref,
base::Value{RectToDictionary(bounds)});
devtools_bounds_ = bounds;
}

Просмотреть файл

@ -6,7 +6,6 @@
#include <propkey.h> // for PKEY_* constants
#include "base/cxx17_backports.h"
#include "base/logging.h"
#include "base/win/scoped_co_mem.h"
#include "base/win/scoped_propvariant.h"

Просмотреть файл

@ -124,4 +124,9 @@ WebViewGuestDelegate::CreateNewGuestWindow(
return guest_contents;
}
base::WeakPtr<content::BrowserPluginGuestDelegate>
WebViewGuestDelegate::GetGuestDelegateWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
} // namespace electron

Просмотреть файл

@ -38,6 +38,8 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
content::WebContents* GetOwnerWebContents() final;
std::unique_ptr<content::WebContents> CreateNewGuestWindow(
const content::WebContents::CreateParams& create_params) final;
base::WeakPtr<content::BrowserPluginGuestDelegate> GetGuestDelegateWeakPtr()
final;
// WebContentsZoomController::Observer:
void OnZoomLevelChanged(content::WebContents* web_contents,
@ -56,6 +58,8 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
raw_ptr<WebContentsZoomController> embedder_zoom_controller_ = nullptr;
raw_ptr<api::WebContents> api_web_contents_ = nullptr;
base::WeakPtrFactory<WebViewGuestDelegate> weak_ptr_factory_{this};
};
} // namespace electron

Просмотреть файл

@ -11,9 +11,9 @@
#include <iomanip>
#include <string>
#include "base/apple/bundle_locations.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/sys_string_conversions.h"
@ -23,7 +23,7 @@ namespace asar {
absl::optional<base::FilePath> Archive::RelativePath() const {
base::FilePath bundle_path = base::MakeAbsoluteFilePath(
base::mac::MainBundlePath().Append("Contents"));
base::apple::MainBundlePath().Append("Contents"));
base::FilePath relative_path;
if (!bundle_path.AppendRelativePath(path_, &relative_path))

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше