Changeset 173141 in webkit for trunk/Source/JavaScriptCore/API


Ignore:
Timestamp:
Aug 30, 2014, 3:43:33 PM (11 years ago)
Author:
[email protected]
Message:

Use RetainPtr::autorelease in some places where it seems appropriate
https://bugs.webkit.org/show_bug.cgi?id=136280

Reviewed by Darin Adler.

Source/JavaScriptCore:

  • API/JSContext.mm:

(-[JSContext name]): Use RetainPtr::autorelease() in place of ObjC autorelease.

  • API/JSValue.mm:

(valueToString): Make appropriate use of RetainPtr

Source/WebCore:

  • platform/mac/URLMac.mm:

(WebCore::URL::operator NSURL *): Use autorelease() instead of
CFBridgingRelease(leakRef())

Source/WebKit/mac:

  • WebView/WebHTMLView.mm:

(imageFromRect): Use RetainPtr in this function.

  • WebView/WebPDFRepresentation.mm:

(-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Use RetainPtr
in this method.

Source/WebKit2:

  • Shared/Cocoa/WKNSURLExtras.mm:

(urlWithWTFString): Use autorelease() instead of CFBridgingRelease(leakRef())

Source/WTF:

  • wtf/text/mac/StringImplMac.mm:

(WTF::StringImpl::operator NSString *): Use autorelease() instead of
CFBridgingRelease(leakRef())

Location:
trunk/Source/JavaScriptCore/API
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSContext.mm

    r170589 r173141  
    193193        return nil;
    194194
    195     return [(NSString *)JSStringCopyCFString(kCFAllocatorDefault, name) autorelease];
     195    return (NSString *)adoptCF(JSStringCopyCFString(kCFAllocatorDefault, name)).autorelease();
    196196}
    197197
  • trunk/Source/JavaScriptCore/API/JSValue.mm

    r165074 r173141  
    768768    }
    769769
    770     NSString *stringNS = CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, jsstring));
     770    RetainPtr<CFStringRef> stringCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, jsstring));
    771771    JSStringRelease(jsstring);
    772     return stringNS;
     772    return (NSString *)stringCF.autorelease();
    773773}
    774774
Note: See TracChangeset for help on using the changeset viewer.