New issue
Advanced search Search tips

Issue 650796 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug

Blocking:
issue 622481



Sign in to add a comment

Prepare chrome/browser/mac/install_from_dmg.mm for 10.8 deployment target.

Project Member Reported by erikc...@chromium.org, Sep 27 2016

Issue description

FSPathMoveObjectToTrashSync and FNNotifyByPath are deprecated. We should be able to replace these with NSWorkspace methods.

See http://stackoverflow.com/a/2854564 and -[NSWorkspace noteFileSystemChanged:].
 
Given the importance of the dmg installer, this will need to be carefully tested.
[23279/38611] OBJCXX obj/chrome/browser/browser/install_from_dmg.o
../../chrome/browser/mac/install_from_dmg.mm:683:21: warning: 'FSPathMoveObjectToTrashSync' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  OSStatus status = FSPathMoveObjectToTrashSync(disk_image_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:6037:18: note: 'FSPathMoveObjectToTrashSync' has been explicitly marked deprecated here
extern OSStatus  FSPathMoveObjectToTrashSync(const char *sourcePath, char **targetPath, OptionBits options) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
                 ^
../../chrome/browser/mac/install_from_dmg.mm:701:12: warning: 'FNNotifyByPath' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  status = FNNotifyByPath(trash_path_u8,
           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:4267:18: note: 'FNNotifyByPath' has been explicitly marked deprecated here
extern OSStatus  FNNotifyByPath(const UInt8 *path, FNMessage message, OptionBits flags)         __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
                 ^
2 warnings generated.

Owner: patricia...@chromium.org
Status: Started (was: Untriaged)
Untested CL: https://codereview.chromium.org/2393793002/

Will look into testing this within the next few days.
Components: Internals>Installer
Labels: OS-Mac
Full testing instructions in case test instructions from https://chromium.googlesource.com/chromium/src/+/e01d28171595bd723e6fd9846a7783c037d882f1 weren't enough:

1. If testing local build, make a static build - make sure is_component_build = false in gn args. Otherwise go to step 2.
2. Put the resulting .app file into its own folder.
3. With Disk Utility, go to File > New Image > Image From Folder and select the folder where you put the .app.
4. Open your Trash folder, empty it. Reopen to make sure you can see it while you're doing step 4.
5. Mount the resulting .dmg file from step 2 and open the .app file inside. (Make sure you don't have Chrome/Chromium/Canary, whichever the equivalent of what you are opening, installed already!) It should come up with a dialog saying 'Do you want to install ...?'
6. Click install. Chrome should open and you should see the Trash folder has the .dmg you created in step 2 inside now. Check the trash icon on the dock is now full (i.e. the icon updated to reflect that there are now things inside the Trash).
7. Optional - don't forget to uninstall.
Project Member

Comment 5 by bugdroid1@chromium.org, Oct 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/680f9d60ee6c44ef2677d869860017c2350fab63

commit 680f9d60ee6c44ef2677d869860017c2350fab63
Author: patricialor <patricialor@chromium.org>
Date: Sun Oct 09 23:08:03 2016

Mac: Port deprecated methods to 10.8+ alternatives in install_from_dmg.mm.

FSPathMoveObjectToTrashSync and FNNotifyByPath are deprecated. Replace the
former with an equivalent NSFileManager trashItemAtURL:: call, which doesn't
have the problem of not notifying the trash can to update its icon (if
previously) empty. This means there is no need to call FNNotifyByPath to update
the icon manually, so delete it.

BUG= 650796 

Review-Url: https://codereview.chromium.org/2393793002
Cr-Commit-Position: refs/heads/master@{#424109}

[modify] https://crrev.com/680f9d60ee6c44ef2677d869860017c2350fab63/base/mac/sdk_forward_declarations.h
[modify] https://crrev.com/680f9d60ee6c44ef2677d869860017c2350fab63/chrome/browser/mac/install_from_dmg.mm

Status: Fixed (was: Started)

Sign in to add a comment