New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 650798 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 622481



Sign in to add a comment

Prepare chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm for 10.8 deployment target.

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

Issue description

The method WriteURLToNewWebLocFileResourceFork uses a lot of Carbon/FSRef methods. Some archaeology is needed to determine the original purpose, but I think it's just trying to prepare a drag-and-drop item? This is relatively straight forward from Cocoa:
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html
 
[25238/38611] OBJCXX obj/chrome/browser/ui/ui/autocomplete_text_field_cell.o
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:574:30: warning: 'CurResFile' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  ResFileRefNum prevResRef = CurResFile();
                             ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h:178:1: note: 'CurResFile' has been explicitly marked deprecated here
CurResFile(void)                                              __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:578:3: warning: 'FSGetResourceForkName' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  FSGetResourceForkName(&resourceForkName);
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h:4056:15: note: 'FSGetResourceForkName' has been explicitly marked deprecated here
extern OSErr  FSGetResourceForkName(HFSUniStr255 * resourceForkName) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
              ^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:583:8: warning: 'CFURLGetFSRef' is deprecated: first deprecated in macOS 10.9 [-Wdeprecated-declarations]
  if (!CFURLGetFSRef((CFURLRef)file, &fsRef))
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:475:9: note: 'CFURLGetFSRef' has been explicitly marked deprecated here
Boolean CFURLGetFSRef(CFURLRef url, struct FSRef *fsRef) CF_DEPRECATED(10_0, 10_9, 2_0, 7_0);
        ^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:586:9: warning: 'FSCreateResourceFork' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  err = FSCreateResourceFork(&fsRef,
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h:1098:1: note: 'FSCreateResourceFork' has been explicitly marked deprecated here
FSCreateResourceFork(
^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:592:9: warning: 'FSOpenResourceFile' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  err = FSOpenResourceFile(&fsRef,
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h:1142:1: note: 'FSOpenResourceFile' has been explicitly marked deprecated here
FSOpenResourceFile(
^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:602:22: warning: 'NewHandle' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  Handle urlHandle = NewHandle(urlChars);
                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h:451:1: note: 'NewHandle' has been explicitly marked deprecated here
NewHandle(Size byteCount)                                     __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:605:23: warning: 'NewHandle' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  Handle textHandle = NewHandle(urlChars);
                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h:451:1: note: 'NewHandle' has been explicitly marked deprecated here
NewHandle(Size byteCount)                                     __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:620:23: warning: 'NewHandleClear' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  Handle dragHandle = NewHandleClear(sizeof(dragData));
                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h:493:1: note: 'NewHandleClear' has been explicitly marked deprecated here
NewHandleClear(Size byteCount)                                __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:625:3: warning: 'AddResource' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  AddResource(dragHandle, 'drag', 128, noName);
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h:564:1: note: 'AddResource' has been explicitly marked deprecated here
AddResource(
^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:626:3: warning: 'AddResource' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  AddResource(textHandle, 'TEXT', 256, noName);
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h:564:1: note: 'AddResource' has been explicitly marked deprecated here
AddResource(
^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:627:3: warning: 'AddResource' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  AddResource(urlHandle, 'url ', 256, noName);
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h:564:1: note: 'AddResource' has been explicitly marked deprecated here
AddResource(
^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:629:3: warning: 'CloseResFile' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  CloseResFile(refNum);
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h:148:1: note: 'CloseResFile' has been explicitly marked deprecated here
CloseResFile(ResFileRefNum refNum)                            __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
^
../../chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm:630:3: warning: 'UseResFile' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
  UseResFile(prevResRef);
  ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h:208:1: note: 'UseResFile' has been explicitly marked deprecated here
UseResFile(ResFileRefNum refNum)                              __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
^
13 warnings generated.

Owner: spqc...@chromium.org
Status: Assigned (was: Untriaged)

Comment 3 by rsesek@chromium.org, Sep 29 2016

We also deal with webloc files using third_party/mozilla ( issue 650805 ).
Status: Started (was: Assigned)
The purpose of this method is to create a webloc file so that we can drag and drop the URLs into the Dock: https://bugs.chromium.org/p/chromium/issues/detail?id=42613

I tried removing the webloc file and sticking with just drag-and-drop, but the dock won't accept it. I'm going to experiment and see if there's another way
Looks like directly writing to the plist for the webloc file works
Project Member

Comment 6 by bugdroid1@chromium.org, Oct 7 2016

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

commit e4ec3055dbc64a64eec023566493970ba010c57f
Author: spqchan <spqchan@chromium.org>
Date: Fri Oct 07 16:59:16 2016

[Mac] Updating AutocompleteTextFieldCell to 10.8

Opening and writing to the resource forks are deprecated on macOS.
As a result, its usage should be removed.

BUG= 650798 

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

[modify] https://crrev.com/e4ec3055dbc64a64eec023566493970ba010c57f/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm

Status: Fixed (was: Started)

Sign in to add a comment