fix: support macos 10.14 SDK (#14758)
* support macos 10.14 SDK * forward-declare NSUserActivityRestoring for backwards compatibility * that didn't work, let's resort to #ifdef
This commit is contained in:
parent
8a1ff7ca49
commit
335caef9ad
3 changed files with 110 additions and 2 deletions
|
@ -98,8 +98,12 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
|
|||
- (BOOL)application:(NSApplication*)sender
|
||||
continueUserActivity:(NSUserActivity*)userActivity
|
||||
restorationHandler:
|
||||
(void (^)(NSArray* restorableObjects))restorationHandler
|
||||
API_AVAILABLE(macosx(10.10)) {
|
||||
#ifdef MAC_OS_X_VERSION_10_14
|
||||
(void (^)(NSArray<id<NSUserActivityRestoring>>* restorableObjects))
|
||||
#else
|
||||
(void (^)(NSArray* restorableObjects))
|
||||
#endif
|
||||
restorationHandler API_AVAILABLE(macosx(10.10)) {
|
||||
std::string activity_type(base::SysNSStringToUTF8(userActivity.activityType));
|
||||
std::unique_ptr<base::DictionaryValue> user_info =
|
||||
atom::NSDictionaryToDictionaryValue(userActivity.userInfo);
|
||||
|
|
|
@ -455,3 +455,7 @@ patches:
|
|||
description: |
|
||||
Accept all HTTP codes in [200, 300) as successful, instead of just 200.
|
||||
For example HockeyApp responds with 202.
|
||||
-
|
||||
author: Jeremy Apthorp <jeremya@chromium.org>
|
||||
file: backport_cd7154e0bb5.patch
|
||||
description: Support macosx 10.14 SDK
|
||||
|
|
100
patches/common/chromium/backport_cd7154e0bb5.patch
Normal file
100
patches/common/chromium/backport_cd7154e0bb5.patch
Normal file
|
@ -0,0 +1,100 @@
|
|||
From 0dc7f85f52b9a5668481dfa206e6e55d40357cc2 Mon Sep 17 00:00:00 2001
|
||||
From: Elly Fong-Jones <ellyjones@chromium.org>
|
||||
Date: Wed, 6 Jun 2018 21:31:34 +0000
|
||||
Subject: mac: support build with 10.14 SDK
|
||||
|
||||
Two changes are required:
|
||||
|
||||
1) Explicitly upcast the result of dispatch_get_global_queue() to a
|
||||
dispatch_queue_t*, since it changed to return dispatch_queue_global_t*;
|
||||
2) Add empty implementations of the new methods on ICCameraDeviceDelegate for
|
||||
ImageCaptureDevice
|
||||
|
||||
TBR=maxmorin@chromium.org
|
||||
|
||||
Bug: 849689
|
||||
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
|
||||
Change-Id: I9448d1b07f8d4116ecdb0c75a7796472e51c6dd8
|
||||
Reviewed-on: https://chromium-review.googlesource.com/1087169
|
||||
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
|
||||
Reviewed-by: Robert Sesek <rsesek@chromium.org>
|
||||
Reviewed-by: Tommy Li <tommycli@chromium.org>
|
||||
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#565040}
|
||||
|
||||
diff --git a/components/storage_monitor/image_capture_device.mm b/components/storage_monitor/image_capture_device.mm
|
||||
index af289bd66eb6..831cb65ac970 100644
|
||||
--- a/components/storage_monitor/image_capture_device.mm
|
||||
+++ b/components/storage_monitor/image_capture_device.mm
|
||||
@@ -231,4 +231,38 @@ base::FilePath PathForCameraItem(ICCameraItem* item) {
|
||||
name));
|
||||
}
|
||||
|
||||
+// MacOS 10.14 SDK methods, not yet implemented (https://crbug.com/849689)
|
||||
+- (void)cameraDevice:(ICCameraDevice*)camera
|
||||
+ didRenameItems:(NSArray<ICCameraItem*>*)items {
|
||||
+ NOTIMPLEMENTED();
|
||||
+}
|
||||
+
|
||||
+- (void)cameraDevice:(ICCameraDevice*)camera didRemoveItem:(ICCameraItem*)item {
|
||||
+ NOTIMPLEMENTED();
|
||||
+}
|
||||
+
|
||||
+- (void)cameraDevice:(ICCameraDevice*)camera
|
||||
+ didCompleteDeleteFilesWithError:(NSError*)error {
|
||||
+ NOTIMPLEMENTED();
|
||||
+}
|
||||
+
|
||||
+- (void)cameraDeviceDidChangeCapability:(ICCameraDevice*)camera {
|
||||
+ NOTIMPLEMENTED();
|
||||
+}
|
||||
+
|
||||
+- (void)cameraDevice:(ICCameraDevice*)camera
|
||||
+ didReceiveThumbnailForItem:(ICCameraItem*)item {
|
||||
+ NOTIMPLEMENTED();
|
||||
+}
|
||||
+
|
||||
+- (void)cameraDevice:(ICCameraDevice*)camera
|
||||
+ didReceiveMetadataForItem:(ICCameraItem*)item {
|
||||
+ NOTIMPLEMENTED();
|
||||
+}
|
||||
+
|
||||
+- (void)cameraDevice:(ICCameraDevice*)camera
|
||||
+ didReceivePTPEvent:(NSData*)eventData {
|
||||
+ NOTIMPLEMENTED();
|
||||
+}
|
||||
+
|
||||
@end // ImageCaptureDevice
|
||||
diff --git a/media/audio/mac/coreaudio_dispatch_override.cc b/media/audio/mac/coreaudio_dispatch_override.cc
|
||||
index 2ac812b0f3fc..34d1ad2a0fbe 100644
|
||||
--- a/media/audio/mac/coreaudio_dispatch_override.cc
|
||||
+++ b/media/audio/mac/coreaudio_dispatch_override.cc
|
||||
@@ -22,6 +22,9 @@ struct dyld_interpose_tuple {
|
||||
const void* replacement;
|
||||
const void* replacee;
|
||||
};
|
||||
+
|
||||
+using DispatchGetGlobalQueueFunc = dispatch_queue_t (*)(long id,
|
||||
+ unsigned long flags);
|
||||
} // namespace
|
||||
|
||||
// This method, and the tuple above, is defined in dyld_priv.h; see:
|
||||
@@ -175,8 +178,13 @@ bool InitializeCoreAudioDispatchOverride() {
|
||||
const auto* header = reinterpret_cast<const mach_header*>(info.dli_fbase);
|
||||
g_pause_resume_queue =
|
||||
dispatch_queue_create("org.chromium.CoreAudioPauseResumeQueue", nullptr);
|
||||
- dyld_interpose_tuple interposition(&GetGlobalQueueOverride,
|
||||
- &dispatch_get_global_queue);
|
||||
+ // The reinterpret_cast<> is needed because in the macOS 10.14 SDK, the return
|
||||
+ // type of dispatch_get_global_queue changed to return a subtype of
|
||||
+ // dispatch_queue_t* instead of dispatch_queue_t* itself, and T(*)(...) isn't
|
||||
+ // automatically converted to U(*)(...) even if U is a superclass of T.
|
||||
+ dyld_interpose_tuple interposition(
|
||||
+ &GetGlobalQueueOverride,
|
||||
+ reinterpret_cast<DispatchGetGlobalQueueFunc>(&dispatch_get_global_queue));
|
||||
dyld_dynamic_interpose(header, &interposition, 1);
|
||||
g_dispatch_override_installed = true;
|
||||
LogInitResult(RESULT_INITIALIZED);
|
||||
--
|
||||
2.17.0
|
||||
|
Loading…
Reference in a new issue