mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* chore: update 10-x-y to 85.0.4161.2 * Update patches * chore: SetHostCleanupFinalizationGroupCallback has been removed from V8 (cherry picked from commit7aa3058829) * Window Placement: Gate cross-screen fullscreen behavior on permission https://chromium-review.googlesource.com/c/chromium/src/+/2203268 (cherry picked from commitfdccae9246) * refactor: GetSublabelAt => GetSecondaryLabelAt (cherry picked from commitcc8be2f634) * refactor: use WebInputEvent::Namespace types directly Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2160523 (cherry picked from commitf35200077e) * refactor: service_manager::BinderMapWithContext merged into mojo::BinderMap Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2174654 (cherry picked from commitc2a4d1b515) * remove WebContentsView::SizeContents Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2188931 (cherry picked from commitf4ccf3556c) * adapt to //content creating NetworkContexts https://chromium-review.googlesource.com/c/chromium/src/+/2195196 (cherry picked from commit6834366747) * Use a normal return value for WebContentsView::GetContainerBounds. https://chromium-review.googlesource.com/c/chromium/src/+/2212481 (cherry picked from commit68c8ea6ea9) * fixup patch * refactor: AddNewContents now takes a target_url Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2167732 (cherry picked from commit69fe1f6f47) * refactor: FollowRedirect takes in cors exempt headers now Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2129787 (cherry picked from commit58f3770c19) * refactor: printing::DuplexMode moved to mojo Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2162388 (cherry picked from commita14cdc465a) * refactor: use MessagePortDescriptor instead of raw mojo::MessagePipeHandles Refs: https://chromium-review.googlesource.com/c/chromium/src/+/1952124 (cherry picked from commitdce81ad06f) * refactor: cursor.mojom and cursor_types.mojom moved to //ui/base/cursor/mojom Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2172874 (cherry picked from commit7f3c13de3f) * refactor: shuttle cursor changed event to WebContentsObserver Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2172779 (cherry picked from commit2f3a23afb7) Co-Authored-By: loc <loc@users.noreply.github.com> * chore: unused argument removed from ReadAvailableTypes in ui::Clipboard Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2173666 (cherry picked from commitd9152c3668) * remove ClientSideDetectionService from browser_process Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2175320 (cherry picked from commit2461522752) * Remove cors_exempt_headers.h https://chromium-review.googlesource.com/c/chromium/src/+/2203759 (cherry picked from commitb73faa6411) * [content] Remove unused methods from WebContents https://chromium-review.googlesource.com/c/chromium/src/+/2199113 (cherry picked from commit8b9ea9cd2b) * Unnest CanonicalCookie::CookieInclusionStatus https://chromium-review.googlesource.com/c/chromium/src/+/2203171 (cherry picked from commit7d4349b37c) * WebContentsObserver now implements OnRendererResponsive https://chromium-review.googlesource.com/c/chromium/src/+/2211066 (cherry picked from commit53f32b7e45) * chore: remove NOTIFICATION_EXTENSIONS_READY_DEPRECATED Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2199874 (cherry picked from commit7914445469) * Supply speech recognition sandbox from service_sandbox_type.h https://chromium-review.googlesource.com/c/chromium/src/+/2206918 (cherry picked from commitf15a0fdfab) * [XProto] Replace XAtom with x11::Atom https://chromium-review.googlesource.com/c/chromium/src/+/2202789 (cherry picked from commit143110105a) * update print-to-pdf.html with latest html data https://bugs.chromium.org/p/chromium/issues/detail?id=1085667 (cherry picked from commit205105fc16) * fix build on windows (cherry picked from commit0a255c4fa7) * [printing] Mojofy PrintHostMsg_CheckForCancel https://chromium-review.googlesource.com/c/chromium/src/+/2212181 (cherry picked from commit4f1064afa9) * chore: update sysroots (cherry picked from commit2a1b78a4bf) * chore: DesktopWindowTreeHostLinux becomes DesktopWindowTreeHostPlatform Refs: (cherry picked from commit3fd0875d3d) * refactor: LogErrorEventDescription moved from ui to x11 Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2164245 (cherry picked from commit9291fc4afc) * fix: inherit base network context params (cherry picked from commit698c66f7f9) * fix: use message handle api specific to embedders (cherry picked from commit23d01dc8e0) * chore: update v8 headers (cherry picked from commit81bc1e0bee) * add checkout_pgo_profiles to DEPS (cherry picked from commit9b73e6935c) * refactor: use newly mojo-ified PrintPreviewFailed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2195343 Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> (cherry picked from commitde074ce23a) * [printing] Mojofy PrintHostMsg_PrintPreviewCancelled https://chromium-review.googlesource.com/c/chromium/src/+/2198331 (cherry picked from commit7bd8a6a576) * [printing] Mojofy PrintHostMsg_PrintPreviewInvalidPrinterSettings https://chromium-review.googlesource.com/c/chromium/src/+/2200556 (cherry picked from commitdd68ba1ecf) * Network service: Remove primary_network_context bool. https://chromium-review.googlesource.com/c/chromium/src/+/2204678 (cherry picked from commit6a0e8e5bf9) * [printing] Move PrintHostMsg_DidPrintContent_Params to print.mojom https://chromium-review.googlesource.com/c/chromium/src/+/2212110 (cherry picked from commita6a3291d9a) * [XProto] Move items from ::x11::XProto to ::x11 https://chromium-review.googlesource.com/c/chromium/src/+/2218476 (cherry picked from commitb16c48830a) * Update patches * Remove no longer needed patch * update patches * update patches Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Andy Locascio <andy@slack-corp.com> Co-authored-by: loc <loc@users.noreply.github.com> Co-authored-by: Electron Bot <anonymous@electronjs.org>
502 lines
19 KiB
Diff
502 lines
19 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_no_private_api.patch
|
|
|
|
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/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h
|
|
index 5124b17f020849671a7f03d92bda052eff84d169..f9730f71c122965f7ce7815a1b9a7b32f8a224f0 100644
|
|
--- a/content/browser/accessibility/browser_accessibility_cocoa.h
|
|
+++ b/content/browser/accessibility/browser_accessibility_cocoa.h
|
|
@@ -112,7 +112,9 @@ struct AXTextEdit {
|
|
@property(nonatomic, readonly) NSNumber* enabled;
|
|
// Returns a text marker that points to the last character in the document that
|
|
// can be selected with Voiceover.
|
|
+#ifndef MAS_BUILD
|
|
@property(nonatomic, readonly) id endTextMarker;
|
|
+#endif
|
|
@property(nonatomic, readonly) NSNumber* expanded;
|
|
@property(nonatomic, readonly) NSNumber* focused;
|
|
@property(nonatomic, readonly) NSNumber* grabbed;
|
|
@@ -123,7 +125,9 @@ struct AXTextEdit {
|
|
@property(nonatomic, readonly, getter=isIgnored) BOOL ignored;
|
|
// Index of a row, column, or tree item.
|
|
@property(nonatomic, readonly) NSNumber* index;
|
|
+#ifndef MAS_BUILD
|
|
@property(nonatomic, readonly) NSNumber* insertionPointLineNumber;
|
|
+#endif
|
|
@property(nonatomic, readonly) NSString* invalid;
|
|
@property(nonatomic, readonly) NSNumber* isMultiSelectable;
|
|
@property(nonatomic, readonly) NSString* placeholderValue;
|
|
@@ -146,14 +150,18 @@ struct AXTextEdit {
|
|
// The object is selected as a whole.
|
|
@property(nonatomic, readonly) NSNumber* selected;
|
|
@property(nonatomic, readonly) NSArray* selectedChildren;
|
|
+#ifndef MAS_BUILD
|
|
@property(nonatomic, readonly) NSString* selectedText;
|
|
@property(nonatomic, readonly) NSValue* selectedTextRange;
|
|
@property(nonatomic, readonly) id selectedTextMarkerRange;
|
|
+#endif
|
|
@property(nonatomic, readonly) NSValue* size;
|
|
@property(nonatomic, readonly) NSString* sortDirection;
|
|
// Returns a text marker that points to the first character in the document that
|
|
// can be selected with Voiceover.
|
|
+#ifndef MAS_BUILD
|
|
@property(nonatomic, readonly) id startTextMarker;
|
|
+#endif
|
|
// A string indicating the subrole of this object as far as accessibility
|
|
// is concerned.
|
|
@property(nonatomic, readonly) NSString* subrole;
|
|
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
|
index a35b6dae73540518443a4b4d5745178e248c64f0..38ca03b2365e0d3a2c15abda6fb05256851deb57 100644
|
|
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
|
|
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
|
@@ -206,6 +206,7 @@ NSString* const
|
|
NSString* const NSAccessibilityLengthForTextMarkerRangeParameterizedAttribute =
|
|
@"AXLengthForTextMarkerRange";
|
|
|
|
+#ifndef MAS_BUILD
|
|
// Private attributes that can be used for testing text markers, e.g. in dump
|
|
// tree tests.
|
|
NSString* const
|
|
@@ -217,6 +218,7 @@ NSString* const
|
|
NSString* const
|
|
NSAccessibilityTextMarkerNodeDebugDescriptionParameterizedAttribute =
|
|
@"AXTextMarkerNodeDebugDescription";
|
|
+#endif
|
|
|
|
// Other private attributes.
|
|
NSString* const NSAccessibilitySelectTextWithCriteriaParameterizedAttribute =
|
|
@@ -240,6 +242,7 @@ NSDictionary* attributeToMethodNameMap = nil;
|
|
// VoiceOver uses -1 to mean "no limit" for AXResultsLimit.
|
|
const int kAXResultsLimitNoLimit = -1;
|
|
|
|
+#ifndef MAS_BUILD
|
|
extern "C" {
|
|
|
|
// The following are private accessibility APIs required for cursor navigation
|
|
@@ -468,6 +471,7 @@ NSAttributedString* GetAttributedTextForTextMarkerRange(id marker_range) {
|
|
AddMisspelledTextAttributes(ax_range, attributed_text);
|
|
return attributed_text;
|
|
}
|
|
+#endif
|
|
|
|
// Returns an autoreleased copy of the AXNodeData's attribute.
|
|
NSString* NSStringForStringAttribute(BrowserAccessibility* browserAccessibility,
|
|
@@ -761,7 +765,9 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
{NSAccessibilityEditableAncestorAttribute, @"editableAncestor"},
|
|
{NSAccessibilityElementBusyAttribute, @"elementBusy"},
|
|
{NSAccessibilityEnabledAttribute, @"enabled"},
|
|
+#ifndef MAS_BUILD
|
|
{NSAccessibilityEndTextMarkerAttribute, @"endTextMarker"},
|
|
+#endif
|
|
{NSAccessibilityExpandedAttribute, @"expanded"},
|
|
{NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"},
|
|
{NSAccessibilityFocusedAttribute, @"focused"},
|
|
@@ -773,8 +779,10 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
{NSAccessibilityHighestEditableAncestorAttribute,
|
|
@"highestEditableAncestor"},
|
|
{NSAccessibilityIndexAttribute, @"index"},
|
|
+#ifndef MAS_BUILD
|
|
{NSAccessibilityInsertionPointLineNumberAttribute,
|
|
@"insertionPointLineNumber"},
|
|
+#endif
|
|
{NSAccessibilityInvalidAttribute, @"invalid"},
|
|
{NSAccessibilityIsMultiSelectableAttribute, @"isMultiSelectable"},
|
|
{NSAccessibilityLanguageAttribute, @"language"},
|
|
@@ -796,13 +804,17 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
{NSAccessibilityRowsAttribute, @"rows"},
|
|
// TODO(aboxhall): expose
|
|
// NSAccessibilityServesAsTitleForUIElementsAttribute
|
|
+#ifndef MAS_BUILD
|
|
{NSAccessibilityStartTextMarkerAttribute, @"startTextMarker"},
|
|
+#endif
|
|
{NSAccessibilitySelectedAttribute, @"selected"},
|
|
{NSAccessibilitySelectedChildrenAttribute, @"selectedChildren"},
|
|
+#ifndef MAS_BUILD
|
|
{NSAccessibilitySelectedTextAttribute, @"selectedText"},
|
|
{NSAccessibilitySelectedTextRangeAttribute, @"selectedTextRange"},
|
|
{NSAccessibilitySelectedTextMarkerRangeAttribute,
|
|
@"selectedTextMarkerRange"},
|
|
+#endif
|
|
{NSAccessibilitySizeAttribute, @"size"},
|
|
{NSAccessibilitySortDirectionAttribute, @"sortDirection"},
|
|
{NSAccessibilitySubroleAttribute, @"subrole"},
|
|
@@ -1290,6 +1302,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
ax::mojom::Restriction::kDisabled];
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
// Returns a text marker that points to the last character in the document that
|
|
// can be selected with VoiceOver.
|
|
- (id)endTextMarker {
|
|
@@ -1300,6 +1313,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
|
|
return CreateTextMarker(position->CreatePositionAtEndOfAnchor());
|
|
}
|
|
+#endif
|
|
|
|
- (NSNumber*)expanded {
|
|
if (![self instanceActive])
|
|
@@ -1449,6 +1463,8 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
return nil;
|
|
}
|
|
|
|
+
|
|
+#ifndef MAS_BUILD
|
|
- (NSNumber*)insertionPointLineNumber {
|
|
if (![self instanceActive])
|
|
return nil;
|
|
@@ -1471,6 +1487,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
caretPosition->AsTextPosition()->text_offset());
|
|
return @(std::distance(lineBreaks.begin(), iterator));
|
|
}
|
|
+#endif
|
|
|
|
// Returns whether or not this node should be ignored in the
|
|
// accessibility tree.
|
|
@@ -2147,6 +2164,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
return ret;
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
- (NSString*)selectedText {
|
|
if (![self instanceActive])
|
|
return nil;
|
|
@@ -2158,11 +2176,13 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
return nil;
|
|
return base::SysUTF16ToNSString(range.GetText());
|
|
}
|
|
+#endif
|
|
|
|
// Returns range of text under the current object that is selected.
|
|
//
|
|
// Example, caret at offset 5:
|
|
// NSRange: “pos=5 len=0”
|
|
+#ifndef MAS_BUILD
|
|
- (NSValue*)selectedTextRange {
|
|
if (![self instanceActive])
|
|
return nil;
|
|
@@ -2183,12 +2203,15 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
int selLength = range.GetText().length();
|
|
return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
|
|
}
|
|
+#endif
|
|
|
|
+#ifndef MAS_BUILD
|
|
- (id)selectedTextMarkerRange {
|
|
if (![self instanceActive])
|
|
return nil;
|
|
return CreateTextMarkerRange(GetSelectedRange(*_owner));
|
|
}
|
|
+#endif
|
|
|
|
- (NSValue*)size {
|
|
if (![self instanceActive])
|
|
@@ -2221,6 +2244,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
return nil;
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
// Returns a text marker that points to the first character in the document that
|
|
// can be selected with VoiceOver.
|
|
- (id)startTextMarker {
|
|
@@ -2231,6 +2255,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
|
|
return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
|
|
}
|
|
+#endif
|
|
|
|
// Returns a subrole based upon the role.
|
|
- (NSString*)subrole {
|
|
@@ -2553,11 +2578,13 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
NSMutableAttributedString* attributedInnerText =
|
|
[[[NSMutableAttributedString alloc]
|
|
initWithString:base::SysUTF16ToNSString(innerText)] autorelease];
|
|
+#ifndef MAS_BUILD
|
|
if (!_owner->IsTextOnlyObject()) {
|
|
AXPlatformRange ax_range(_owner->CreatePositionAt(0),
|
|
_owner->CreatePositionAt(int{innerText.length()}));
|
|
AddMisspelledTextAttributes(ax_range, attributedInnerText);
|
|
}
|
|
+#endif
|
|
|
|
return [attributedInnerText attributedSubstringFromRange:range];
|
|
}
|
|
@@ -2661,9 +2688,8 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
return ToBrowserAccessibilityCocoa(cell);
|
|
}
|
|
|
|
- if ([attribute
|
|
- isEqualToString:
|
|
- NSAccessibilityUIElementForTextMarkerParameterizedAttribute]) {
|
|
+#ifndef MAS_BUILD
|
|
+ if ([attribute isEqualToString:NSAccessibilityUIElementForTextMarkerParameterizedAttribute]) {
|
|
BrowserAccessibilityPositionInstance position =
|
|
CreatePositionFromTextMarker(parameter);
|
|
if (!position->IsNullPosition())
|
|
@@ -2976,6 +3002,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
|
|
return CreateTextMarker(root->CreatePositionAt(index));
|
|
}
|
|
+#endif
|
|
|
|
if ([attribute isEqualToString:
|
|
NSAccessibilityBoundsForRangeParameterizedAttribute]) {
|
|
@@ -3011,6 +3038,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
return nil;
|
|
}
|
|
|
|
+#ifndef MAS_BUILD
|
|
if ([attribute
|
|
isEqualToString:
|
|
NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
|
|
@@ -3125,6 +3153,7 @@ NSString* const NSAccessibilityRequiredAttributeChrome = @"AXRequired";
|
|
|
|
return @(child->GetIndexInParent());
|
|
}
|
|
+#endif
|
|
|
|
return nil;
|
|
}
|
|
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
|
index 83d0106f0f237dea75dfafe011bf527d97240d0d..462577a0dbd0fcc1baf17acd9678317cb27503fa 100644
|
|
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
|
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
|
|
@@ -525,6 +525,7 @@ NSDictionary* BrowserAccessibilityManagerMac::
|
|
[user_info setObject:native_focus_object
|
|
forKey:NSAccessibilityTextChangeElement];
|
|
|
|
+#ifndef MAS_BUILD
|
|
id selected_text = [native_focus_object selectedTextMarkerRange];
|
|
if (selected_text) {
|
|
NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute =
|
|
@@ -532,6 +533,7 @@ NSDictionary* BrowserAccessibilityManagerMac::
|
|
[user_info setObject:selected_text
|
|
forKey:NSAccessibilitySelectedTextMarkerRangeAttribute];
|
|
}
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
diff --git a/content/renderer/renderer_main_platform_delegate_mac.mm b/content/renderer/renderer_main_platform_delegate_mac.mm
|
|
index 28ca1646af0b0cce40d27baec71cbe65adc334fa..bae65c1f485bc02eb9ef2ebf7018af4a5a492397 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"
|
|
|
|
+#ifndef MAS_BUILD
|
|
extern "C" {
|
|
CGError CGSSetDenyWindowServerConnections(bool);
|
|
}
|
|
+#endif
|
|
|
|
namespace content {
|
|
|
|
@@ -22,6 +24,7 @@ namespace {
|
|
// verifies there are no existing open connections), and then indicates that
|
|
// Chrome should continue execution without access to launchservicesd.
|
|
void DisableSystemServices() {
|
|
+#ifndef 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.
|
|
@@ -29,6 +32,7 @@ void DisableSystemServices() {
|
|
CHECK_EQ(result, kCGErrorSuccess);
|
|
|
|
sandbox::DisableLaunchServices();
|
|
+#endif
|
|
}
|
|
|
|
} // namespace
|
|
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
|
|
index 0b2c4e6d169b08d82d2359576a29e2f7d2b09dcf..7b5fbbae1f9b2ade0c07360bd3fecda129a0c95b 100644
|
|
--- a/device/bluetooth/bluetooth_adapter_mac.mm
|
|
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
|
|
@@ -35,6 +35,7 @@
|
|
#include "device/bluetooth/bluetooth_low_energy_peripheral_manager_delegate.h"
|
|
#include "device/bluetooth/bluetooth_socket_mac.h"
|
|
|
|
+#ifndef MAS_BUILD
|
|
extern "C" {
|
|
// Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and
|
|
// `Karabiner` [3] to programmatically control the Bluetooth state. Calling the
|
|
@@ -48,6 +49,7 @@ extern "C" {
|
|
// [4] https://support.apple.com/kb/PH25091
|
|
void IOBluetoothPreferenceSetControllerPowerState(int state);
|
|
}
|
|
+#endif
|
|
|
|
namespace {
|
|
|
|
@@ -117,8 +119,10 @@ BluetoothAdapterMac::BluetoothAdapterMac()
|
|
controller_state_function_(
|
|
base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState,
|
|
base::Unretained(this))),
|
|
+#ifndef MAS_BUILD
|
|
power_state_function_(
|
|
base::BindRepeating(IOBluetoothPreferenceSetControllerPowerState)),
|
|
+#endif
|
|
should_update_name_(true),
|
|
classic_discovery_manager_(
|
|
BluetoothDiscoveryManagerMac::CreateClassic(this)),
|
|
@@ -303,8 +307,12 @@ base::WeakPtr<BluetoothAdapter> BluetoothAdapterMac::GetWeakPtr() {
|
|
}
|
|
|
|
bool BluetoothAdapterMac::SetPoweredImpl(bool powered) {
|
|
+#ifndef 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 5acdb011a1f232569b43ba2f08a21f44b3c40151..9fca5b2e8c714308a404750cc9fc64dcaffa91cc 100644
|
|
--- a/media/audio/BUILD.gn
|
|
+++ b/media/audio/BUILD.gn
|
|
@@ -171,6 +171,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",
|
|
+ ]
|
|
+ }
|
|
libs += [
|
|
"AudioToolbox.framework",
|
|
"AudioUnit.framework",
|
|
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
|
|
index a994f74bb68d1e57ffa787e159f0a6c69e7b6953..1d84f84b59b2bae75c10c00da730022eca52d258 100644
|
|
--- a/media/audio/mac/audio_manager_mac.cc
|
|
+++ b/media/audio/mac/audio_manager_mac.cc
|
|
@@ -882,7 +882,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
|
|
|
|
void AudioManagerMac::InitializeOnAudioThread() {
|
|
DCHECK(GetTaskRunner()->BelongsToCurrentThread());
|
|
- InitializeCoreAudioDispatchOverride();
|
|
+ // InitializeCoreAudioDispatchOverride();
|
|
power_observer_.reset(new AudioPowerObserver());
|
|
}
|
|
|
|
diff --git a/net/dns/dns_config_service_posix.cc b/net/dns/dns_config_service_posix.cc
|
|
index d8224724a8920330ef2ff8179f87b84bb8a58045..4f61e4441e6597306140847f2de567f3f094677e 100644
|
|
--- a/net/dns/dns_config_service_posix.cc
|
|
+++ b/net/dns/dns_config_service_posix.cc
|
|
@@ -247,6 +247,7 @@ class DnsConfigServicePosix::Watcher {
|
|
|
|
bool Watch() {
|
|
bool success = true;
|
|
+#ifndef MAS_BUILD
|
|
if (!config_watcher_.Watch(base::BindRepeating(&Watcher::OnConfigChanged,
|
|
base::Unretained(this)))) {
|
|
LOG(ERROR) << "DNS config watch failed to start.";
|
|
@@ -268,6 +269,7 @@ class DnsConfigServicePosix::Watcher {
|
|
DNS_CONFIG_WATCH_MAX);
|
|
}
|
|
#endif // !defined(OS_ANDROID) && !defined(OS_IOS)
|
|
+#endif
|
|
return success;
|
|
}
|
|
|
|
diff --git a/sandbox/mac/sandbox_compiler.cc b/sandbox/mac/sandbox_compiler.cc
|
|
index e524aa7b851022abed1edac39e18d8d92e5349b4..718d3f963da5c1a15a1bdb0e6043f89bc0f940f8 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) {
|
|
+#ifndef 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 e0c31170acd13c9997c6b1d04c6de1420feaf422..0e561f97b33380bfbe52e64c2c4a6988095e8074 100644
|
|
--- a/sandbox/mac/seatbelt.cc
|
|
+++ b/sandbox/mac/seatbelt.cc
|
|
@@ -64,7 +64,11 @@ void Seatbelt::FreeError(char* errorbuf) {
|
|
|
|
// static
|
|
bool Seatbelt::IsSandboxed() {
|
|
+#ifndef 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 84c7370a3bb98aa29cdc04730a25148c3adc162a..5175c2c210e13e41224ae7268528c595c35cc4dc 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"
|
|
|
|
+#ifndef MAS_BUILD
|
|
// libsandbox private API.
|
|
extern "C" {
|
|
extern const char* APP_SANDBOX_READ;
|
|
@@ -21,6 +22,7 @@ char* sandbox_extension_issue_file(const char* type,
|
|
const char* path,
|
|
uint32_t flags);
|
|
}
|
|
+#endif
|
|
|
|
namespace sandbox {
|
|
|
|
@@ -49,7 +51,11 @@ std::unique_ptr<SeatbeltExtension> SeatbeltExtension::FromToken(
|
|
|
|
bool SeatbeltExtension::Consume() {
|
|
DCHECK(!token_.empty());
|
|
+#ifndef MAS_BUILD
|
|
handle_ = sandbox_extension_consume(token_.c_str());
|
|
+#else
|
|
+ handle_ = -1;
|
|
+#endif
|
|
return handle_ > 0;
|
|
}
|
|
|
|
@@ -61,7 +67,11 @@ bool SeatbeltExtension::ConsumePermanently() {
|
|
}
|
|
|
|
bool SeatbeltExtension::Revoke() {
|
|
+#ifndef MAS_BUILD
|
|
int rv = sandbox_extension_release(handle_);
|
|
+#else
|
|
+ int rv = -1;
|
|
+#endif
|
|
handle_ = 0;
|
|
token_.clear();
|
|
return rv == 0;
|
|
@@ -79,9 +89,11 @@ SeatbeltExtension::SeatbeltExtension(const std::string& token)
|
|
char* SeatbeltExtension::IssueToken(SeatbeltExtension::Type type,
|
|
const std::string& resource) {
|
|
switch (type) {
|
|
+#ifndef MAS_BUILD
|
|
case FILE_READ:
|
|
return sandbox_extension_issue_file(APP_SANDBOX_READ, resource.c_str(),
|
|
0);
|
|
+#endif
|
|
default:
|
|
NOTREACHED();
|
|
return nullptr;
|