| Index: content/browser/accessibility/browser_accessibility_cocoa.mm
|
| diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
| index f0d696d97b18e355b41e42b15f5a19d65f944754..2698d30c785d5b46b8259a9346cfe8147a84e49c 100644
|
| --- a/content/browser/accessibility/browser_accessibility_cocoa.mm
|
| +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
|
| @@ -140,25 +140,24 @@ AXTextMarkerRef AXTextMarkerRangeCopyEndMarker(
|
|
|
| } // extern "C"
|
|
|
| -// to call |release| on it to transfer ownership of the position to the text
|
| -// marker object.
|
| +// AXTextMarkerCreate copies from data buffer given to it.
|
| id CreateTextMarker(AXPlatformPositionInstance position) {
|
| AXTextMarkerRef text_marker = AXTextMarkerCreate(
|
| - kCFAllocatorDefault, reinterpret_cast<const UInt8*>(position.release()),
|
| + kCFAllocatorDefault, reinterpret_cast<const UInt8*>(position.get()),
|
| sizeof(AXPlatformPosition));
|
| return static_cast<id>(
|
| base::mac::CFTypeRefToNSObjectAutorelease(text_marker));
|
| }
|
|
|
| -// |range| is destructed at the end of this method and ownership of its |anchor|
|
| -// and |focus| are transfered to the marker range object.
|
| +// |range| is destructed at the end of this method. |anchor| and |focus| are
|
| +// copied into the individual text markers.
|
| id CreateTextMarkerRange(const AXPlatformRange range) {
|
| - AXTextMarkerRef start_marker = AXTextMarkerCreate(
|
| + base::ScopedCFTypeRef<AXTextMarkerRef> start_marker(AXTextMarkerCreate(
|
| kCFAllocatorDefault, reinterpret_cast<const UInt8*>(range.anchor()),
|
| - sizeof(AXPlatformPosition));
|
| - AXTextMarkerRef end_marker = AXTextMarkerCreate(
|
| + sizeof(AXPlatformPosition)));
|
| + base::ScopedCFTypeRef<AXTextMarkerRef> end_marker(AXTextMarkerCreate(
|
| kCFAllocatorDefault, reinterpret_cast<const UInt8*>(range.focus()),
|
| - sizeof(AXPlatformPosition));
|
| + sizeof(AXPlatformPosition)));
|
| AXTextMarkerRangeRef marker_range =
|
| AXTextMarkerRangeCreate(kCFAllocatorDefault, start_marker, end_marker);
|
| return static_cast<id>(
|
|
|