Prepare base/mac/mac_util.mm for 10.9 deployment target. |
|||||||||
Issue description
[65/38613] OBJCXX obj/base/base/mac_util.o
../../base/mac/mac_util.mm:127:7: warning: 'CFURLCreateFromFSRef' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
CFURLCreateFromFSRef(kCFAllocatorDefault, &ref));
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:472:10: note: 'CFURLCreateFromFSRef' has been explicitly marked deprecated here
CFURLRef CFURLCreateFromFSRef(CFAllocatorRef allocator, const struct FSRef *fsRef) CF_DEPRECATED(10_0, 10_9, 2_0, 7_0);
^
../../base/mac/mac_util.mm:133:21: warning: 'FSPathMakeRef' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
OSStatus status = FSPathMakeRef((const UInt8*)path.c_str(),
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:4115:18: note: 'FSPathMakeRef' has been explicitly marked deprecated here
extern OSStatus FSPathMakeRef(const UInt8 *path, FSRef *ref, Boolean *isDirectory) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
^
../../base/mac/mac_util.mm:223:15: warning: 'GetFrontProcess' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
OSErr err = GetFrontProcess(&foreground_psn);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h:434:1: note: 'GetFrontProcess' has been explicitly marked deprecated here
GetFrontProcess(ProcessSerialNumber * PSN) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_9;
^
../../base/mac/mac_util.mm:232:9: warning: 'SameProcess' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
err = SameProcess(&foreground_psn, &my_psn, &result);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h:696:1: note: 'SameProcess' has been explicitly marked deprecated here
SameProcess(
^
../../base/mac/mac_util.mm:332:7: warning: 'GetProcessInformation' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
if (GetProcessInformation(&psn, &info) == noErr) {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h:513:1: note: 'GetProcessInformation' has been explicitly marked deprecated here
GetProcessInformation(
^
../../base/mac/mac_util.mm:335:9: warning: 'GetProcessInformation' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
if (GetProcessInformation(&info.processLauncher, &parent_info) == noErr)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h:513:1: note: 'GetProcessInformation' has been explicitly marked deprecated here
GetProcessInformation(
^
6 warnings generated.
,
Oct 4 2016
base::mac::PathFromFSRef is used by service_process_util_mac.mm ( crbug.com/650801 )
,
Oct 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87 commit 7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87 Author: eugenebut <eugenebut@chromium.org> Date: Thu Oct 06 01:55:41 2016 [Mac Fix-It] Changed OpenApplicationWithPath to use NSWorkspace. This removes base::mac::FSRefFromPath usage from OpenApplicationWithPath. |FSRefFromPath| is relying on deprecated API and should be removed. BUG= 650854 Review-Url: https://codereview.chromium.org/2390953003 Cr-Commit-Position: refs/heads/master@{#423391} [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/base/BUILD.gn [delete] https://crrev.com/cfc0f2180153b6815c797d672ac9a8705a93e747/base/mac/launch_services_util.cc [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/base/mac/launch_services_util.h [add] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/base/mac/launch_services_util.mm [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/chrome/app_shim/app_mode_loader_mac.mm [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/chrome/app_shim/chrome_main_app_mode_mac.mm [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/chrome/browser/web_applications/web_app_mac.mm
,
Oct 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1cc274c36c784591ed4a0fcd6dab7465e033c823 commit 1cc274c36c784591ed4a0fcd6dab7465e033c823 Author: eugenebut <eugenebut@chromium.org> Date: Thu Oct 06 04:02:20 2016 [Mac Fix-It] removed base::mac::AmIForeground function. Use [[NSRunningApplication currentApplication] isActive] call instead. BUG= 650854 Review-Url: https://codereview.chromium.org/2394733002 Cr-Commit-Position: refs/heads/master@{#423425} [modify] https://crrev.com/1cc274c36c784591ed4a0fcd6dab7465e033c823/base/mac/mac_util.h [modify] https://crrev.com/1cc274c36c784591ed4a0fcd6dab7465e033c823/base/mac/mac_util.mm [modify] https://crrev.com/1cc274c36c784591ed4a0fcd6dab7465e033c823/chrome/browser/mac/relauncher.mm
,
Oct 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1cc274c36c784591ed4a0fcd6dab7465e033c823 commit 1cc274c36c784591ed4a0fcd6dab7465e033c823 Author: eugenebut <eugenebut@chromium.org> Date: Thu Oct 06 04:02:20 2016 [Mac Fix-It] removed base::mac::AmIForeground function. Use [[NSRunningApplication currentApplication] isActive] call instead. BUG= 650854 Review-Url: https://codereview.chromium.org/2394733002 Cr-Commit-Position: refs/heads/master@{#423425} [modify] https://crrev.com/1cc274c36c784591ed4a0fcd6dab7465e033c823/base/mac/mac_util.h [modify] https://crrev.com/1cc274c36c784591ed4a0fcd6dab7465e033c823/base/mac/mac_util.mm [modify] https://crrev.com/1cc274c36c784591ed4a0fcd6dab7465e033c823/chrome/browser/mac/relauncher.mm
,
Oct 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fe109cbea3a8e708609bfc16673684f274f18a6d commit fe109cbea3a8e708609bfc16673684f274f18a6d Author: eugenebut <eugenebut@chromium.org> Date: Thu Oct 06 22:44:26 2016 [mac] Use -[NSApp isActive] for checking if current app is active. Use short version in RelaunchAppWithHelper() instead of [[NSRunningApplication currentApplication] isActive] BUG= 650854 Review-Url: https://codereview.chromium.org/2398943002 Cr-Commit-Position: refs/heads/master@{#423716} [modify] https://crrev.com/fe109cbea3a8e708609bfc16673684f274f18a6d/chrome/browser/mac/relauncher.mm
,
Oct 7 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2f7ce1d11fd3b346468569389e8cc97f97453377 commit 2f7ce1d11fd3b346468569389e8cc97f97453377 Author: eugenebut <eugenebut@chromium.org> Date: Fri Oct 07 01:04:56 2016 [Mac Fix-It] Use FSPathMakeRef instead of base::mac::FSRefFromPath. base::mac::FSRefFromPath will be removed as it is relied on deprecated API. The only place where FSPathMakeRef needed is QuarantinePropertiesDeprecated API. So instead of having shared base::mac::FSRefFromPath function which depends on deprecated API it is better to use FSPathMakeRef right in place where it's needed as it will be easier to clean up that code later. BUG= 650854 Review-Url: https://codereview.chromium.org/2389123002 Cr-Commit-Position: refs/heads/master@{#423769} [modify] https://crrev.com/2f7ce1d11fd3b346468569389e8cc97f97453377/content/browser/download/quarantine_mac.mm
,
Oct 11 2016
Was closed by mistake
,
Oct 11 2016
Removing GetProcessInformation from WasLaunchedAsLoginOrResumeItem is problematic. Modern API for checking if the app launch is a login launch relies on NSApplicationDidFinishLaunchingNotification, which is called much later than GetProcessInformation.
,
Oct 12 2016
NSApplicationDidFinishLaunchingNotification is not exactly a drop in replacement for GetProcessInformation. NSApplicationDidFinishLaunchingNotification only allows to tell if the app was launched as a part of Lion App Restoration flow. It does not allow to tell if the app was launched as Login item. Also when app was launched via Lion App Restoration flow one of command line arguments is -psn_0_32776. And this number is always the same, so maybe we can check for this argument instead of using GetProcessInformation or NSApplicationDidFinishLaunchingNotification. Another thing I'm going to look at is Apple Events received during the launch.
,
Oct 12 2016
AppKit relies on a private (NSPersistentUIManager) class to tell if the app is launched via Lion App Restoration flow. So the fact that app is going to restore the state is known as early as when WasLaunchedAsLoginOrResumeItem is called. However there is no reliable way to get this information. Will try exploring alternative approaches (f.e. inspecting parent process information, which could be one of macOS services).
,
Oct 13 2016
Autolaunched app does not have a parent process. ProcessInfoRec.processLauncher points to a launcher process. This launcher process has distinct NSRunningApplication.bundleIdentifier which could be used to identify Lion App Restoration flow, but I could not find a way to get launcher process ID with modern API. I will be switching back to iOS work and unassigning this bug.
,
Oct 14 2016
,
Oct 18 2016
+ mark, rsesek: If you have any ideas, please speak up. Otherwise I'm going to suppress this deprecated declaration warning. Note that this discussion pertains to c#11. I spent some time looking into this and came to the same conclusion as eugenebut. I couldn't find any non-deprecated APIs that would provide this same information as GetProcessInformation. Note that the replacement API NSRunningApplication doesn't return any information about non-user processes.
,
Oct 18 2016
Suppressing the warning for GetProcessInformation() sounds OK given the results of the exhaustive investigation. Special thanks to Eugene.
,
Oct 21 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/98b75a2586d9ad1b051708df2572fcdbc0dcd7da commit 98b75a2586d9ad1b051708df2572fcdbc0dcd7da Author: erikchen <erikchen@chromium.org> Date: Fri Oct 21 04:14:55 2016 Suppress a declarated-declaration warning for GetProcessInformation. There's no replacement method that does what we need. See bug for more details. BUG= 650854 Review-Url: https://chromiumcodereview.appspot.com/2433773008 Cr-Commit-Position: refs/heads/master@{#426726} [modify] https://crrev.com/98b75a2586d9ad1b051708df2572fcdbc0dcd7da/base/mac/mac_util.mm
,
Oct 21 2016
,
Oct 27 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87 commit 7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87 Author: eugenebut <eugenebut@chromium.org> Date: Thu Oct 06 01:55:41 2016 [Mac Fix-It] Changed OpenApplicationWithPath to use NSWorkspace. This removes base::mac::FSRefFromPath usage from OpenApplicationWithPath. |FSRefFromPath| is relying on deprecated API and should be removed. BUG= 650854 Review-Url: https://codereview.chromium.org/2390953003 Cr-Commit-Position: refs/heads/master@{#423391} [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/base/BUILD.gn [delete] https://crrev.com/cfc0f2180153b6815c797d672ac9a8705a93e747/base/mac/launch_services_util.cc [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/base/mac/launch_services_util.h [add] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/base/mac/launch_services_util.mm [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/chrome/app_shim/app_mode_loader_mac.mm [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/chrome/app_shim/chrome_main_app_mode_mac.mm [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm [modify] https://crrev.com/7eb9c14b4f3c992d2d66f4b6f56e8a42671abd87/chrome/browser/web_applications/web_app_mac.mm
,
Oct 27 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1cc274c36c784591ed4a0fcd6dab7465e033c823 commit 1cc274c36c784591ed4a0fcd6dab7465e033c823 Author: eugenebut <eugenebut@chromium.org> Date: Thu Oct 06 04:02:20 2016 [Mac Fix-It] removed base::mac::AmIForeground function. Use [[NSRunningApplication currentApplication] isActive] call instead. BUG= 650854 Review-Url: https://codereview.chromium.org/2394733002 Cr-Commit-Position: refs/heads/master@{#423425} [modify] https://crrev.com/1cc274c36c784591ed4a0fcd6dab7465e033c823/base/mac/mac_util.h [modify] https://crrev.com/1cc274c36c784591ed4a0fcd6dab7465e033c823/base/mac/mac_util.mm [modify] https://crrev.com/1cc274c36c784591ed4a0fcd6dab7465e033c823/chrome/browser/mac/relauncher.mm
,
Oct 27 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fe109cbea3a8e708609bfc16673684f274f18a6d commit fe109cbea3a8e708609bfc16673684f274f18a6d Author: eugenebut <eugenebut@chromium.org> Date: Thu Oct 06 22:44:26 2016 [mac] Use -[NSApp isActive] for checking if current app is active. Use short version in RelaunchAppWithHelper() instead of [[NSRunningApplication currentApplication] isActive] BUG= 650854 Review-Url: https://codereview.chromium.org/2398943002 Cr-Commit-Position: refs/heads/master@{#423716} [modify] https://crrev.com/fe109cbea3a8e708609bfc16673684f274f18a6d/chrome/browser/mac/relauncher.mm
,
Nov 4 2016
[Automated comment] removing mislabelled merge-merged-2840 |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by eugene...@chromium.org
, Oct 4 2016Owner: eugene...@chromium.org
Status: Assigned (was: Untriaged)