8acf6039e7
* chore: bump chromium in DEPS to 110.0.5425.0 * chore: bump chromium in DEPS to 110.0.5427.0 * chore: bump chromium in DEPS to 110.0.5429.0 * chore: bump chromium in DEPS to 110.0.5431.0 * chore: update patches/chromium/picture-in-picture.patch to fix upstream code shear https://chromium-review.googlesource.com/c/chromium/src/+/4024078 * chore: sync patch w/upstream shear: remove_usage_of_incognito_apis_in_the_spellchecker.patch https://chromium-review.googlesource.com/c/chromium/src/+/3967854 * chore: sync patch w/upstream shear: feat_expose_raw_response_headers_from_urlloader.patch https://chromium-review.googlesource.com/c/chromium/src/+/3983373 * chore: sync patch w/upstream shear: chromium/custom_protocols_plzserviceworker.patch https://chromium-review.googlesource.com/c/chromium/src/+/3983373 * build: update references to core_api_provider; its location was moved upstream Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4006696 * build: remove back_to_tab_image_button from our enable_picture_in_picture deps Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4024078 back_to_tab_image_button has been removed upstream * chore: update patches * chore: bump chromium in DEPS to 110.0.5433.0 * chore: sync patch w/upstream shear: chromium/printing.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4006638 * chore: sync patch w/trivial upstream shear: chromium/process_singleton.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4031817 * refactor: remove kAutofillCenterAlignedSuggestions feature flag check. This behavior had been an experiment behind a feature flag. The experiment was a success so the feature was kept & the flag was removed. Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3870616 moves from disabled-by-default to enabled-by-default Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4030556 removed the feature flag * chore: update patches * chore: bump chromium in DEPS to 110.0.5435.0 * chore: update patches * chore: sync code with upstream change: AXLMode method name Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3950054 * 3841761: Adapting code to support kSystemProfileSelectionDefaultNone experiment https://chromium-review.googlesource.com/c/chromium/src/+/3841761 * chore: bump chromium in DEPS to 110.0.5437.0 * 4040140: Pip 2.0: Merge VideoOverlayWindowViews and OverlayWindowViews https://chromium-review.googlesource.com/c/chromium/src/+/4040140 * 4045567: Fix a crash opening a popup from tab capture fullscreen https://chromium-review.googlesource.com/c/chromium/src/+/4045567 * chore: fixup patch indices * 4048263: Remove deprecated Value calls in frame_tracker_unittest.cc. https://chromium-review.googlesource.com/c/chromium/src/+/4048263 * 4004606: [intl] Migrate to ICU 72 https://chromium-review.googlesource.com/c/v8/v8/+/4004606 * chore: bump chromium in DEPS to 110.0.5439.0 * 3890670: Prerender: Add first implementation of prerender-in-new-tab mode https://chromium-review.googlesource.com/c/chromium/src/+/3890670 * chore: fixup patch indices * chore: bump chromium in DEPS to 110.0.5441.0 * chore: update patches * chore: bump chromium in DEPS to 110.0.5443.0 * 4035451: Remove remaining uses of ScopedNestableTaskAllower. https://chromium-review.googlesource.com/c/chromium/src/+/4035451 * chore: bump chromium in DEPS to 110.0.5445.0 * chore: update patches * fixup! 3890670: Prerender: Add first implementation of prerender-in-new-tab mode * test: disable parallel/test-worker-init-failure Refs https://chromium-review.googlesource.com/c/v8/v8/+/4017512 Refs https://github.com/nodejs/node-v8/issues/246 * chore: disable parallel/test-fetch Test is flaky on Linux CI, but runs fine locally. * chore: bump chromium in DEPS to 110.0.5451.0 * chore: update patches * chore: cleanup patch Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: electron-patch-conflict-fixer[bot] <83340002+electron-patch-conflict-fixer[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
334 lines
11 KiB
Diff
334 lines
11 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
Date: Tue, 9 Oct 2018 10:36:20 -0700
|
|
Subject: mas: avoid some private APIs
|
|
|
|
Guard usages in blink of private Mac APIs by MAS_BUILD, so they can be
|
|
excluded for people who want to submit their apps to the Mac App store.
|
|
|
|
diff --git a/base/process/process_info_mac.cc b/base/process/process_info_mac.cc
|
|
index 6840358c3187522c63dff66b5a85567aaadc5c12..72c57fbc5fbb267f96ff9e21915fb801ed5bf24e 100644
|
|
--- a/base/process/process_info_mac.cc
|
|
+++ b/base/process/process_info_mac.cc
|
|
@@ -9,18 +9,22 @@
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
|
|
+#if !IS_MAS_BUILD()
|
|
extern "C" {
|
|
pid_t responsibility_get_pid_responsible_for_pid(pid_t)
|
|
API_AVAILABLE(macosx(10.12));
|
|
}
|
|
+#endif
|
|
|
|
namespace base {
|
|
|
|
bool IsProcessSelfResponsible() {
|
|
+#if !IS_MAS_BUILD()
|
|
if (__builtin_available(macOS 10.14, *)) {
|
|
const pid_t pid = getpid();
|
|
return responsibility_get_pid_responsible_for_pid(pid) == pid;
|
|
}
|
|
+#endif
|
|
return true;
|
|
}
|
|
|
|
diff --git a/content/common/pseudonymization_salt.cc b/content/common/pseudonymization_salt.cc
|
|
index c7e4ef224e76b4df4fa08bb7fa8dd78605ea8de1..8a15ee3e062e108824c6b2fadc2ffa807ff03ade 100644
|
|
--- a/content/common/pseudonymization_salt.cc
|
|
+++ b/content/common/pseudonymization_salt.cc
|
|
@@ -41,11 +41,13 @@ uint32_t GetPseudonymizationSalt() {
|
|
uint32_t salt = g_salt.load();
|
|
|
|
if (salt == 0) {
|
|
+#if !IS_MAS_BUILD()
|
|
#if DCHECK_IS_ON()
|
|
// Only the Browser process needs to initialize the `salt` on demand.
|
|
// Other processes (identified via the IsProcessSandboxed heuristic) should
|
|
// receive the salt from their parent processes.
|
|
DCHECK(!sandbox::policy::Sandbox::IsProcessSandboxed());
|
|
+#endif
|
|
#endif
|
|
salt = InitializeSalt();
|
|
}
|
|
diff --git a/content/renderer/renderer_main_platform_delegate_mac.mm b/content/renderer/renderer_main_platform_delegate_mac.mm
|
|
index add9345fdd076698fc7ec654d7ef1701699639a4..ea5287cbe878014e4f0f6124a459bef225b0ca59 100644
|
|
--- a/content/renderer/renderer_main_platform_delegate_mac.mm
|
|
+++ b/content/renderer/renderer_main_platform_delegate_mac.mm
|
|
@@ -10,9 +10,11 @@
|
|
#include "sandbox/mac/seatbelt.h"
|
|
#include "sandbox/mac/system_services.h"
|
|
|
|
+#if !IS_MAS_BUILD()
|
|
extern "C" {
|
|
CGError CGSSetDenyWindowServerConnections(bool);
|
|
}
|
|
+#endif
|
|
|
|
namespace content {
|
|
|
|
@@ -22,6 +24,7 @@
|
|
// verifies there are no existing open connections), and then indicates that
|
|
// Chrome should continue execution without access to launchservicesd.
|
|
void DisableSystemServices() {
|
|
+#if !IS_MAS_BUILD()
|
|
// Tell the WindowServer that we don't want to make any future connections.
|
|
// This will return Success as long as there are no open connections, which
|
|
// is what we want.
|
|
@@ -30,6 +33,7 @@ void DisableSystemServices() {
|
|
|
|
sandbox::DisableLaunchServices();
|
|
sandbox::DisableCoreServicesCheckFix();
|
|
+#endif
|
|
}
|
|
|
|
} // namespace
|
|
diff --git a/content/renderer/theme_helper_mac.mm b/content/renderer/theme_helper_mac.mm
|
|
index f50448237c40710e25644c2f7d44e8d0bc0789c8..752b575cf341546bdcc46e6dfff28fe4c66325b3 100644
|
|
--- a/content/renderer/theme_helper_mac.mm
|
|
+++ b/content/renderer/theme_helper_mac.mm
|
|
@@ -7,11 +7,11 @@
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
#include "base/strings/sys_string_conversions.h"
|
|
-
|
|
+#if !IS_MAS_BUILD()
|
|
extern "C" {
|
|
bool CGFontRenderingGetFontSmoothingDisabled(void) API_AVAILABLE(macos(10.14));
|
|
}
|
|
-
|
|
+#endif
|
|
namespace content {
|
|
|
|
void SystemColorsDidChange(int aqua_color_variant,
|
|
@@ -59,8 +59,19 @@ void SystemColorsDidChange(int aqua_color_variant,
|
|
bool IsSubpixelAntialiasingAvailable() {
|
|
if (__builtin_available(macOS 10.14, *)) {
|
|
// See https://trac.webkit.org/changeset/239306/webkit for more info.
|
|
+#if !IS_MAS_BUILD()
|
|
return !CGFontRenderingGetFontSmoothingDisabled();
|
|
+#else
|
|
+ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
|
+ NSString *default_key = @"CGFontRenderingGetFontSmoothingDisabled";
|
|
+ // Check that key exists since boolForKey defaults to NO when the
|
|
+ // key is missing and this key in fact defaults to YES;
|
|
+ if ([defaults objectForKey:default_key] == nil)
|
|
+ return false;
|
|
+ return ![defaults boolForKey:default_key];
|
|
+#endif
|
|
}
|
|
+
|
|
return true;
|
|
}
|
|
|
|
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
|
|
index dced377388d22f825ce228dd615056ba0548986d..00724d8e6e597441d93c8a2c9b2f9415783213d8 100644
|
|
--- a/device/bluetooth/bluetooth_adapter_mac.mm
|
|
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
|
|
@@ -41,6 +41,7 @@
|
|
#include "device/bluetooth/bluetooth_socket_mac.h"
|
|
#include "device/bluetooth/public/cpp/bluetooth_address.h"
|
|
|
|
+#if !IS_MAS_BUILD()
|
|
extern "C" {
|
|
// Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and
|
|
// `Karabiner` [3] to programmatically control the Bluetooth state. Calling the
|
|
@@ -54,6 +55,7 @@
|
|
// [4] https://support.apple.com/kb/PH25091
|
|
void IOBluetoothPreferenceSetControllerPowerState(int state);
|
|
}
|
|
+#endif
|
|
|
|
namespace {
|
|
|
|
@@ -113,8 +115,10 @@ bool IsDeviceSystemPaired(const std::string& device_address) {
|
|
: controller_state_function_(
|
|
base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState,
|
|
base::Unretained(this))),
|
|
+#if !IS_MAS_BUILD()
|
|
power_state_function_(
|
|
base::BindRepeating(IOBluetoothPreferenceSetControllerPowerState)),
|
|
+#endif
|
|
classic_discovery_manager_(
|
|
BluetoothDiscoveryManagerMac::CreateClassic(this)),
|
|
low_energy_discovery_manager_(
|
|
@@ -355,8 +359,12 @@ bool IsDeviceSystemPaired(const std::string& device_address) {
|
|
}
|
|
|
|
bool BluetoothAdapterMac::SetPoweredImpl(bool powered) {
|
|
+#if !IS_MAS_BUILD()
|
|
power_state_function_.Run(base::strict_cast<int>(powered));
|
|
return true;
|
|
+#else
|
|
+ return false;
|
|
+#endif
|
|
}
|
|
|
|
void BluetoothAdapterMac::RemovePairingDelegateInternal(
|
|
diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
|
|
index 83540722ab1b7b0cb6b74456f2dfc9fc680747cb..8ed81a36306f6dfae965ee90781e5bb79067fa92 100644
|
|
--- a/media/audio/BUILD.gn
|
|
+++ b/media/audio/BUILD.gn
|
|
@@ -178,6 +178,12 @@ source_set("audio") {
|
|
"mac/scoped_audio_unit.cc",
|
|
"mac/scoped_audio_unit.h",
|
|
]
|
|
+ if (is_mas_build) {
|
|
+ sources -= [
|
|
+ "mac/coreaudio_dispatch_override.cc",
|
|
+ "mac/coreaudio_dispatch_override.h",
|
|
+ ]
|
|
+ }
|
|
frameworks = [
|
|
"AudioToolbox.framework",
|
|
"AudioUnit.framework",
|
|
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
|
|
index b5ad37cb3e8064d180ff987ab7a96da3886dc7f9..b6da8a68fabaec5ecf71b2c2fcaa1b0e52d2fcbe 100644
|
|
--- a/media/audio/mac/audio_manager_mac.cc
|
|
+++ b/media/audio/mac/audio_manager_mac.cc
|
|
@@ -895,7 +895,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
|
|
|
|
void AudioManagerMac::InitializeOnAudioThread() {
|
|
DCHECK(GetTaskRunner()->BelongsToCurrentThread());
|
|
- InitializeCoreAudioDispatchOverride();
|
|
+ // InitializeCoreAudioDispatchOverride();
|
|
power_observer_ = std::make_unique<AudioPowerObserver>();
|
|
}
|
|
|
|
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
|
|
index a8a223d1d9ea6de51a27f148c008ee8be38af29a..328200858bd7aa4077bf6824bfc1367bda748920 100644
|
|
--- a/net/dns/dns_config_service_posix.cc
|
|
+++ b/net/dns/dns_config_service_posix.cc
|
|
@@ -130,8 +130,8 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher {
|
|
|
|
bool Watch() override {
|
|
CheckOnCorrectSequence();
|
|
-
|
|
bool success = true;
|
|
+#if !IS_MAS_BUILD()
|
|
if (!config_watcher_.Watch(base::BindRepeating(&Watcher::OnConfigChanged,
|
|
base::Unretained(this)))) {
|
|
LOG(ERROR) << "DNS config watch failed to start.";
|
|
@@ -148,6 +148,7 @@ class DnsConfigServicePosix::Watcher : public DnsConfigService::Watcher {
|
|
success = false;
|
|
}
|
|
#endif // !BUILDFLAG(IS_IOS)
|
|
+#endif
|
|
return success;
|
|
}
|
|
|
|
diff --git a/sandbox/mac/sandbox_compiler.cc b/sandbox/mac/sandbox_compiler.cc
|
|
index 5db411212b62b583ae26e9ecd0a87ad5fc5504e8..2778852a1573ca5d573018171caeadf1e89f3b9e 100644
|
|
--- a/sandbox/mac/sandbox_compiler.cc
|
|
+++ b/sandbox/mac/sandbox_compiler.cc
|
|
@@ -28,6 +28,7 @@ bool SandboxCompiler::InsertStringParam(const std::string& key,
|
|
}
|
|
|
|
bool SandboxCompiler::CompileAndApplyProfile(std::string* error) {
|
|
+#if !IS_MAS_BUILD()
|
|
char* error_internal = nullptr;
|
|
std::vector<const char*> params;
|
|
|
|
@@ -44,6 +45,7 @@ bool SandboxCompiler::CompileAndApplyProfile(std::string* error) {
|
|
sandbox::Seatbelt::FreeError(error_internal);
|
|
return false;
|
|
}
|
|
+#endif
|
|
return true;
|
|
}
|
|
|
|
diff --git a/sandbox/mac/seatbelt.cc b/sandbox/mac/seatbelt.cc
|
|
index 1e75790d60789746073828cc22d3863b35ab6f95..08fa6b16d09e2ceb73094639fa81570202123178 100644
|
|
--- a/sandbox/mac/seatbelt.cc
|
|
+++ b/sandbox/mac/seatbelt.cc
|
|
@@ -64,7 +64,11 @@ void Seatbelt::FreeError(char* errorbuf) {
|
|
|
|
// static
|
|
bool Seatbelt::IsSandboxed() {
|
|
+#if !IS_MAS_BUILD()
|
|
return ::sandbox_check(getpid(), NULL, 0);
|
|
+#else
|
|
+ return true;
|
|
+#endif
|
|
}
|
|
|
|
} // namespace sandbox
|
|
diff --git a/sandbox/mac/seatbelt_extension.cc b/sandbox/mac/seatbelt_extension.cc
|
|
index 18479382a277cb2b25626ec8d31442bfd1377ee6..7d80d7fa8337523c3a70f317f883f0cc26c6f40b 100644
|
|
--- a/sandbox/mac/seatbelt_extension.cc
|
|
+++ b/sandbox/mac/seatbelt_extension.cc
|
|
@@ -11,6 +11,7 @@
|
|
#include "base/notreached.h"
|
|
#include "sandbox/mac/seatbelt_extension_token.h"
|
|
|
|
+#if !IS_MAS_BUILD()
|
|
// libsandbox private API.
|
|
extern "C" {
|
|
extern const char* APP_SANDBOX_READ;
|
|
@@ -22,6 +23,7 @@ char* sandbox_extension_issue_file(const char* type,
|
|
const char* path,
|
|
uint32_t flags);
|
|
}
|
|
+#endif
|
|
|
|
namespace sandbox {
|
|
|
|
@@ -50,7 +52,11 @@ std::unique_ptr<SeatbeltExtension> SeatbeltExtension::FromToken(
|
|
|
|
bool SeatbeltExtension::Consume() {
|
|
DCHECK(!token_.empty());
|
|
+#if !IS_MAS_BUILD()
|
|
handle_ = sandbox_extension_consume(token_.c_str());
|
|
+#else
|
|
+ handle_ = -1;
|
|
+#endif
|
|
return handle_ > 0;
|
|
}
|
|
|
|
@@ -62,7 +68,11 @@ bool SeatbeltExtension::ConsumePermanently() {
|
|
}
|
|
|
|
bool SeatbeltExtension::Revoke() {
|
|
+#if !IS_MAS_BUILD()
|
|
int rv = sandbox_extension_release(handle_);
|
|
+#else
|
|
+ int rv = -1;
|
|
+#endif
|
|
handle_ = 0;
|
|
token_.clear();
|
|
return rv == 0;
|
|
@@ -80,12 +90,14 @@ SeatbeltExtension::SeatbeltExtension(const std::string& token)
|
|
char* SeatbeltExtension::IssueToken(SeatbeltExtension::Type type,
|
|
const std::string& resource) {
|
|
switch (type) {
|
|
+#if !IS_MAS_BUILD()
|
|
case FILE_READ:
|
|
return sandbox_extension_issue_file(APP_SANDBOX_READ, resource.c_str(),
|
|
0);
|
|
case FILE_READ_WRITE:
|
|
return sandbox_extension_issue_file(APP_SANDBOX_READ_WRITE,
|
|
resource.c_str(), 0);
|
|
+#endif
|
|
default:
|
|
NOTREACHED();
|
|
return nullptr;
|
|
diff --git a/ui/accessibility/platform/inspect/ax_transform_mac.mm b/ui/accessibility/platform/inspect/ax_transform_mac.mm
|
|
index fe043e6dc2203a9054ae367b70a3854b8560c9c7..6cc51d9df176512f6f296e0eb82bc31b5a9515fa 100644
|
|
--- a/ui/accessibility/platform/inspect/ax_transform_mac.mm
|
|
+++ b/ui/accessibility/platform/inspect/ax_transform_mac.mm
|
|
@@ -88,6 +88,7 @@
|
|
}
|
|
}
|
|
|
|
+#if !IS_MAS_BUILD()
|
|
// AXTextMarker
|
|
if (IsAXTextMarker(value)) {
|
|
return AXTextMarkerToBaseValue(value, indexer);
|
|
@@ -96,6 +97,7 @@
|
|
// AXTextMarkerRange
|
|
if (IsAXTextMarkerRange(value))
|
|
return AXTextMarkerRangeToBaseValue(value, indexer);
|
|
+#endif
|
|
|
|
// Accessible object
|
|
if (AXElementWrapper::IsValidElement(value)) {
|