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 af289bd..831cb65 100644
--- src/3rdparty/chromium/components/storage_monitor/image_capture_device.mm
+++ src/3rdparty/chromium/components/storage_monitor/image_capture_device.mm
@@ -231,4 +231,38 @@
                  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 2ac812b..34d1ad2 100644
--- src/3rdparty/chromium/media/audio/mac/coreaudio_dispatch_override.cc
+++ src/3rdparty/chromium/media/audio/mac/coreaudio_dispatch_override.cc
@@ -22,6 +22,9 @@
   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 @@
   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);
