This would make managing JSManagedValue lifetime much easier.
Created attachment 216414 [details] Patch
(In reply to comment #1) > Created an attachment (id=216414) [details] > Patch Still needs API approval and availability macros.
<rdar://problem/15409543>
Comment on attachment 216414 [details] Patch What will this do to clients that already do the work to avoid the leak? Are they all using the existing api?
Comment on attachment 216414 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=216414&action=review r=me, pending those things. > Source/JavaScriptCore/API/JSManagedValue.h:58 > ++ (JSManagedValue *)managedValueWithValue:(JSValue *)value andOwner:(id)owner; It looks like the canonical ObjC API idiom is to leave off "and". For example, -[NSString – initWithBytes:length:encoding:].
(In reply to comment #4) > (From update of attachment 216414 [details]) > What will this do to clients that already do the work to avoid the leak? Are they all using the existing api? It will work correctly. Calling -removeManagedReference:withOwner: will remove the owner from the JSManagedValue's m_owners so when it is dealloc-ed it won't be called again.
Can you post a new patch with availability macros added?
(In reply to comment #7) > Can you post a new patch with availability macros added? I'm still not sure what macros to use. NS_AVAILABLE and friends will break the open source bots. Should I add a new WebKit availability macro for the current WebKit version using the new versioning scheme (e.g. 0x2100500 == 528.5.0) in JavaScriptCore/API/WebKitAvailability.h?
Created attachment 223353 [details] Patch
Attachment 223353 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:37: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:41: Missing spaces around = [whitespace/operators] [4] Total errors found: 2 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 223356 [details] Patch
Attachment 223356 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:38: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:42: Missing spaces around = [whitespace/operators] [4] Total errors found: 2 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 223368 [details] Patch
Attachment 223368 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:49: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:53: Missing spaces around = [whitespace/operators] [4] Total errors found: 2 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 223373 [details] Patch
Attachment 223373 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:49: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:53: Missing spaces around = [whitespace/operators] [4] Total errors found: 2 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 223382 [details] Patch
Attachment 223382 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:49: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:53: Missing spaces around = [whitespace/operators] [4] Total errors found: 2 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 223384 [details] Patch
Attachment 223384 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:49: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/API/WebKitAvailability.h:53: Missing spaces around = [whitespace/operators] [4] ERROR: Source/JavaScriptCore/API/JSManagedValue.h:74: Missing space after , [whitespace/comma] [3] ERROR: Source/JavaScriptCore/API/JSManagedValue.h:76: Missing space after , [whitespace/comma] [3] Total errors found: 4 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 223384 [details] Patch r=me
Comment on attachment 223384 [details] Patch Clearing flags on attachment: 223384 Committed r163574: <http://trac.webkit.org/changeset/163574>
All reviewed patches have been landed. Closing bug.