WebKit Bugzilla
Attachment 341955 Details for
Bug 186301
: [Cocoa] Update some JavaScriptCore code to be more ready for ARC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186301-20180604225254.patch (text/plain), 5.79 KB, created by
Darin Adler
on 2018-06-04 22:52:55 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2018-06-04 22:52:55 PDT
Size:
5.79 KB
patch
obsolete
>Subversion Revision: 232504 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 602a9ccdf2a59a8c5ad5d6c6a20a359ea68888e1..e799250f09fcec0cd8932aee85c8004cfec4c8a7 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,25 @@ >+2018-06-04 Darin Adler <darin@apple.com> >+ >+ [Cocoa] Update some JavaScriptCore code to be more ready for ARC >+ https://bugs.webkit.org/show_bug.cgi?id=186301 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * API/JSAPIWrapperObject.mm: >+ (JSAPIWrapperObjectHandleOwner::finalize): Use __bridge for typecast. >+ (JSC::JSAPIWrapperObject::setWrappedObject): Ditto. >+ * API/JSContext.mm: >+ (-[JSContext evaluateScript:withSourceURL:]): Ditto. >+ (-[JSContext setName:]): Ditto. >+ * inspector/remote/cocoa/RemoteInspectorCocoa.mm: >+ (Inspector::RemoteInspector::receivedProxyApplicationSetupMessage): >+ Ditto. >+ >+ * inspector/remote/cocoa/RemoteInspectorXPCConnection.mm: >+ (Inspector::RemoteInspectorXPCConnection::deserializeMessage): >+ Use CFBridgingRelease instead of autorelease for a CF dictionary that >+ we return as an NSDictionary. >+ > 2018-06-04 Keith Miller <keith_miller@apple.com> > > Remove missing files from JavaScriptCore Xcode project >diff --git a/Source/JavaScriptCore/API/JSAPIWrapperObject.mm b/Source/JavaScriptCore/API/JSAPIWrapperObject.mm >index 979ff9b9ed0af2170423ccf9452d1a9a6d0fefbd..a6b631f0bf2714082aa945d1ada3aa0fe649641d 100644 >--- a/Source/JavaScriptCore/API/JSAPIWrapperObject.mm >+++ b/Source/JavaScriptCore/API/JSAPIWrapperObject.mm >@@ -52,7 +52,7 @@ void JSAPIWrapperObjectHandleOwner::finalize(JSC::Handle<JSC::Unknown> handle, v > if (!wrapperObject->wrappedObject()) > return; > >- JSC::Heap::heap(wrapperObject)->releaseSoon(adoptNS(static_cast<id>(wrapperObject->wrappedObject()))); >+ JSC::Heap::heap(wrapperObject)->releaseSoon(adoptNS((__bridge id)wrapperObject->wrappedObject())); > JSC::WeakSet::deallocate(JSC::WeakImpl::asWeakImpl(handle.slot())); > } > >@@ -92,7 +92,7 @@ void JSAPIWrapperObject::finishCreation(VM& vm) > void JSAPIWrapperObject::setWrappedObject(void* wrappedObject) > { > ASSERT(!m_wrappedObject); >- m_wrappedObject = [static_cast<id>(wrappedObject) retain]; >+ m_wrappedObject = (__bridge id)wrappedObject; > } > > void JSAPIWrapperObject::visitChildren(JSCell* cell, JSC::SlotVisitor& visitor) >diff --git a/Source/JavaScriptCore/API/JSContext.mm b/Source/JavaScriptCore/API/JSContext.mm >index adb780138d85793ac69c4cc4bad8fb288f732139..63a4541438a215c7622cf1dca39ed28d1dce352f 100644 >--- a/Source/JavaScriptCore/API/JSContext.mm >+++ b/Source/JavaScriptCore/API/JSContext.mm >@@ -100,8 +100,8 @@ - (JSValue *)evaluateScript:(NSString *)script > - (JSValue *)evaluateScript:(NSString *)script withSourceURL:(NSURL *)sourceURL > { > JSValueRef exceptionValue = nullptr; >- JSStringRef scriptJS = JSStringCreateWithCFString((CFStringRef)script); >- JSStringRef sourceURLJS = sourceURL ? JSStringCreateWithCFString((CFStringRef)[sourceURL absoluteString]) : nullptr; >+ JSStringRef scriptJS = JSStringCreateWithCFString((__bridge CFStringRef)script); >+ JSStringRef sourceURLJS = sourceURL ? JSStringCreateWithCFString((__bridge CFStringRef)[sourceURL absoluteString]) : nullptr; > JSValueRef result = JSEvaluateScript(m_context, scriptJS, nullptr, sourceURLJS, 0, &exceptionValue); > if (sourceURLJS) > JSStringRelease(sourceURLJS); >@@ -202,7 +202,7 @@ - (NSString *)name > > - (void)setName:(NSString *)name > { >- JSStringRef nameJS = name ? JSStringCreateWithCFString((CFStringRef)[[name copy] autorelease]) : nullptr; >+ JSStringRef nameJS = name ? JSStringCreateWithCFString((__bridge CFStringRef)[name copy]) : nullptr; > JSGlobalContextSetName(m_context, nameJS); > if (nameJS) > JSStringRelease(nameJS); >diff --git a/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm b/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm >index fcaf4af225e5ec2ebbf6b59dc3bb170bddd9d093..b71691158fc38ad2121e31a2a7baa3497ec034f2 100644 >--- a/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm >+++ b/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorCocoa.mm >@@ -627,7 +627,7 @@ void RemoteInspector::receivedProxyApplicationSetupMessage(NSDictionary *) > > m_relayConnection->sendMessage(WIRProxyApplicationSetupResponseMessage, @{ > WIRProxyApplicationParentPIDKey: @(m_parentProcessIdentifier), >- WIRProxyApplicationParentAuditDataKey: (NSData *)m_parentProcessAuditData.get(), >+ WIRProxyApplicationParentAuditDataKey: (__bridge NSData *)m_parentProcessAuditData.get(), > }); > } > >diff --git a/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorXPCConnection.mm b/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorXPCConnection.mm >index cf00ba75c6be4461f0fd5617d44524c6f857952a..cea6c9c1af1e60102a12345ecf986994356b0e32 100644 >--- a/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorXPCConnection.mm >+++ b/Source/JavaScriptCore/inspector/remote/cocoa/RemoteInspectorXPCConnection.mm >@@ -142,10 +142,10 @@ NSDictionary *RemoteInspectorXPCConnection::deserializeMessage(xpc_object_t obje > return nil; > } > >- RetainPtr<CFDictionaryRef> dictionary = adoptCF((CFDictionaryRef)_CFXPCCreateCFObjectFromXPCMessage(xpcDictionary)); >+ auto dictionary = _CFXPCCreateCFObjectFromXPCMessage(xpcDictionary); > ASSERT_WITH_MESSAGE(dictionary, "Unable to deserialize xpc message"); >- ASSERT(CFGetTypeID(dictionary.get()) == CFDictionaryGetTypeID()); >- return (NSDictionary *)dictionary.autorelease(); >+ ASSERT(CFGetTypeID(dictionary) == CFDictionaryGetTypeID()); >+ return CFBridgingRelease(dictionary); > } > > void RemoteInspectorXPCConnection::handleEvent(xpc_object_t object)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186301
:
341955
|
341969
|
341970