<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[236032] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/236032">236032</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2018-09-15 09:17:24 -0700 (Sat, 15 Sep 2018)</dd>
</dl>

<h3>Log Message</h3>
<pre>Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
https://bugs.webkit.org/show_bug.cgi?id=189455

Reviewed by Keith Miller.

Source/JavaScriptCore:

* API/JSObjectRef.cpp:
(OpaqueJSPropertyNameArray): Use Ref<OpaqueJSString> instead of
JSRetainPtr<JSStringRef>.
(JSObjectCopyPropertyNames): Remove now-unneeded use of leakRef and
adopt constructor.
(JSPropertyNameArrayGetNameAtIndex): Use ptr() instead of get() since
the array elements are now Ref.

* API/JSRetainPtr.h: While JSRetainPtr is written as a template,
it only works for two specific unrelated types, JSStringRef and
JSGlobalContextRef. Simplified the default constructor using data
member initialization. Prepared to make the adopt constructor private
(got everything compiling that way, then made it public again so that
Apple internal software will still build). Got rid of unneeded
templated constructor and assignment operator, since it's not relevant
since there is no inheritance between JSRetainPtr template types.
Added WARN_UNUSED_RETURN to leakRef as in RefPtr and RetainPtr.
Added move constructor and move assignment operator for slightly better
performance. Simplified implementations of various member functions
so they are more obviously correct, by using leakPtr in more of them
and using std::exchange to make the flow of values more obvious.

* API/JSValue.mm:
(+[JSValue valueWithNewSymbolFromDescription:inContext:]): Added a
missing JSStringRelease to fix a leak.

* API/tests/CustomGlobalObjectClassTest.c:
(customGlobalObjectClassTest): Added a JSGlobalContextRelease to fix a leak.
(globalObjectSetPrototypeTest): Ditto.
(globalObjectPrivatePropertyTest): Ditto.

* API/tests/ExecutionTimeLimitTest.cpp:
(testResetAfterTimeout): Added a call to JSStringRelease to fix a leak.
(testExecutionTimeLimit): Ditto, lots more.

* API/tests/FunctionOverridesTest.cpp:
(testFunctionOverrides): Added a call to JSStringRelease to fix a leak.

* API/tests/JSObjectGetProxyTargetTest.cpp:
(testJSObjectGetProxyTarget): Added a call to JSGlobalContextRelease to fix
a leak.

* API/tests/PingPongStackOverflowTest.cpp:
(testPingPongStackOverflow): Added calls to JSGlobalContextRelease and
JSStringRelease to fix leaks.

* API/tests/testapi.c:
(throwException): Added. Helper function for repeated idiom where we want
to throw an exception, but with additional JSStringRelease calls so we don't
have to leak just to keep the code simpler to read.
(MyObject_getProperty): Use throwException.
(MyObject_setProperty): Ditto.
(MyObject_deleteProperty): Ditto.
(isValueEqualToString): Added. Helper function for an idiom where we check
if something is a string and then if it's equal to a particular string
constant, but a version that has an additional JSStringRelease call so we
don't have to leak just to keep the code simpler to read.
(MyObject_callAsFunction): Use isValueEqualToString and throwException.
(MyObject_callAsConstructor): Ditto.
(MyObject_hasInstance): Ditto.
(globalContextNameTest): Added a JSGlobalContextRelease to fix a leak.
(testMarkingConstraintsAndHeapFinalizers): Ditto.

Source/WebCore:

* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::jsValueWithDictionaryInContext): Adding a missing
JSStringRelease to fix a leak.

Source/WebKit:

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::toJSString): Use adopt function instead of adopt construuctor.
(WebKit::evaluate): Ditto.
(WebKit::evaluateJavaScriptCallback): Ditto.
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Ditto.

Tools:

There is a lot of copied and pasted code for WebKit vs. Legacy WebKit
testing and even for macOS vs. iOS vs. Windows platform-specific code.
For now, this patch just makes corresponding changes to the copied code.
Later we might get better results by merging more code instead of having
all these separate copies.

* DumpRenderTree/AccessibilityController.cpp:
(AccessibilityController::makeWindowObject): Use the adopt function
instead of the special Adopt constructor of JSRetainPtr.

* DumpRenderTree/AccessibilityTextMarker.cpp: Removed unneeded include.

* DumpRenderTree/AccessibilityUIElement.cpp: Ditto.
(allAttributesCallback): Don't adopt at this level; changed the
underlying function to return a JSRetainPtr so the adopt is right next
to the call to the create or copy function.
(attributesOfLinkedUIElementsCallback): Ditto.
(attributesOfDocumentLinksCallback): Ditto.
(attributesOfChildrenCallback): Ditto.
(parameterizedAttributeNamesCallback): Ditto.
(attributesOfColumnHeadersCallback): Ditto.
(attributesOfRowHeadersCallback): Ditto.
(attributesOfColumnsCallback): Ditto.
(attributesOfRowsCallback): Ditto.
(attributesOfVisibleCellsCallback): Ditto.
(attributesOfHeaderCallback): Ditto.
(rowIndexRangeCallback): Ditto.
(columnIndexRangeCallback): Ditto.
(rangeForLineCallback): Ditto.
(boundsForRangeCallback): Ditto.
(rangeForPositionCallback): Ditto.
(stringForRangeCallback): Ditto.
(attributedStringForRangeCallback): Ditto.
(uiElementCountForSearchPredicateCallback): Use the free adopt
function instead of the adopt member function.
(uiElementForSearchPredicateCallback): Ditto.
(selectTextWithCriteriaCallback): Don't adopt at this level.
(attributedStringForElementCallback): Ditto.
(setValueCallback): Use free adopt.
(stringAttributeValueCallback): Don't adopt at this level.
(uiElementArrayAttributeValueCallback): Ditto.
(uiElementAttributeValueCallback): Ditto.
(stringForTextMarkerRangeCallback): Ditto.
(attributedStringForTextMarkerRangeCallback): Ditto.
(attributedStringForTextMarkerRangeWithOptionsCallback): Ditto.
(getARIADropEffectsCallback): Ditto.
(getClassListCallback): Ditto.
(getRoleCallback): Ditto.
(getSubroleCallback): Ditto.
(getRoleDescriptionCallback): Ditto.
(getComputedRoleStringCallback): Ditto.
(getTitleCallback): Ditto.
(getDescriptionCallback): Ditto.
(getStringValueCallback): Ditto.
(getLanguageCallback): Ditto.
(getHelpTextCallback): Ditto.
(getOrientationCallback): Ditto.
(getPathDescriptionCallback): Ditto.
(getSelectedTextRangeCallback): Ditto.
(speakAsCallback): Ditto.
(getValueDescriptionCallback): Ditto.
(getAccessibilityValueCallback): Ditto.
(getDocumentEncodingCallback): Ditto.
(getDocumentURICallback): Ditto.
(getURLCallback): Ditto.
(characterAtOffsetCallback): Ditto.
(wordAtOffsetCallback): Ditto.
(lineAtOffsetCallback): Ditto.
(sentenceAtOffsetCallback): Ditto.
(stringForSelectionCallback): Ditto.
(getIdentifierCallback): Ditto.
(getTraitsCallback): Ditto.
(supportedActionsCallback): Ditto.
(mathPostscriptsDescriptionCallback): Ditto.
(mathPrescriptsDescriptionCallback): Ditto.
(AccessibilityUIElement::rangeForLine): Updated to return JSRetainPtr.
(AccessibilityUIElement::rangeForPosition): Ditto.
(AccessibilityUIElement::speakAs): Ditto.
(AccessibilityUIElement::pathDescription const): Ditto.
(AccessibilityUIElement::stringForTextMarkerRange): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.

* DumpRenderTree/AccessibilityUIElement.h: Use JSRetainPtr instead of
raw pointers for the results of the functions that create strings.
The old way was difficult to get right; the functions didn't even follow
the create/copy naming rule.

* DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
(_platformTypeConstructor): Use the adopt function instead of the
JSRetainPtr adopt constructor. Also nullptr instead of 0.

* DumpRenderTree/GCController.cpp:
(GCController::makeWindowObject): Use adopt function instead of constructor.

* DumpRenderTree/TestRunner.cpp:
(pathToLocalResourceCallback): Use adopt function instead of constructor.
(addDisallowedURLCallback): Ditto.
(addURLToRedirectCallback): Ditto.
(clearApplicationCacheForOriginCallback): Ditto.
(applicationCacheDiskUsageForOriginCallback): Ditto.
(decodeHostNameCallback): Don't adopt at this level.
(encodeHostNameCallback): Ditto.
(execCommandCallback): Use adopt instead of JSRetainPtr::adopt.
(findStringCallback): Use adopt function instead of constructor.
(isCommandEnabledCallback): Ditto.
(overridePreferenceCallback): Ditto.
(queueLoadCallback): Ditto.
(queueLoadHTMLStringCallback): Ditto.
(queueLoadingScriptCallback): Ditto.
(queueNonLoadingScriptCallback): Ditto.
(setAuthenticationPasswordCallback): Ditto.
(setAuthenticationUsernameCallback): Ditto.
(setDomainRelaxationForbiddenForURLSchemeCallback): Ditto.
(setMockGeolocationPositionUnavailableErrorCallback): Ditto.
(setPOSIXLocaleCallback): Ditto.
(setPersistentUserStyleSheetLocationCallback): Ditto.
(setUserStyleSheetLocationCallback): Ditto.
(setValueForUserCallback): Ditto.
(setWillSendRequestClearHeaderCallback): Ditto.
(setPageVisibilityCallback): Ditto.
(evaluateInWebInspectorCallback): Ditto.
(evaluateScriptInIsolatedWorldCallback): Ditto.
(evaluateScriptInIsolatedWorldAndReturnValueCallback): Ditto.
(addOriginAccessWhitelistEntryCallback): Ditto.
(removeOriginAccessWhitelistEntryCallback): Ditto.
(setScrollbarPolicyCallback): Ditto.
(addUserScriptCallback): Ditto.
(addUserStyleSheetCallback): Ditto.
(apiTestNewWindowDataLoadBaseURLCallback): Ditto.
(authenticateSessionCallback): Ditto.
(getTitleTextDirectionCallback): Ditto.
(getInspectorTestStubURLCallback): Ditto.
(simulateLegacyWebNotificationClickCallback): Ditto.
(setTextDirectionCallback): Ditto.
(grantWebNotificationPermissionCallback): Ditto.
(denyWebNotificationPermissionCallback): Ditto.
(accummulateLogsForChannel): Ditto.
(runUIScriptCallback): Ditto.
(TestRunner::makeWindowObject): Ditto.
(TestRunner::uiScriptDidComplete): Ditto.
(TestRunner::setOpenPanelFiles): Ditto.

* DumpRenderTree/TestRunner.h: Use JSRetainPtr instead of
raw pointers for the results of the functions that create strings.

* DumpRenderTree/ios/AccessibilityControllerIOS.mm:
(AccessibilityController::platformName const): Use the adopt
function instead of the adopt constructor.

* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(createEmptyJSString): Added. This helper function makes reduces the
repetitive code to create empty strings.
(concatenateAttributeAndValue): Changed to return a JSRetainPtr.
(AccessibilityUIElement::identifier): Ditto.
(AccessibilityUIElement::traits): Ditto.
(AccessibilityUIElement::url): Ditto.
(AccessibilityUIElement::speakAs): Ditto.
(AccessibilityUIElement::stringForSelection): Ditto.
(AccessibilityUIElement::stringForRange): Ditto.
(AccessibilityUIElement::attributedStringForRange): Ditto.
(AccessibilityUIElement::attributedStringForElement): Ditto.
(AccessibilityUIElement::pathDescription const): Ditto.
(AccessibilityUIElement::stringForTextMarkerRange): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
(AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
(AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
(AccessibilityUIElement::attributesOfChildren): Ditto.
(AccessibilityUIElement::allAttributes): Ditto.
(AccessibilityUIElement::stringAttributeValue): Ditto.
(AccessibilityUIElement::parameterizedAttributeNames): Ditto.
(AccessibilityUIElement::role): Ditto.
(AccessibilityUIElement::subrole): Ditto.
(AccessibilityUIElement::roleDescription): Ditto.
(AccessibilityUIElement::computedRoleString): Ditto.
(AccessibilityUIElement::title): Ditto.
(AccessibilityUIElement::description): Ditto.
(AccessibilityUIElement::orientation const): Ditto.
(AccessibilityUIElement::stringValue): Ditto.
(AccessibilityUIElement::language): Ditto.
(AccessibilityUIElement::helpText const): Ditto.
(AccessibilityUIElement::valueDescription): Ditto.
(AccessibilityUIElement::ariaDropEffects const): Ditto.
(AccessibilityUIElement::boundsForRange): Ditto.
(AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
(AccessibilityUIElement::attributesOfRowHeaders): Ditto.
(AccessibilityUIElement::attributesOfColumns): Ditto.
(AccessibilityUIElement::attributesOfRows): Ditto.
(AccessibilityUIElement::attributesOfVisibleCells): Ditto.
(AccessibilityUIElement::attributesOfHeader): Ditto.
(AccessibilityUIElement::rowIndexRange): Ditto.
(AccessibilityUIElement::columnIndexRange): Ditto.
(AccessibilityUIElement::selectedTextRange): Ditto.
(AccessibilityUIElement::accessibilityValue const): Ditto.
(AccessibilityUIElement::documentEncoding): Ditto.
(AccessibilityUIElement::documentURI): Ditto.
(AccessibilityUIElement::selectTextWithCriteria): Ditto.
(AccessibilityUIElement::classList const): Ditto.

* DumpRenderTree/mac/AccessibilityCommonMac.h: Changed the
createJSStringRef method to return a JSRetainPtr.
* DumpRenderTree/mac/AccessibilityCommonMac.mm:
(-[NSString createJSStringRef]): Ditto.
(searchPredicateParameterizedAttributeForSearchCriteria): Use the
adopt function instead of the adopt constructor.
* DumpRenderTree/mac/AccessibilityControllerMac.mm:
(AccessibilityController::platformName const): Ditto.

* DumpRenderTree/mac/AccessibilityNotificationHandler.mm:
(-[NSString createJSStringRef]): Return a JSRetainPtr.
(makeValueRefForValue): Updated for the above, no adopt needed here now.
(makeObjectRefForDictionary): Ditto.
(-[AccessibilityNotificationHandler _notificationReceived:]): Ditto.

* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(createEmptyJSString): Added. This helper function makes reduces the
repetitive code to create empty strings.
(concatenateAttributeAndValue): Changed to return a JSRetainPtr.
(descriptionOfElements): Ditto.
(selectTextParameterizedAttributeForCriteria): Ditto.
(AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
(AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
(AccessibilityUIElement::attributesOfChildren): Ditto.
(AccessibilityUIElement::allAttributes): Ditto.
(AccessibilityUIElement::stringAttributeValue): Ditto.
(AccessibilityUIElement::parameterizedAttributeNames): Ditto.
(AccessibilityUIElement::role): Ditto.
(AccessibilityUIElement::subrole): Ditto.
(AccessibilityUIElement::roleDescription): Ditto.
(AccessibilityUIElement::computedRoleString): Ditto.
(AccessibilityUIElement::title): Ditto.
(AccessibilityUIElement::description): Ditto.
(AccessibilityUIElement::orientation const): Ditto.
(AccessibilityUIElement::stringValue): Ditto.
(AccessibilityUIElement::language): Ditto.
(AccessibilityUIElement::helpText const): Ditto.
(AccessibilityUIElement::valueDescription): Ditto.
(AccessibilityUIElement::speakAs): Ditto.
(AccessibilityUIElement::classList const): Ditto.
(AccessibilityUIElement::ariaDropEffects const): Ditto.
(AccessibilityUIElement::rangeForLine): Ditto.
(AccessibilityUIElement::rangeForPosition): Ditto.
(AccessibilityUIElement::boundsForRange): Ditto.
(AccessibilityUIElement::stringForRange): Ditto.
(AccessibilityUIElement::attributedStringForRange): Ditto.
(AccessibilityUIElement::selectTextWithCriteria): Ditto.
(AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
(AccessibilityUIElement::attributesOfRowHeaders): Ditto.
(AccessibilityUIElement::attributesOfColumns): Ditto.
(AccessibilityUIElement::attributesOfRows): Ditto.
(AccessibilityUIElement::attributesOfVisibleCells): Ditto.
(AccessibilityUIElement::attributesOfHeader): Ditto.
(AccessibilityUIElement::rowIndexRange): Ditto.
(AccessibilityUIElement::columnIndexRange): Ditto.
(AccessibilityUIElement::pathDescription const): Ditto.
(AccessibilityUIElement::selectedTextRange): Ditto.
(AccessibilityUIElement::accessibilityValue const): Ditto.
(AccessibilityUIElement::documentEncoding): Ditto.
(AccessibilityUIElement::documentURI): Ditto.
(AccessibilityUIElement::url): Ditto.
(AccessibilityUIElement::stringForTextMarkerRange): Ditto.
(createJSStringRef): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
(AccessibilityUIElement::supportedActions): Ditto.
(AccessibilityUIElement::mathPostscriptsDescription const): Ditto.
(AccessibilityUIElement::mathPrescriptsDescription const): Ditto.

* DumpRenderTree/mac/FrameLoadDelegate.mm:
(-[FrameLoadDelegate didClearWindowObjectForFrame:inIsolatedWorld:]):
Use the adopt function instead of the adopt constructor.
* DumpRenderTree/mac/TestRunnerMac.mm:
(originsArrayToJS): Ditto.
(TestRunner::copyDecodedHostName): Return a JSRetainPtr.
(TestRunner::copyEncodedHostName): Ditto.
(TestRunner::pathToLocalResource): Ditto.
(TestRunner::queueLoad): Use adopt function instead of constructor.
(TestRunner::findString): Ditto.
(TestRunner::inspectorTestStubURL): Return a JSRetainPtr.

* DumpRenderTree/win/AccessibilityControllerWin.cpp:
(AccessibilityController::winNotificationReceived): Use adopt function
instead of adopt constructor.
(AccessibilityController::platformName const): Ditto.

* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(createEmptyJSString): Added. This helper function makes reduces the
repetitive code to create empty strings.
(AccessibilityUIElement::allAttributes): Changed to return a JSRetainPtr.
(AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
(AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
(AccessibilityUIElement::attributesOfChildren): Ditto.
(AccessibilityUIElement::parameterizedAttributeNames): Ditto.
(AccessibilityUIElement::role): Ditto.
(AccessibilityUIElement::subrole): Ditto.
(AccessibilityUIElement::roleDescription): Ditto.
(AccessibilityUIElement::computedRoleString): Ditto.
(AccessibilityUIElement::title): Ditto.
(AccessibilityUIElement::description): Ditto.
(AccessibilityUIElement::stringValue): Ditto.
(AccessibilityUIElement::language): Ditto.
(AccessibilityUIElement::helpText const): Ditto.
(AccessibilityUIElement::valueDescription): Ditto.
(AccessibilityUIElement::ariaDropEffects const): Ditto.
(AccessibilityUIElement::orientation const): Ditto.
(AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
(AccessibilityUIElement::attributesOfRowHeaders): Ditto.
(AccessibilityUIElement::attributesOfColumns): Ditto.
(AccessibilityUIElement::attributesOfRows): Ditto.
(AccessibilityUIElement::attributesOfVisibleCells): Ditto.
(AccessibilityUIElement::attributesOfHeader): Ditto.
(AccessibilityUIElement::rowIndexRange): Ditto.
(AccessibilityUIElement::columnIndexRange): Ditto.
(AccessibilityUIElement::boundsForRange): Ditto.
(AccessibilityUIElement::stringForRange): Ditto.
(AccessibilityUIElement::attributedStringForRange): Ditto.
(AccessibilityUIElement::selectTextWithCriteria): Ditto.
(AccessibilityUIElement::selectedTextRange): Ditto.
(AccessibilityUIElement::stringAttributeValue): Ditto.
(AccessibilityUIElement::accessibilityValue const): Ditto.
(AccessibilityUIElement::documentEncoding): Ditto.
(AccessibilityUIElement::documentURI): Ditto.
(AccessibilityUIElement::url): Ditto.
(AccessibilityUIElement::classList const): Ditto.

* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::copyDecodedHostName): Changed to return a JSRetainPtr.
(TestRunner::copyEncodedHostName): Ditto.
(TestRunner::pathToLocalResource): Ditto.
(TestRunner::queueLoad): Ditto.
(TestRunner::findString): Ditto.
(TestRunner::inspectorTestStubURL): Ditto.

* TestRunnerShared/Bindings/JSWrapper.h:
(WTR::setProperty): Use adopt function instead of constructor.
* TestRunnerShared/UIScriptContext/UIScriptContext.cpp:
(UIScriptContext::UIScriptContext): Ditto.
(UIScriptContext::runUIScript): Ditto.
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::toDeviceOrientation): Ditto.

* TestRunnerShared/cocoa/LayoutTestSpellChecker.mm:
(nsTextCheckingType): Changed this function to not take an rvalue
reference to a JSRetainPtr since it doesn't take ownership.
(-[LayoutTestSpellChecker setResultsFromJSObject:inContext:]): Updated
for the above change.

* TestWebKitAPI/JavaScriptTest.cpp:
(TestWebKitAPI::javaScriptCallback): Use adopt function instead of
adopt member function.

* TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp: Removed unneeded include.
* TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm: Ditto.
* TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm: Use adopt function instead of
adopt constructor.
* TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm: Ditto.

* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
Removed unneeded includes.
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp: Ditto.
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp: Ditto.
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: Ditto.

* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
(_platformTypeConstructor): Use the adopt function instead of the
JSRetainPtr adopt constructor. Also nullptr instead of 0.

* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::arrayLength): Use adopt function instead of constructor.
(WTR::parseModifierArray): Ditto.
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::propertyValue): Ditto.
(WTR::dumpPath): Ditto.
(WTR::toJS): Ditto.
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::findString): Ditto.
(WTR::TestRunner::statisticsDidRunTelemetryCallback): Ditto.
(WTR::TestRunner::callDidReceiveAllStorageAccessEntriesCallback): Ditto.
(WTR::TestRunner::setOpenPanelFiles): Ditto.
* WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm:
(WTR::AccessibilityController::platformName): Ditto.

* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(-[NSString createJSStringRef]): Return a JSRetainPtr.
This fixes storage leaks in many functions below, which were using
the create function and putting the value right into a JSRetainPtr
without adoption.
(WTR::createEmptyJSString): Added. This helper function reduces the
repetitive code to create empty strings.
(WTR::concatenateAttributeAndValue): Return a JSRetainPtr.
(WTR::AccessibilityUIElement::attributesOfLinkedUIElements):
Use createEmptyJSString, fixing a storage leak due to missing adoption.
(WTR::AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
(WTR::AccessibilityUIElement::attributesOfChildren): Ditto.
(WTR::AccessibilityUIElement::allAttributes): Ditto.
(WTR::AccessibilityUIElement::stringAttributeValue): Ditto.
(WTR::AccessibilityUIElement::parameterizedAttributeNames): Ditto.
(WTR::AccessibilityUIElement::role): Ditto.
(WTR::AccessibilityUIElement::subrole): Ditto.
(WTR::AccessibilityUIElement::roleDescription): Ditto.
(WTR::AccessibilityUIElement::computedRoleString): Ditto.
(WTR::AccessibilityUIElement::title): Ditto.
(WTR::AccessibilityUIElement::orientation const): Ditto.
(WTR::AccessibilityUIElement::language): Ditto.
(WTR::AccessibilityUIElement::valueDescription): Ditto.
(WTR::AccessibilityUIElement::ariaDropEffects const): Ditto.
(WTR::AccessibilityUIElement::boundsForRange): Ditto.
(WTR::AccessibilityUIElement::stringForRange): Removed unneeded null check.
(WTR::AccessibilityUIElement::attributedStringForRange): Ditto.
(WTR::AccessibilityUIElement::attributesOfColumnHeaders):
Use createEmptyJSString, fixing a storage leak due to missing adoption.
(WTR::AccessibilityUIElement::attributesOfRowHeaders): Ditto.
(WTR::AccessibilityUIElement::attributesOfColumns): Ditto.
(WTR::AccessibilityUIElement::attributesOfRows): Ditto.
(WTR::AccessibilityUIElement::attributesOfVisibleCells): Ditto.
(WTR::AccessibilityUIElement::attributesOfHeader): Ditto.
(WTR::AccessibilityUIElement::selectedTextRange): Ditto.
(WTR::AccessibilityUIElement::accessibilityValue const): Ditto.
(WTR::AccessibilityUIElement::documentEncoding): Ditto.
(WTR::AccessibilityUIElement::documentURI): Ditto.
(WTR::AccessibilityUIElement::stringForSelection): Removed unneeded
null check.
(WTR::AccessibilityUIElement::stringForTextMarkerRange):
Use createEmptyJSString, fixing a storage leak due to missing adoption.

* WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.h:
Use JSRetainPtr for the return value of createJSStringRef.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm:
(-[NSString createJSStringRef]): Ditto.
(WTR::searchPredicateParameterizedAttributeForSearchCriteria): Use the
adopt function instead of the adopt constructor.
* WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:
(WTR::AccessibilityController::platformName): Ditto

* WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
(-[NSString createJSStringRef]): Return a JSRetainPtr.
(makeValueRefForValue): Updated for above by removing adopt.
(makeObjectRefForDictionary): Ditto.
(-[AccessibilityNotificationHandler _notificationReceived:]): Ditto.

* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::createEmptyJSString): Added. This helper function makes reduces the
repetitive code to create empty strings.
(WTR::concatenateAttributeAndValue): Return a JSRetainPtr.
(WTR::descriptionOfElements): Ditto.
(WTR::selectTextParameterizedAttributeForCriteria): Ditto.
(WTR::AccessibilityUIElement::accessibilityValue const): Use createEmptyJSString,
fixing a storage leak due to missing adoption.
(WTR::AccessibilityUIElement::documentEncoding): Ditto.
(WTR::AccessibilityUIElement::documentURI): Ditto.
(WTR::createJSStringRef): Return a JSRetainPtr.

* WebKitTestRunner/StringFunctions.h:
(WTR::toWK): Take a const& to eliminate a little bit of reference count churn.
(WTR::toJS): Use the adopt function instead of the constructor.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreAPIJSObjectRefcpp">trunk/Source/JavaScriptCore/API/JSObjectRef.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSRetainPtrh">trunk/Source/JavaScriptCore/API/JSRetainPtr.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSValuemm">trunk/Source/JavaScriptCore/API/JSValue.mm</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPItestsCustomGlobalObjectClassTestc">trunk/Source/JavaScriptCore/API/tests/CustomGlobalObjectClassTest.c</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPItestsExecutionTimeLimitTestcpp">trunk/Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPItestsFunctionOverridesTestcpp">trunk/Source/JavaScriptCore/API/tests/FunctionOverridesTest.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPItestsJSObjectGetProxyTargetTestcpp">trunk/Source/JavaScriptCore/API/tests/JSObjectGetProxyTargetTest.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPItestsPingPongStackOverflowTestcpp">trunk/Source/JavaScriptCore/API/tests/PingPongStackOverflowTest.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIteststestapic">trunk/Source/JavaScriptCore/API/tests/testapi.c</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebProcessAutomationWebAutomationSessionProxycpp">trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeAccessibilityControllercpp">trunk/Tools/DumpRenderTree/AccessibilityController.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeAccessibilityTextMarkercpp">trunk/Tools/DumpRenderTree/AccessibilityTextMarker.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeAccessibilityUIElementcpp">trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeAccessibilityUIElementh">trunk/Tools/DumpRenderTree/AccessibilityUIElement.h</a></li>
<li><a href="#trunkToolsDumpRenderTreeBindingsCodeGeneratorDumpRenderTreepm">trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm</a></li>
<li><a href="#trunkToolsDumpRenderTreeGCControllercpp">trunk/Tools/DumpRenderTree/GCController.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeTestRunnercpp">trunk/Tools/DumpRenderTree/TestRunner.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeTestRunnerh">trunk/Tools/DumpRenderTree/TestRunner.h</a></li>
<li><a href="#trunkToolsDumpRenderTreeiosAccessibilityControllerIOSmm">trunk/Tools/DumpRenderTree/ios/AccessibilityControllerIOS.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreeiosAccessibilityUIElementIOSmm">trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityCommonMach">trunk/Tools/DumpRenderTree/mac/AccessibilityCommonMac.h</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityCommonMacmm">trunk/Tools/DumpRenderTree/mac/AccessibilityCommonMac.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityControllerMacmm">trunk/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityNotificationHandlermm">trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityUIElementMacmm">trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacFrameLoadDelegatemm">trunk/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacTestRunnerMacmm">trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreewinAccessibilityControllerWincpp">trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinAccessibilityUIElementWincpp">trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreewinTestRunnerWincpp">trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp</a></li>
<li><a href="#trunkToolsTestRunnerSharedBindingsJSWrapperh">trunk/Tools/TestRunnerShared/Bindings/JSWrapper.h</a></li>
<li><a href="#trunkToolsTestRunnerSharedUIScriptContextUIScriptContextcpp">trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptContext.cpp</a></li>
<li><a href="#trunkToolsTestRunnerSharedUIScriptContextUIScriptControllercpp">trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp</a></li>
<li><a href="#trunkToolsTestRunnerSharedcocoaLayoutTestSpellCheckermm">trunk/Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPIJavaScriptTestcpp">trunk/Tools/TestWebKitAPI/JavaScriptTest.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitWKPageIsPlayingAudiocpp">trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitCocoaPictureInPictureDelegatemm">trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsmacDOMNodeFromJSObjectmm">trunk/Tools/TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsmacJSWrapperForNodeInWebFramemm">trunk/Tools/TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleAccessibilityControllercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleAccessibilityTextMarkercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleAccessibilityTextMarkerRangecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementcpp">trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleBindingsCodeGeneratorTestRunnerpm">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleEventSendingControllercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp">trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleiosAccessibilityControllerIOSmm">trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleiosAccessibilityUIElementIOSmm">trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityCommonMach">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityCommonMacmm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityControllerMacmm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityNotificationHandlermm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerStringFunctionsh">trunk/Tools/WebKitTestRunner/StringFunctions.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreAPIJSObjectRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSObjectRef.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSObjectRef.cpp  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/JavaScriptCore/API/JSObjectRef.cpp     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> #include "JSFunction.h"
</span><span class="cx"> #include "JSGlobalObject.h"
</span><span class="cx"> #include "JSObject.h"
</span><del>-#include "JSRetainPtr.h"
</del><span class="cx"> #include "JSString.h"
</span><span class="cx"> #include "JSValueRef.h"
</span><span class="cx"> #include "ObjectConstructor.h"
</span><span class="lines">@@ -763,6 +762,7 @@
</span><span class="cx"> struct OpaqueJSPropertyNameArray {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><ins>+    // FIXME: Why not inherit from RefCounted?
</ins><span class="cx">     OpaqueJSPropertyNameArray(VM* vm)
</span><span class="cx">         : refCount(0)
</span><span class="cx">         , vm(vm)
</span><span class="lines">@@ -771,7 +771,7 @@
</span><span class="cx">     
</span><span class="cx">     unsigned refCount;
</span><span class="cx">     VM* vm;
</span><del>-    Vector<JSRetainPtr<JSStringRef>> array;
</del><ins>+    Vector<Ref<OpaqueJSString>> array;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> JSPropertyNameArrayRef JSObjectCopyPropertyNames(JSContextRef ctx, JSObjectRef object)
</span><span class="lines">@@ -793,8 +793,8 @@
</span><span class="cx">     size_t size = array.size();
</span><span class="cx">     propertyNames->array.reserveInitialCapacity(size);
</span><span class="cx">     for (size_t i = 0; i < size; ++i)
</span><del>-        propertyNames->array.uncheckedAppend(JSRetainPtr<JSStringRef>(Adopt, OpaqueJSString::create(array[i].string()).leakRef()));
-    
</del><ins>+        propertyNames->array.uncheckedAppend(OpaqueJSString::create(array[i].string()).releaseNonNull());
+
</ins><span class="cx">     return JSPropertyNameArrayRetain(propertyNames);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -819,7 +819,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSStringRef JSPropertyNameArrayGetNameAtIndex(JSPropertyNameArrayRef array, size_t index)
</span><span class="cx"> {
</span><del>-    return array->array[static_cast<unsigned>(index)].get();
</del><ins>+    return array->array[static_cast<unsigned>(index)].ptr();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSPropertyNameAccumulatorAddName(JSPropertyNameAccumulatorRef array, JSStringRef propertyName)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSRetainPtrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSRetainPtr.h (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSRetainPtr.h    2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/JavaScriptCore/API/JSRetainPtr.h       2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005-2018 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,8 +26,7 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef JSRetainPtr_h
-#define JSRetainPtr_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include <JavaScriptCore/JSContextRef.h>
</span><span class="cx"> #include <JavaScriptCore/JSStringRef.h>
</span><span class="lines">@@ -42,17 +41,16 @@
</span><span class="cx"> 
</span><span class="cx"> template<typename T> class JSRetainPtr {
</span><span class="cx"> public:
</span><del>-    JSRetainPtr() : m_ptr(0) { }
</del><ins>+    JSRetainPtr() = default;
</ins><span class="cx">     JSRetainPtr(T ptr) : m_ptr(ptr) { if (ptr) JSRetain(ptr); }
</span><del>-    JSRetainPtr(AdoptTag, T ptr) : m_ptr(ptr) { }
</del><span class="cx">     JSRetainPtr(const JSRetainPtr&);
</span><del>-    template<typename U> JSRetainPtr(const JSRetainPtr<U>&);
</del><ins>+    JSRetainPtr(JSRetainPtr&&);
</ins><span class="cx">     ~JSRetainPtr();
</span><span class="cx">     
</span><span class="cx">     T get() const { return m_ptr; }
</span><span class="cx">     
</span><span class="cx">     void clear();
</span><del>-    T leakRef();
</del><ins>+    T leakRef() WARN_UNUSED_RETURN;
</ins><span class="cx"> 
</span><span class="cx">     T operator->() const { return m_ptr; }
</span><span class="cx">     
</span><span class="lines">@@ -60,18 +58,30 @@
</span><span class="cx">     explicit operator bool() const { return m_ptr; }
</span><span class="cx"> 
</span><span class="cx">     JSRetainPtr& operator=(const JSRetainPtr&);
</span><del>-    template<typename U> JSRetainPtr& operator=(const JSRetainPtr<U>&);
</del><ins>+    JSRetainPtr& operator=(JSRetainPtr&&);
</ins><span class="cx">     JSRetainPtr& operator=(T);
</span><del>-    template<typename U> JSRetainPtr& operator=(U*);
</del><span class="cx"> 
</span><del>-    void adopt(T);
-    
</del><span class="cx">     void swap(JSRetainPtr&);
</span><span class="cx"> 
</span><ins>+    friend JSRetainPtr<JSStringRef> adopt(JSStringRef);
+    friend JSRetainPtr<JSGlobalContextRef> adopt(JSGlobalContextRef);
+
+    // FIXME: Make this private once Apple's internal code is updated to not rely on it.
+    // https://bugs.webkit.org/show_bug.cgi?id=189644
+    JSRetainPtr(AdoptTag, T);
+
</ins><span class="cx"> private:
</span><del>-    T m_ptr;
</del><ins>+    T m_ptr { nullptr };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+JSRetainPtr<JSStringRef> adopt(JSStringRef);
+JSRetainPtr<JSGlobalContextRef> adopt(JSGlobalContextRef);
+
+template<typename T> inline JSRetainPtr<T>::JSRetainPtr(AdoptTag, T ptr)
+    : m_ptr(ptr)
+{
+}
+
</ins><span class="cx"> inline JSRetainPtr<JSStringRef> adopt(JSStringRef o)
</span><span class="cx"> {
</span><span class="cx">     return JSRetainPtr<JSStringRef>(Adopt, o);
</span><span class="lines">@@ -89,11 +99,9 @@
</span><span class="cx">         JSRetain(m_ptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template<typename T> template<typename U> inline JSRetainPtr<T>::JSRetainPtr(const JSRetainPtr<U>& o)
-    : m_ptr(o.get())
</del><ins>+template<typename T> inline JSRetainPtr<T>::JSRetainPtr(JSRetainPtr&& o)
+    : m_ptr(o.leakRef())
</ins><span class="cx"> {
</span><del>-    if (m_ptr)
-        JSRetain(m_ptr);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename T> inline JSRetainPtr<T>::~JSRetainPtr()
</span><span class="lines">@@ -104,39 +112,23 @@
</span><span class="cx"> 
</span><span class="cx"> template<typename T> inline void JSRetainPtr<T>::clear()
</span><span class="cx"> {
</span><del>-    if (T ptr = m_ptr) {
-        m_ptr = 0;
</del><ins>+    if (T ptr = leakRef())
</ins><span class="cx">         JSRelease(ptr);
</span><del>-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename T> inline T JSRetainPtr<T>::leakRef()
</span><span class="cx"> {
</span><del>-    T ptr = m_ptr;
-    m_ptr = 0;
-    return ptr;
</del><ins>+    return std::exchange(m_ptr, nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename T> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(const JSRetainPtr<T>& o)
</span><span class="cx"> {
</span><del>-    T optr = o.get();
-    if (optr)
-        JSRetain(optr);
-    T ptr = m_ptr;
-    m_ptr = optr;
-    if (ptr)
-        JSRelease(ptr);
-    return *this;
</del><ins>+    return operator=(o.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template<typename T> template<typename U> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(const JSRetainPtr<U>& o)
</del><ins>+template<typename T> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(JSRetainPtr&& o)
</ins><span class="cx"> {
</span><del>-    T optr = o.get();
-    if (optr)
-        JSRetain(optr);
-    T ptr = m_ptr;
-    m_ptr = optr;
-    if (ptr)
</del><ins>+    if (T ptr = std::exchange(m_ptr, o.leakRef()))
</ins><span class="cx">         JSRelease(ptr);
</span><span class="cx">     return *this;
</span><span class="cx"> }
</span><span class="lines">@@ -145,32 +137,11 @@
</span><span class="cx"> {
</span><span class="cx">     if (optr)
</span><span class="cx">         JSRetain(optr);
</span><del>-    T ptr = m_ptr;
-    m_ptr = optr;
-    if (ptr)
</del><ins>+    if (T ptr = std::exchange(m_ptr, optr))
</ins><span class="cx">         JSRelease(ptr);
</span><span class="cx">     return *this;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template<typename T> inline void JSRetainPtr<T>::adopt(T optr)
-{
-    T ptr = m_ptr;
-    m_ptr = optr;
-    if (ptr)
-        JSRelease(ptr);
-}
-
-template<typename T> template<typename U> inline JSRetainPtr<T>& JSRetainPtr<T>::operator=(U* optr)
-{
-    if (optr)
-        JSRetain(optr);
-    T ptr = m_ptr;
-    m_ptr = optr;
-    if (ptr)
-        JSRelease(ptr);
-    return *this;
-}
-
</del><span class="cx"> template<typename T> inline void JSRetainPtr<T>::swap(JSRetainPtr<T>& o)
</span><span class="cx"> {
</span><span class="cx">     std::swap(m_ptr, o.m_ptr);
</span><span class="lines">@@ -210,6 +181,3 @@
</span><span class="cx"> { 
</span><span class="cx">     return a != b.get(); 
</span><span class="cx"> }
</span><del>-
-
-#endif // JSRetainPtr_h
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSValuemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSValue.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSValue.mm       2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/JavaScriptCore/API/JSValue.mm  2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -154,8 +154,10 @@
</span><span class="cx"> 
</span><span class="cx"> + (JSValue *)valueWithNewSymbolFromDescription:(NSString *)description inContext:(JSContext *)context
</span><span class="cx"> {
</span><del>-    JSStringRef string = JSStringCreateWithCFString(reinterpret_cast<CFStringRef>(description));
-    return [JSValue valueWithJSValueRef:JSValueMakeSymbol([context JSGlobalContextRef], string) inContext:context];
</del><ins>+    JSStringRef string = JSStringCreateWithCFString((__bridge CFStringRef)description);
+    auto value = [JSValue valueWithJSValueRef:JSValueMakeSymbol([context JSGlobalContextRef], string) inContext:context];
+    JSStringRelease(string);
+    return value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPItestsCustomGlobalObjectClassTestc"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/tests/CustomGlobalObjectClassTest.c (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/CustomGlobalObjectClassTest.c      2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/JavaScriptCore/API/tests/CustomGlobalObjectClassTest.c 2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -101,6 +101,8 @@
</span><span class="cx">     JSStringRelease(script);
</span><span class="cx"> 
</span><span class="cx">     assertTrue(executedCallback, "Executed custom global object callback");
</span><ins>+
+    JSGlobalContextRelease(globalContext);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void globalObjectSetPrototypeTest()
</span><span class="lines">@@ -116,6 +118,7 @@
</span><span class="cx">     JSObjectSetPrototype(context, object, above);
</span><span class="cx">     JSValueRef prototypeAfterChangingAttempt = JSObjectGetPrototype(context, object);
</span><span class="cx">     assertTrue(JSValueIsStrictEqual(context, prototypeAfterChangingAttempt, originalPrototype), "Global object's [[Prototype]] cannot be changed after instantiating it");
</span><ins>+    JSGlobalContextRelease(context);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void globalObjectPrivatePropertyTest()
</span><span class="lines">@@ -137,4 +140,5 @@
</span><span class="cx">     assertTrue(JSValueIsNull(context, result), "Deleted private property is indeed no longer present");
</span><span class="cx"> 
</span><span class="cx">     JSStringRelease(privateName);
</span><ins>+    JSGlobalContextRelease(context);
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPItestsExecutionTimeLimitTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.cpp 2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.cpp    2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -106,6 +106,7 @@
</span><span class="cx">     const char* reentryScript = "100";
</span><span class="cx">     JSStringRef script = JSStringCreateWithUTF8CString(reentryScript);
</span><span class="cx">     v = JSEvaluateScript(context, script, nullptr, nullptr, 1, &exception);
</span><ins>+    JSStringRelease(script);
</ins><span class="cx">     if (exception) {
</span><span class="cx">         printf("FAIL: Watchdog timeout was not reset.\n");
</span><span class="cx">         failed = true;
</span><span class="lines">@@ -181,6 +182,8 @@
</span><span class="cx"> 
</span><span class="cx">             thread->waitForCompletion();
</span><span class="cx">             testResetAfterTimeout(failed);
</span><ins>+
+            JSStringRelease(script);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /* Test script timeout: */
</span><span class="lines">@@ -200,6 +203,7 @@
</span><span class="cx">             auto startTime = CPUTime::forCurrentThread();
</span><span class="cx">             JSEvaluateScript(context, script, nullptr, nullptr, 1, &exception);
</span><span class="cx">             auto endTime = CPUTime::forCurrentThread();
</span><ins>+            JSStringRelease(script);
</ins><span class="cx"> 
</span><span class="cx">             if (((endTime - startTime) < timeAfterWatchdogShouldHaveFired) && shouldTerminateCallbackWasCalled)
</span><span class="cx">                 printf("PASS: %s script timed out as expected.\n", tierOptions.tier);
</span><span class="lines">@@ -243,6 +247,7 @@
</span><span class="cx">             auto startTime = CPUTime::forCurrentThread();
</span><span class="cx">             JSEvaluateScript(context, script, nullptr, nullptr, 1, &exception);
</span><span class="cx">             auto endTime = CPUTime::forCurrentThread();
</span><ins>+            JSStringRelease(script);
</ins><span class="cx"> 
</span><span class="cx">             if (((endTime - startTime) < timeAfterWatchdogShouldHaveFired) && shouldTerminateCallbackWasCalled)
</span><span class="cx">                 printf("PASS: %s script with infinite tail calls timed out as expected .\n", tierOptions.tier);
</span><span class="lines">@@ -281,6 +286,8 @@
</span><span class="cx">             JSEvaluateScript(context, script, nullptr, nullptr, 1, &exception);
</span><span class="cx">             auto endTime = CPUTime::forCurrentThread();
</span><span class="cx">             
</span><ins>+            JSStringRelease(script);
+
</ins><span class="cx">             if (((endTime - startTime) >= timeAfterWatchdogShouldHaveFired) || !shouldTerminateCallbackWasCalled) {
</span><span class="cx">                 if (!((endTime - startTime) < timeAfterWatchdogShouldHaveFired))
</span><span class="cx">                     printf("FAIL: %s script did not time out as expected.\n", tierOptions.tier);
</span><span class="lines">@@ -318,6 +325,8 @@
</span><span class="cx">             JSEvaluateScript(context, script, nullptr, nullptr, 1, &exception);
</span><span class="cx">             auto endTime = CPUTime::forCurrentThread();
</span><span class="cx">             
</span><ins>+            JSStringRelease(script);
+
</ins><span class="cx">             if (((endTime - startTime) < timeAfterWatchdogShouldHaveFired) && !shouldTerminateCallbackWasCalled)
</span><span class="cx">                 printf("PASS: %s script timed out as expected when no callback is specified.\n", tierOptions.tier);
</span><span class="cx">             else {
</span><span class="lines">@@ -355,6 +364,8 @@
</span><span class="cx">             JSEvaluateScript(context, script, nullptr, nullptr, 1, &exception);
</span><span class="cx">             auto endTime = CPUTime::forCurrentThread();
</span><span class="cx">             
</span><ins>+            JSStringRelease(script);
+
</ins><span class="cx">             if (((endTime - startTime) >= timeAfterWatchdogShouldHaveFired) && cancelTerminateCallbackWasCalled && !exception)
</span><span class="cx">                 printf("PASS: %s script timeout was cancelled as expected.\n", tierOptions.tier);
</span><span class="cx">             else {
</span><span class="lines">@@ -393,6 +404,8 @@
</span><span class="cx">             auto endTime = CPUTime::forCurrentThread();
</span><span class="cx">             auto deltaTime = endTime - startTime;
</span><span class="cx">             
</span><ins>+            JSStringRelease(script);
+
</ins><span class="cx">             if ((deltaTime >= timeBeforeExtendedDeadline) && (deltaTime < timeAfterExtendedDeadline) && (extendTerminateCallbackCalled == 2) && exception)
</span><span class="cx">                 printf("PASS: %s script timeout was extended as expected.\n", tierOptions.tier);
</span><span class="cx">             else {
</span><span class="lines">@@ -469,6 +482,8 @@
</span><span class="cx">                     printf("FAIL: %s script on dispatch queue timeout callback was not called.\n", tierOptions.tier);
</span><span class="cx">                 failed = true;
</span><span class="cx">             }
</span><ins>+
+            JSStringRelease(script);
</ins><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPItestsFunctionOverridesTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/tests/FunctionOverridesTest.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/FunctionOverridesTest.cpp  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/JavaScriptCore/API/tests/FunctionOverridesTest.cpp     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -76,6 +76,7 @@
</span><span class="cx">     JSStringRef script = JSStringCreateWithUTF8CString(scriptString);
</span><span class="cx">     JSValueRef exception = nullptr;
</span><span class="cx">     JSValueRef resultRef = JSEvaluateScript(context, script, nullptr, nullptr, 1, &exception);
</span><ins>+    JSStringRelease(script);
</ins><span class="cx"> 
</span><span class="cx">     if (!JSValueIsBoolean(context, resultRef) || !JSValueToBoolean(context, resultRef))
</span><span class="cx">         failed = true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPItestsJSObjectGetProxyTargetTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/tests/JSObjectGetProxyTargetTest.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/JSObjectGetProxyTargetTest.cpp     2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/JavaScriptCore/API/tests/JSObjectGetProxyTargetTest.cpp        2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">     };
</span><span class="cx">     
</span><span class="cx">     JSContextGroupRef group = JSContextGroupCreate();
</span><del>-    JSContextRef context = JSGlobalContextCreateInGroup(group, nullptr);
</del><ins>+    JSGlobalContextRef context = JSGlobalContextCreateInGroup(group, nullptr);
</ins><span class="cx">     
</span><span class="cx">     ExecState* exec = toJS(context);
</span><span class="cx">     VM& vm = *toJS(group);
</span><span class="lines">@@ -96,7 +96,8 @@
</span><span class="cx">     test("proxy target of ProxyObject works", JSObjectGetProxyTarget(proxyObject) == array);
</span><span class="cx">     
</span><span class="cx">     test("proxy target of GlobalObject is the globalObject", JSObjectGetProxyTarget(globalObjectProxy) == globalObject);
</span><del>-    
</del><ins>+
+    JSGlobalContextRelease(context);
</ins><span class="cx">     JSContextGroupRelease(group);
</span><span class="cx"> 
</span><span class="cx">     printf("JSObjectGetProxyTargetTest: %s\n", overallResult ? "PASS" : "FAIL");
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPItestsPingPongStackOverflowTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/tests/PingPongStackOverflowTest.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/PingPongStackOverflowTest.cpp      2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/JavaScriptCore/API/tests/PingPongStackOverflowTest.cpp 2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -162,6 +162,10 @@
</span><span class="cx">     exception = nullptr;
</span><span class="cx">     JSEvaluateScript(context, script, nullptr, nullptr, 1, &exception);
</span><span class="cx"> 
</span><ins>+    JSGlobalContextRelease(context);
+    context = nullptr;
+    JSStringRelease(script);
+
</ins><span class="cx">     if (!exception) {
</span><span class="cx">         printf("FAIL: PingPongStackOverflowError not thrown in PingPongStackOverflow test\n");
</span><span class="cx">         failed = true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIteststestapic"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/tests/testapi.c (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/tests/testapi.c  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/JavaScriptCore/API/tests/testapi.c     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -201,6 +201,16 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static JSValueRef throwException(JSContextRef context, JSObjectRef object, JSValueRef* exception)
+{
+    JSStringRef script = JSStringCreateWithUTF8CString("throw 'an exception'");
+    JSStringRef sourceURL = JSStringCreateWithUTF8CString("test script");
+    JSValueRef result = JSEvaluateScript(context, script, object, sourceURL, 1, exception);
+    JSStringRelease(script);
+    JSStringRelease(sourceURL);
+    return result;
+}
+
</ins><span class="cx"> static JSValueRef MyObject_getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(context);
</span><span class="lines">@@ -223,7 +233,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (JSStringIsEqualToUTF8CString(propertyName, "throwOnGet")) {
</span><del>-        return JSEvaluateScript(context, JSStringCreateWithUTF8CString("throw 'an exception'"), object, JSStringCreateWithUTF8CString("test script"), 1, exception);
</del><ins>+        return throwException(context, object, exception);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (JSStringIsEqualToUTF8CString(propertyName, "0")) {
</span><span class="lines">@@ -245,7 +255,7 @@
</span><span class="cx">         return true; // pretend we set the property in order to swallow it
</span><span class="cx">     
</span><span class="cx">     if (JSStringIsEqualToUTF8CString(propertyName, "throwOnSet")) {
</span><del>-        JSEvaluateScript(context, JSStringCreateWithUTF8CString("throw 'an exception'"), object, JSStringCreateWithUTF8CString("test script"), 1, exception);
</del><ins>+        throwException(context, object, exception);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return false;
</span><span class="lines">@@ -260,7 +270,7 @@
</span><span class="cx">         return true;
</span><span class="cx">     
</span><span class="cx">     if (JSStringIsEqualToUTF8CString(propertyName, "throwOnDelete")) {
</span><del>-        JSEvaluateScript(context, JSStringCreateWithUTF8CString("throw 'an exception'"), object, JSStringCreateWithUTF8CString("test script"), 1, exception);
</del><ins>+        throwException(context, object, exception);
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -283,6 +293,18 @@
</span><span class="cx">     JSStringRelease(propertyName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool isValueEqualToString(JSContextRef context, JSValueRef value, const char* string)
+{
+    if (!JSValueIsString(context, value))
+        return false;
+    JSStringRef valueString = JSValueToStringCopy(context, value, NULL);
+    if (!valueString)
+        return false;
+    bool isEqual = JSStringIsEqualToUTF8CString(valueString, string);
+    JSStringRelease(valueString);
+    return isEqual;
+}
+
</ins><span class="cx"> static JSValueRef MyObject_callAsFunction(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(context);
</span><span class="lines">@@ -290,8 +312,8 @@
</span><span class="cx">     UNUSED_PARAM(thisObject);
</span><span class="cx">     UNUSED_PARAM(exception);
</span><span class="cx"> 
</span><del>-    if (argumentCount > 0 && JSValueIsString(context, arguments[0]) && JSStringIsEqualToUTF8CString(JSValueToStringCopy(context, arguments[0], 0), "throwOnCall")) {
-        JSEvaluateScript(context, JSStringCreateWithUTF8CString("throw 'an exception'"), object, JSStringCreateWithUTF8CString("test script"), 1, exception);
</del><ins>+    if (argumentCount > 0 && isValueEqualToString(context, arguments[0], "throwOnCall")) {
+        throwException(context, object, exception);
</ins><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -306,8 +328,8 @@
</span><span class="cx">     UNUSED_PARAM(context);
</span><span class="cx">     UNUSED_PARAM(object);
</span><span class="cx"> 
</span><del>-    if (argumentCount > 0 && JSValueIsString(context, arguments[0]) && JSStringIsEqualToUTF8CString(JSValueToStringCopy(context, arguments[0], 0), "throwOnConstruct")) {
-        JSEvaluateScript(context, JSStringCreateWithUTF8CString("throw 'an exception'"), object, JSStringCreateWithUTF8CString("test script"), 1, exception);
</del><ins>+    if (argumentCount > 0 && isValueEqualToString(context, arguments[0], "throwOnConstruct")) {
+        throwException(context, object, exception);
</ins><span class="cx">         return object;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -322,8 +344,8 @@
</span><span class="cx">     UNUSED_PARAM(context);
</span><span class="cx">     UNUSED_PARAM(constructor);
</span><span class="cx"> 
</span><del>-    if (JSValueIsString(context, possibleValue) && JSStringIsEqualToUTF8CString(JSValueToStringCopy(context, possibleValue, 0), "throwOnHasInstance")) {
-        JSEvaluateScript(context, JSStringCreateWithUTF8CString("throw 'an exception'"), constructor, JSStringCreateWithUTF8CString("test script"), 1, exception);
</del><ins>+    if (isValueEqualToString(context, possibleValue, "throwOnHasInstance")) {
+        throwException(context, constructor, exception);
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1137,6 +1159,8 @@
</span><span class="cx">     JSStringRelease(fetchName1);
</span><span class="cx">     JSStringRelease(fetchName2);
</span><span class="cx"> 
</span><ins>+    JSGlobalContextRelease(context);
+
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1191,7 +1215,6 @@
</span><span class="cx"> static void testMarkingConstraintsAndHeapFinalizers(void)
</span><span class="cx"> {
</span><span class="cx">     JSContextGroupRef group;
</span><del>-    JSContextRef context;
</del><span class="cx">     JSWeakRef *weakRefs;
</span><span class="cx">     unsigned i;
</span><span class="cx">     unsigned deadCount;
</span><span class="lines">@@ -1201,7 +1224,7 @@
</span><span class="cx">     group = JSContextGroupCreate();
</span><span class="cx">     expectedContextGroup = group;
</span><span class="cx">     
</span><del>-    context = JSGlobalContextCreateInGroup(group, NULL);
</del><ins>+    JSGlobalContextRef context = JSGlobalContextCreateInGroup(group, NULL);
</ins><span class="cx"> 
</span><span class="cx">     weakRefs = (JSWeakRef*)calloc(numWeakRefs, sizeof(JSWeakRef));
</span><span class="cx"> 
</span><span class="lines">@@ -1238,7 +1261,8 @@
</span><span class="cx">     didRunHeapFinalizer = false;
</span><span class="cx">     JSSynchronousGarbageCollectForDebugging(context);
</span><span class="cx">     assertTrue(!didRunHeapFinalizer, "Did not run heap finalizer");
</span><del>-    
</del><ins>+
+    JSGlobalContextRelease(context);
</ins><span class="cx">     JSContextGroupRelease(group);
</span><span class="cx"> 
</span><span class="cx">     printf("PASS: Marking Constraints and Heap Finalizers.\n");
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/JavaScriptCore/ChangeLog       2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -1,3 +1,73 @@
</span><ins>+2018-09-08  Darin Adler  <darin@apple.com>
+
+        Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
+        https://bugs.webkit.org/show_bug.cgi?id=189455
+
+        Reviewed by Keith Miller.
+
+        * API/JSObjectRef.cpp:
+        (OpaqueJSPropertyNameArray): Use Ref<OpaqueJSString> instead of
+        JSRetainPtr<JSStringRef>.
+        (JSObjectCopyPropertyNames): Remove now-unneeded use of leakRef and
+        adopt constructor.
+        (JSPropertyNameArrayGetNameAtIndex): Use ptr() instead of get() since
+        the array elements are now Ref.
+
+        * API/JSRetainPtr.h: While JSRetainPtr is written as a template,
+        it only works for two specific unrelated types, JSStringRef and
+        JSGlobalContextRef. Simplified the default constructor using data
+        member initialization. Prepared to make the adopt constructor private
+        (got everything compiling that way, then made it public again so that
+        Apple internal software will still build). Got rid of unneeded
+        templated constructor and assignment operator, since it's not relevant
+        since there is no inheritance between JSRetainPtr template types.
+        Added WARN_UNUSED_RETURN to leakRef as in RefPtr and RetainPtr.
+        Added move constructor and move assignment operator for slightly better
+        performance. Simplified implementations of various member functions
+        so they are more obviously correct, by using leakPtr in more of them
+        and using std::exchange to make the flow of values more obvious.
+
+        * API/JSValue.mm:
+        (+[JSValue valueWithNewSymbolFromDescription:inContext:]): Added a
+        missing JSStringRelease to fix a leak.
+
+        * API/tests/CustomGlobalObjectClassTest.c:
+        (customGlobalObjectClassTest): Added a JSGlobalContextRelease to fix a leak.
+        (globalObjectSetPrototypeTest): Ditto.
+        (globalObjectPrivatePropertyTest): Ditto.
+
+        * API/tests/ExecutionTimeLimitTest.cpp:
+        (testResetAfterTimeout): Added a call to JSStringRelease to fix a leak.
+        (testExecutionTimeLimit): Ditto, lots more.
+
+        * API/tests/FunctionOverridesTest.cpp:
+        (testFunctionOverrides): Added a call to JSStringRelease to fix a leak.
+
+        * API/tests/JSObjectGetProxyTargetTest.cpp:
+        (testJSObjectGetProxyTarget): Added a call to JSGlobalContextRelease to fix
+        a leak.
+
+        * API/tests/PingPongStackOverflowTest.cpp:
+        (testPingPongStackOverflow): Added calls to JSGlobalContextRelease and
+        JSStringRelease to fix leaks.
+
+        * API/tests/testapi.c:
+        (throwException): Added. Helper function for repeated idiom where we want
+        to throw an exception, but with additional JSStringRelease calls so we don't
+        have to leak just to keep the code simpler to read.
+        (MyObject_getProperty): Use throwException.
+        (MyObject_setProperty): Ditto.
+        (MyObject_deleteProperty): Ditto.
+        (isValueEqualToString): Added. Helper function for an idiom where we check
+        if something is a string and then if it's equal to a particular string
+        constant, but a version that has an additional JSStringRelease call so we
+        don't have to leak just to keep the code simpler to read.
+        (MyObject_callAsFunction): Use isValueEqualToString and throwException.
+        (MyObject_callAsConstructor): Ditto.
+        (MyObject_hasInstance): Ditto.
+        (globalContextNameTest): Added a JSGlobalContextRelease to fix a leak.
+        (testMarkingConstraintsAndHeapFinalizers): Ditto.
+
</ins><span class="cx"> 2018-09-14  Saam barati  <sbarati@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Don't dump OSRAvailabilityData in Graph::dump because a stale Availability may point to a Node that is already freed
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/WebCore/ChangeLog      2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2018-09-08  Darin Adler  <darin@apple.com>
+
+        Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
+        https://bugs.webkit.org/show_bug.cgi?id=189455
+
+        Reviewed by Keith Miller.
+
+        * Modules/plugins/QuickTimePluginReplacement.mm:
+        (WebCore::jsValueWithDictionaryInContext): Adding a missing
+        JSStringRelease to fix a leak.
+
</ins><span class="cx"> 2018-09-15  Rob Buis  <rbuis@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm       2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm  2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -308,8 +308,9 @@
</span><span class="cx">         if (!value)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        JSStringRef name = JSStringCreateWithCFString((CFStringRef)key);
</del><ins>+        JSStringRef name = JSStringCreateWithCFString((__bridge CFStringRef)key);
</ins><span class="cx">         JSObjectSetProperty([context JSGlobalContextRef], resultObject, name, [value JSValueRef], 0, &exception);
</span><ins>+        JSStringRelease(name);
</ins><span class="cx">         if (exception)
</span><span class="cx">             continue;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/WebKit/ChangeLog       2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2018-09-08  Darin Adler  <darin@apple.com>
+
+        Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
+        https://bugs.webkit.org/show_bug.cgi?id=189455
+
+        Reviewed by Keith Miller.
+
+        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
+        (WebKit::toJSString): Use adopt function instead of adopt construuctor.
+        (WebKit::evaluate): Ditto.
+        (WebKit::evaluateJavaScriptCallback): Ditto.
+        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Ditto.
+
</ins><span class="cx"> 2018-09-14  Matt Lewis  <jlewis3@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r236020.
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessAutomationWebAutomationSessionProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> 
</span><span class="cx"> static inline JSRetainPtr<JSStringRef> toJSString(const String& string)
</span><span class="cx"> {
</span><del>-    return JSRetainPtr<JSStringRef>(Adopt, OpaqueJSString::create(string).leakRef());
</del><ins>+    return adopt(OpaqueJSString::create(string).leakRef());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline JSValueRef toJSValue(JSContextRef context, const String& string)
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">     if (argumentCount != 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto script = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     return JSEvaluateScript(context, script.get(), nullptr, nullptr, 0, exception);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx"> 
</span><span class="cx">     uint64_t frameID = JSValueToNumber(context, arguments[0], exception);
</span><span class="cx">     uint64_t callbackID = JSValueToNumber(context, arguments[1], exception);
</span><del>-    JSRetainPtr<JSStringRef> result(Adopt, JSValueToStringCopy(context, arguments[2], exception));
</del><ins>+    auto result = adopt(JSValueToStringCopy(context, arguments[2], exception));
</ins><span class="cx"> 
</span><span class="cx">     bool resultIsErrorName = JSValueToBoolean(context, arguments[3]);
</span><span class="cx"> 
</span><span class="lines">@@ -287,7 +287,7 @@
</span><span class="cx">     JSRetainPtr<JSStringRef> exceptionMessage;
</span><span class="cx">     if (JSValueIsObject(context, exception)) {
</span><span class="cx">         JSValueRef nameValue = JSObjectGetProperty(context, const_cast<JSObjectRef>(exception), toJSString("name"_s).get(), nullptr);
</span><del>-        JSRetainPtr<JSStringRef> exceptionName(Adopt, JSValueToStringCopy(context, nameValue, nullptr));
</del><ins>+        auto exceptionName = adopt(JSValueToStringCopy(context, nameValue, nullptr));
</ins><span class="cx">         if (exceptionName->string() == "NodeNotFound")
</span><span class="cx">             errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::NodeNotFound);
</span><span class="cx">         else if (exceptionName->string() == "InvalidElementState")
</span><span class="lines">@@ -298,9 +298,9 @@
</span><span class="cx">             errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::InvalidSelector);
</span><span class="cx"> 
</span><span class="cx">         JSValueRef messageValue = JSObjectGetProperty(context, const_cast<JSObjectRef>(exception), toJSString("message"_s).get(), nullptr);
</span><del>-        exceptionMessage.adopt(JSValueToStringCopy(context, messageValue, nullptr));
</del><ins>+        exceptionMessage = adopt(JSValueToStringCopy(context, messageValue, nullptr));
</ins><span class="cx">     } else
</span><del>-        exceptionMessage.adopt(JSValueToStringCopy(context, exception, nullptr));
</del><ins>+        exceptionMessage = adopt(JSValueToStringCopy(context, exception, nullptr));
</ins><span class="cx"> 
</span><span class="cx">     didEvaluateJavaScriptFunction(frameID, callbackID, exceptionMessage->string(), errorType);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/ChangeLog       2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -1,3 +1,467 @@
</span><ins>+2018-09-08  Darin Adler  <darin@apple.com>
+
+        Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
+        https://bugs.webkit.org/show_bug.cgi?id=189455
+
+        Reviewed by Keith Miller.
+
+        There is a lot of copied and pasted code for WebKit vs. Legacy WebKit
+        testing and even for macOS vs. iOS vs. Windows platform-specific code.
+        For now, this patch just makes corresponding changes to the copied code.
+        Later we might get better results by merging more code instead of having
+        all these separate copies.
+
+        * DumpRenderTree/AccessibilityController.cpp:
+        (AccessibilityController::makeWindowObject): Use the adopt function
+        instead of the special Adopt constructor of JSRetainPtr.
+
+        * DumpRenderTree/AccessibilityTextMarker.cpp: Removed unneeded include.
+
+        * DumpRenderTree/AccessibilityUIElement.cpp: Ditto.
+        (allAttributesCallback): Don't adopt at this level; changed the
+        underlying function to return a JSRetainPtr so the adopt is right next
+        to the call to the create or copy function.
+        (attributesOfLinkedUIElementsCallback): Ditto.
+        (attributesOfDocumentLinksCallback): Ditto.
+        (attributesOfChildrenCallback): Ditto.
+        (parameterizedAttributeNamesCallback): Ditto.
+        (attributesOfColumnHeadersCallback): Ditto.
+        (attributesOfRowHeadersCallback): Ditto.
+        (attributesOfColumnsCallback): Ditto.
+        (attributesOfRowsCallback): Ditto.
+        (attributesOfVisibleCellsCallback): Ditto.
+        (attributesOfHeaderCallback): Ditto.
+        (rowIndexRangeCallback): Ditto.
+        (columnIndexRangeCallback): Ditto.
+        (rangeForLineCallback): Ditto.
+        (boundsForRangeCallback): Ditto.
+        (rangeForPositionCallback): Ditto.
+        (stringForRangeCallback): Ditto.
+        (attributedStringForRangeCallback): Ditto.
+        (uiElementCountForSearchPredicateCallback): Use the free adopt
+        function instead of the adopt member function.
+        (uiElementForSearchPredicateCallback): Ditto.
+        (selectTextWithCriteriaCallback): Don't adopt at this level.
+        (attributedStringForElementCallback): Ditto.
+        (setValueCallback): Use free adopt.
+        (stringAttributeValueCallback): Don't adopt at this level.
+        (uiElementArrayAttributeValueCallback): Ditto.
+        (uiElementAttributeValueCallback): Ditto.
+        (stringForTextMarkerRangeCallback): Ditto.
+        (attributedStringForTextMarkerRangeCallback): Ditto.
+        (attributedStringForTextMarkerRangeWithOptionsCallback): Ditto.
+        (getARIADropEffectsCallback): Ditto.
+        (getClassListCallback): Ditto.
+        (getRoleCallback): Ditto.
+        (getSubroleCallback): Ditto.
+        (getRoleDescriptionCallback): Ditto.
+        (getComputedRoleStringCallback): Ditto.
+        (getTitleCallback): Ditto.
+        (getDescriptionCallback): Ditto.
+        (getStringValueCallback): Ditto.
+        (getLanguageCallback): Ditto.
+        (getHelpTextCallback): Ditto.
+        (getOrientationCallback): Ditto.
+        (getPathDescriptionCallback): Ditto.
+        (getSelectedTextRangeCallback): Ditto.
+        (speakAsCallback): Ditto.
+        (getValueDescriptionCallback): Ditto.
+        (getAccessibilityValueCallback): Ditto.
+        (getDocumentEncodingCallback): Ditto.
+        (getDocumentURICallback): Ditto.
+        (getURLCallback): Ditto.
+        (characterAtOffsetCallback): Ditto.
+        (wordAtOffsetCallback): Ditto.
+        (lineAtOffsetCallback): Ditto.
+        (sentenceAtOffsetCallback): Ditto.
+        (stringForSelectionCallback): Ditto.
+        (getIdentifierCallback): Ditto.
+        (getTraitsCallback): Ditto.
+        (supportedActionsCallback): Ditto.
+        (mathPostscriptsDescriptionCallback): Ditto.
+        (mathPrescriptsDescriptionCallback): Ditto.
+        (AccessibilityUIElement::rangeForLine): Updated to return JSRetainPtr.
+        (AccessibilityUIElement::rangeForPosition): Ditto.
+        (AccessibilityUIElement::speakAs): Ditto.
+        (AccessibilityUIElement::pathDescription const): Ditto.
+        (AccessibilityUIElement::stringForTextMarkerRange): Ditto.
+        (AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
+        (AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
+
+        * DumpRenderTree/AccessibilityUIElement.h: Use JSRetainPtr instead of
+        raw pointers for the results of the functions that create strings.
+        The old way was difficult to get right; the functions didn't even follow
+        the create/copy naming rule.
+
+        * DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm:
+        (_platformTypeConstructor): Use the adopt function instead of the
+        JSRetainPtr adopt constructor. Also nullptr instead of 0.
+
+        * DumpRenderTree/GCController.cpp:
+        (GCController::makeWindowObject): Use adopt function instead of constructor.
+
+        * DumpRenderTree/TestRunner.cpp:
+        (pathToLocalResourceCallback): Use adopt function instead of constructor.
+        (addDisallowedURLCallback): Ditto.
+        (addURLToRedirectCallback): Ditto.
+        (clearApplicationCacheForOriginCallback): Ditto.
+        (applicationCacheDiskUsageForOriginCallback): Ditto.
+        (decodeHostNameCallback): Don't adopt at this level.
+        (encodeHostNameCallback): Ditto.
+        (execCommandCallback): Use adopt instead of JSRetainPtr::adopt.
+        (findStringCallback): Use adopt function instead of constructor.
+        (isCommandEnabledCallback): Ditto.
+        (overridePreferenceCallback): Ditto.
+        (queueLoadCallback): Ditto.
+        (queueLoadHTMLStringCallback): Ditto.
+        (queueLoadingScriptCallback): Ditto.
+        (queueNonLoadingScriptCallback): Ditto.
+        (setAuthenticationPasswordCallback): Ditto.
+        (setAuthenticationUsernameCallback): Ditto.
+        (setDomainRelaxationForbiddenForURLSchemeCallback): Ditto.
+        (setMockGeolocationPositionUnavailableErrorCallback): Ditto.
+        (setPOSIXLocaleCallback): Ditto.
+        (setPersistentUserStyleSheetLocationCallback): Ditto.
+        (setUserStyleSheetLocationCallback): Ditto.
+        (setValueForUserCallback): Ditto.
+        (setWillSendRequestClearHeaderCallback): Ditto.
+        (setPageVisibilityCallback): Ditto.
+        (evaluateInWebInspectorCallback): Ditto.
+        (evaluateScriptInIsolatedWorldCallback): Ditto.
+        (evaluateScriptInIsolatedWorldAndReturnValueCallback): Ditto.
+        (addOriginAccessWhitelistEntryCallback): Ditto.
+        (removeOriginAccessWhitelistEntryCallback): Ditto.
+        (setScrollbarPolicyCallback): Ditto.
+        (addUserScriptCallback): Ditto.
+        (addUserStyleSheetCallback): Ditto.
+        (apiTestNewWindowDataLoadBaseURLCallback): Ditto.
+        (authenticateSessionCallback): Ditto.
+        (getTitleTextDirectionCallback): Ditto.
+        (getInspectorTestStubURLCallback): Ditto.
+        (simulateLegacyWebNotificationClickCallback): Ditto.
+        (setTextDirectionCallback): Ditto.
+        (grantWebNotificationPermissionCallback): Ditto.
+        (denyWebNotificationPermissionCallback): Ditto.
+        (accummulateLogsForChannel): Ditto.
+        (runUIScriptCallback): Ditto.
+        (TestRunner::makeWindowObject): Ditto.
+        (TestRunner::uiScriptDidComplete): Ditto.
+        (TestRunner::setOpenPanelFiles): Ditto.
+
+        * DumpRenderTree/TestRunner.h: Use JSRetainPtr instead of
+        raw pointers for the results of the functions that create strings.
+
+        * DumpRenderTree/ios/AccessibilityControllerIOS.mm:
+        (AccessibilityController::platformName const): Use the adopt
+        function instead of the adopt constructor.
+
+        * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
+        (createEmptyJSString): Added. This helper function makes reduces the
+        repetitive code to create empty strings.
+        (concatenateAttributeAndValue): Changed to return a JSRetainPtr.
+        (AccessibilityUIElement::identifier): Ditto.
+        (AccessibilityUIElement::traits): Ditto.
+        (AccessibilityUIElement::url): Ditto.
+        (AccessibilityUIElement::speakAs): Ditto.
+        (AccessibilityUIElement::stringForSelection): Ditto.
+        (AccessibilityUIElement::stringForRange): Ditto.
+        (AccessibilityUIElement::attributedStringForRange): Ditto.
+        (AccessibilityUIElement::attributedStringForElement): Ditto.
+        (AccessibilityUIElement::pathDescription const): Ditto.
+        (AccessibilityUIElement::stringForTextMarkerRange): Ditto.
+        (AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
+        (AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
+        (AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
+        (AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
+        (AccessibilityUIElement::attributesOfChildren): Ditto.
+        (AccessibilityUIElement::allAttributes): Ditto.
+        (AccessibilityUIElement::stringAttributeValue): Ditto.
+        (AccessibilityUIElement::parameterizedAttributeNames): Ditto.
+        (AccessibilityUIElement::role): Ditto.
+        (AccessibilityUIElement::subrole): Ditto.
+        (AccessibilityUIElement::roleDescription): Ditto.
+        (AccessibilityUIElement::computedRoleString): Ditto.
+        (AccessibilityUIElement::title): Ditto.
+        (AccessibilityUIElement::description): Ditto.
+        (AccessibilityUIElement::orientation const): Ditto.
+        (AccessibilityUIElement::stringValue): Ditto.
+        (AccessibilityUIElement::language): Ditto.
+        (AccessibilityUIElement::helpText const): Ditto.
+        (AccessibilityUIElement::valueDescription): Ditto.
+        (AccessibilityUIElement::ariaDropEffects const): Ditto.
+        (AccessibilityUIElement::boundsForRange): Ditto.
+        (AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
+        (AccessibilityUIElement::attributesOfRowHeaders): Ditto.
+        (AccessibilityUIElement::attributesOfColumns): Ditto.
+        (AccessibilityUIElement::attributesOfRows): Ditto.
+        (AccessibilityUIElement::attributesOfVisibleCells): Ditto.
+        (AccessibilityUIElement::attributesOfHeader): Ditto.
+        (AccessibilityUIElement::rowIndexRange): Ditto.
+        (AccessibilityUIElement::columnIndexRange): Ditto.
+        (AccessibilityUIElement::selectedTextRange): Ditto.
+        (AccessibilityUIElement::accessibilityValue const): Ditto.
+        (AccessibilityUIElement::documentEncoding): Ditto.
+        (AccessibilityUIElement::documentURI): Ditto.
+        (AccessibilityUIElement::selectTextWithCriteria): Ditto.
+        (AccessibilityUIElement::classList const): Ditto.
+
+        * DumpRenderTree/mac/AccessibilityCommonMac.h: Changed the
+        createJSStringRef method to return a JSRetainPtr.
+        * DumpRenderTree/mac/AccessibilityCommonMac.mm:
+        (-[NSString createJSStringRef]): Ditto.
+        (searchPredicateParameterizedAttributeForSearchCriteria): Use the
+        adopt function instead of the adopt constructor.
+        * DumpRenderTree/mac/AccessibilityControllerMac.mm:
+        (AccessibilityController::platformName const): Ditto.
+
+        * DumpRenderTree/mac/AccessibilityNotificationHandler.mm:
+        (-[NSString createJSStringRef]): Return a JSRetainPtr.
+        (makeValueRefForValue): Updated for the above, no adopt needed here now.
+        (makeObjectRefForDictionary): Ditto.
+        (-[AccessibilityNotificationHandler _notificationReceived:]): Ditto.
+
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (createEmptyJSString): Added. This helper function makes reduces the
+        repetitive code to create empty strings.
+        (concatenateAttributeAndValue): Changed to return a JSRetainPtr.
+        (descriptionOfElements): Ditto.
+        (selectTextParameterizedAttributeForCriteria): Ditto.
+        (AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
+        (AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
+        (AccessibilityUIElement::attributesOfChildren): Ditto.
+        (AccessibilityUIElement::allAttributes): Ditto.
+        (AccessibilityUIElement::stringAttributeValue): Ditto.
+        (AccessibilityUIElement::parameterizedAttributeNames): Ditto.
+        (AccessibilityUIElement::role): Ditto.
+        (AccessibilityUIElement::subrole): Ditto.
+        (AccessibilityUIElement::roleDescription): Ditto.
+        (AccessibilityUIElement::computedRoleString): Ditto.
+        (AccessibilityUIElement::title): Ditto.
+        (AccessibilityUIElement::description): Ditto.
+        (AccessibilityUIElement::orientation const): Ditto.
+        (AccessibilityUIElement::stringValue): Ditto.
+        (AccessibilityUIElement::language): Ditto.
+        (AccessibilityUIElement::helpText const): Ditto.
+        (AccessibilityUIElement::valueDescription): Ditto.
+        (AccessibilityUIElement::speakAs): Ditto.
+        (AccessibilityUIElement::classList const): Ditto.
+        (AccessibilityUIElement::ariaDropEffects const): Ditto.
+        (AccessibilityUIElement::rangeForLine): Ditto.
+        (AccessibilityUIElement::rangeForPosition): Ditto.
+        (AccessibilityUIElement::boundsForRange): Ditto.
+        (AccessibilityUIElement::stringForRange): Ditto.
+        (AccessibilityUIElement::attributedStringForRange): Ditto.
+        (AccessibilityUIElement::selectTextWithCriteria): Ditto.
+        (AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
+        (AccessibilityUIElement::attributesOfRowHeaders): Ditto.
+        (AccessibilityUIElement::attributesOfColumns): Ditto.
+        (AccessibilityUIElement::attributesOfRows): Ditto.
+        (AccessibilityUIElement::attributesOfVisibleCells): Ditto.
+        (AccessibilityUIElement::attributesOfHeader): Ditto.
+        (AccessibilityUIElement::rowIndexRange): Ditto.
+        (AccessibilityUIElement::columnIndexRange): Ditto.
+        (AccessibilityUIElement::pathDescription const): Ditto.
+        (AccessibilityUIElement::selectedTextRange): Ditto.
+        (AccessibilityUIElement::accessibilityValue const): Ditto.
+        (AccessibilityUIElement::documentEncoding): Ditto.
+        (AccessibilityUIElement::documentURI): Ditto.
+        (AccessibilityUIElement::url): Ditto.
+        (AccessibilityUIElement::stringForTextMarkerRange): Ditto.
+        (createJSStringRef): Ditto.
+        (AccessibilityUIElement::attributedStringForTextMarkerRange): Ditto.
+        (AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions): Ditto.
+        (AccessibilityUIElement::supportedActions): Ditto.
+        (AccessibilityUIElement::mathPostscriptsDescription const): Ditto.
+        (AccessibilityUIElement::mathPrescriptsDescription const): Ditto.
+
+        * DumpRenderTree/mac/FrameLoadDelegate.mm:
+        (-[FrameLoadDelegate didClearWindowObjectForFrame:inIsolatedWorld:]):
+        Use the adopt function instead of the adopt constructor.
+        * DumpRenderTree/mac/TestRunnerMac.mm:
+        (originsArrayToJS): Ditto.
+        (TestRunner::copyDecodedHostName): Return a JSRetainPtr.
+        (TestRunner::copyEncodedHostName): Ditto.
+        (TestRunner::pathToLocalResource): Ditto.
+        (TestRunner::queueLoad): Use adopt function instead of constructor.
+        (TestRunner::findString): Ditto.
+        (TestRunner::inspectorTestStubURL): Return a JSRetainPtr.
+
+        * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+        (AccessibilityController::winNotificationReceived): Use adopt function
+        instead of adopt constructor.
+        (AccessibilityController::platformName const): Ditto.
+
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (createEmptyJSString): Added. This helper function makes reduces the
+        repetitive code to create empty strings.
+        (AccessibilityUIElement::allAttributes): Changed to return a JSRetainPtr.
+        (AccessibilityUIElement::attributesOfLinkedUIElements): Ditto.
+        (AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
+        (AccessibilityUIElement::attributesOfChildren): Ditto.
+        (AccessibilityUIElement::parameterizedAttributeNames): Ditto.
+        (AccessibilityUIElement::role): Ditto.
+        (AccessibilityUIElement::subrole): Ditto.
+        (AccessibilityUIElement::roleDescription): Ditto.
+        (AccessibilityUIElement::computedRoleString): Ditto.
+        (AccessibilityUIElement::title): Ditto.
+        (AccessibilityUIElement::description): Ditto.
+        (AccessibilityUIElement::stringValue): Ditto.
+        (AccessibilityUIElement::language): Ditto.
+        (AccessibilityUIElement::helpText const): Ditto.
+        (AccessibilityUIElement::valueDescription): Ditto.
+        (AccessibilityUIElement::ariaDropEffects const): Ditto.
+        (AccessibilityUIElement::orientation const): Ditto.
+        (AccessibilityUIElement::attributesOfColumnHeaders): Ditto.
+        (AccessibilityUIElement::attributesOfRowHeaders): Ditto.
+        (AccessibilityUIElement::attributesOfColumns): Ditto.
+        (AccessibilityUIElement::attributesOfRows): Ditto.
+        (AccessibilityUIElement::attributesOfVisibleCells): Ditto.
+        (AccessibilityUIElement::attributesOfHeader): Ditto.
+        (AccessibilityUIElement::rowIndexRange): Ditto.
+        (AccessibilityUIElement::columnIndexRange): Ditto.
+        (AccessibilityUIElement::boundsForRange): Ditto.
+        (AccessibilityUIElement::stringForRange): Ditto.
+        (AccessibilityUIElement::attributedStringForRange): Ditto.
+        (AccessibilityUIElement::selectTextWithCriteria): Ditto.
+        (AccessibilityUIElement::selectedTextRange): Ditto.
+        (AccessibilityUIElement::stringAttributeValue): Ditto.
+        (AccessibilityUIElement::accessibilityValue const): Ditto.
+        (AccessibilityUIElement::documentEncoding): Ditto.
+        (AccessibilityUIElement::documentURI): Ditto.
+        (AccessibilityUIElement::url): Ditto.
+        (AccessibilityUIElement::classList const): Ditto.
+
+        * DumpRenderTree/win/TestRunnerWin.cpp:
+        (TestRunner::copyDecodedHostName): Changed to return a JSRetainPtr.
+        (TestRunner::copyEncodedHostName): Ditto.
+        (TestRunner::pathToLocalResource): Ditto.
+        (TestRunner::queueLoad): Ditto.
+        (TestRunner::findString): Ditto.
+        (TestRunner::inspectorTestStubURL): Ditto.
+
+        * TestRunnerShared/Bindings/JSWrapper.h:
+        (WTR::setProperty): Use adopt function instead of constructor.
+        * TestRunnerShared/UIScriptContext/UIScriptContext.cpp:
+        (UIScriptContext::UIScriptContext): Ditto.
+        (UIScriptContext::runUIScript): Ditto.
+        * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+        (WTR::toDeviceOrientation): Ditto.
+
+        * TestRunnerShared/cocoa/LayoutTestSpellChecker.mm:
+        (nsTextCheckingType): Changed this function to not take an rvalue
+        reference to a JSRetainPtr since it doesn't take ownership.
+        (-[LayoutTestSpellChecker setResultsFromJSObject:inContext:]): Updated
+        for the above change.
+
+        * TestWebKitAPI/JavaScriptTest.cpp:
+        (TestWebKitAPI::javaScriptCallback): Use adopt function instead of
+        adopt member function.
+
+        * TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp: Removed unneeded include.
+        * TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm: Ditto.
+        * TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm: Use adopt function instead of
+        adopt constructor.
+        * TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm: Ditto.
+
+        * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
+        Removed unneeded includes.
+        * WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp: Ditto.
+        * WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp: Ditto.
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: Ditto.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
+        (_platformTypeConstructor): Use the adopt function instead of the
+        JSRetainPtr adopt constructor. Also nullptr instead of 0.
+
+        * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+        (WTR::arrayLength): Use adopt function instead of constructor.
+        (WTR::parseModifierArray): Ditto.
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::propertyValue): Ditto.
+        (WTR::dumpPath): Ditto.
+        (WTR::toJS): Ditto.
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::findString): Ditto.
+        (WTR::TestRunner::statisticsDidRunTelemetryCallback): Ditto.
+        (WTR::TestRunner::callDidReceiveAllStorageAccessEntriesCallback): Ditto.
+        (WTR::TestRunner::setOpenPanelFiles): Ditto.
+        * WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm:
+        (WTR::AccessibilityController::platformName): Ditto.
+
+        * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+        (-[NSString createJSStringRef]): Return a JSRetainPtr.
+        This fixes storage leaks in many functions below, which were using
+        the create function and putting the value right into a JSRetainPtr
+        without adoption.
+        (WTR::createEmptyJSString): Added. This helper function reduces the
+        repetitive code to create empty strings.
+        (WTR::concatenateAttributeAndValue): Return a JSRetainPtr.
+        (WTR::AccessibilityUIElement::attributesOfLinkedUIElements):
+        Use createEmptyJSString, fixing a storage leak due to missing adoption.
+        (WTR::AccessibilityUIElement::attributesOfDocumentLinks): Ditto.
+        (WTR::AccessibilityUIElement::attributesOfChildren): Ditto.
+        (WTR::AccessibilityUIElement::allAttributes): Ditto.
+        (WTR::AccessibilityUIElement::stringAttributeValue): Ditto.
+        (WTR::AccessibilityUIElement::parameterizedAttributeNames): Ditto.
+        (WTR::AccessibilityUIElement::role): Ditto.
+        (WTR::AccessibilityUIElement::subrole): Ditto.
+        (WTR::AccessibilityUIElement::roleDescription): Ditto.
+        (WTR::AccessibilityUIElement::computedRoleString): Ditto.
+        (WTR::AccessibilityUIElement::title): Ditto.
+        (WTR::AccessibilityUIElement::orientation const): Ditto.
+        (WTR::AccessibilityUIElement::language): Ditto.
+        (WTR::AccessibilityUIElement::valueDescription): Ditto.
+        (WTR::AccessibilityUIElement::ariaDropEffects const): Ditto.
+        (WTR::AccessibilityUIElement::boundsForRange): Ditto.
+        (WTR::AccessibilityUIElement::stringForRange): Removed unneeded null check.
+        (WTR::AccessibilityUIElement::attributedStringForRange): Ditto.
+        (WTR::AccessibilityUIElement::attributesOfColumnHeaders):
+        Use createEmptyJSString, fixing a storage leak due to missing adoption.
+        (WTR::AccessibilityUIElement::attributesOfRowHeaders): Ditto.
+        (WTR::AccessibilityUIElement::attributesOfColumns): Ditto.
+        (WTR::AccessibilityUIElement::attributesOfRows): Ditto.
+        (WTR::AccessibilityUIElement::attributesOfVisibleCells): Ditto.
+        (WTR::AccessibilityUIElement::attributesOfHeader): Ditto.
+        (WTR::AccessibilityUIElement::selectedTextRange): Ditto.
+        (WTR::AccessibilityUIElement::accessibilityValue const): Ditto.
+        (WTR::AccessibilityUIElement::documentEncoding): Ditto.
+        (WTR::AccessibilityUIElement::documentURI): Ditto.
+        (WTR::AccessibilityUIElement::stringForSelection): Removed unneeded
+        null check.
+        (WTR::AccessibilityUIElement::stringForTextMarkerRange):
+        Use createEmptyJSString, fixing a storage leak due to missing adoption.
+
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.h:
+        Use JSRetainPtr for the return value of createJSStringRef.
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm:
+        (-[NSString createJSStringRef]): Ditto.
+        (WTR::searchPredicateParameterizedAttributeForSearchCriteria): Use the
+        adopt function instead of the adopt constructor.
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:
+        (WTR::AccessibilityController::platformName): Ditto
+
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
+        (-[NSString createJSStringRef]): Return a JSRetainPtr.
+        (makeValueRefForValue): Updated for above by removing adopt.
+        (makeObjectRefForDictionary): Ditto.
+        (-[AccessibilityNotificationHandler _notificationReceived:]): Ditto.
+
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+        (WTR::createEmptyJSString): Added. This helper function makes reduces the
+        repetitive code to create empty strings.
+        (WTR::concatenateAttributeAndValue): Return a JSRetainPtr.
+        (WTR::descriptionOfElements): Ditto.
+        (WTR::selectTextParameterizedAttributeForCriteria): Ditto.
+        (WTR::AccessibilityUIElement::accessibilityValue const): Use createEmptyJSString,
+        fixing a storage leak due to missing adoption.
+        (WTR::AccessibilityUIElement::documentEncoding): Ditto.
+        (WTR::AccessibilityUIElement::documentURI): Ditto.
+        (WTR::createJSStringRef): Return a JSRetainPtr.
+
+        * WebKitTestRunner/StringFunctions.h:
+        (WTR::toWK): Take a const& to eliminate a little bit of reference count churn.
+        (WTR::toJS): Use the adopt function instead of the constructor.
+
</ins><span class="cx"> 2018-09-14  Dean Jackson  <dino@grorg.org>
</span><span class="cx"> 
</span><span class="cx">         Add Justin Michaud.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeAccessibilityControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/AccessibilityController.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/AccessibilityController.cpp   2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/AccessibilityController.cpp      2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include "AccessibilityController.h"
</span><span class="cx"> 
</span><span class="cx"> #include "AccessibilityUIElement.h"
</span><del>-#include <JavaScriptCore/JSRetainPtr.h>
</del><span class="cx"> 
</span><span class="cx"> // Static Value Getters
</span><span class="cx"> 
</span><span class="lines">@@ -50,7 +49,7 @@
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> accessibilityControllerStr(Adopt, JSStringCreateWithUTF8CString("accessibilityController"));
</del><ins>+    auto accessibilityControllerStr = adopt(JSStringCreateWithUTF8CString("accessibilityController"));
</ins><span class="cx">     
</span><span class="cx">     JSClassRef classRef = getJSClass();
</span><span class="cx">     JSValueRef accessibilityControllerObject = JSObjectMake(context, classRef, this);
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeAccessibilityTextMarkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/AccessibilityTextMarker.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/AccessibilityTextMarker.cpp   2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/AccessibilityTextMarker.cpp      2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include "AccessibilityTextMarker.h"
</span><span class="cx"> 
</span><span class="cx"> #include "AccessibilityUIElement.h"
</span><del>-#include <JavaScriptCore/JSRetainPtr.h>
</del><span class="cx"> 
</span><span class="cx"> // MARK: AccessibilityTextMarker
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeAccessibilityUIElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp    2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp       2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include "AccessibilityUIElement.h"
</span><span class="cx"> 
</span><span class="cx"> #include <JavaScriptCore/JSObjectRef.h>
</span><del>-#include <JavaScriptCore/JSRetainPtr.h>
</del><span class="cx"> #include <limits.h>
</span><span class="cx"> 
</span><span class="cx"> // Static Functions
</span><span class="lines">@@ -43,67 +42,67 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef allAttributesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> attributes(Adopt, toAXElement(thisObject)->allAttributes());
</del><ins>+    auto attributes = toAXElement(thisObject)->allAttributes();
</ins><span class="cx">     return JSValueMakeString(context, attributes.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef attributesOfLinkedUIElementsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> linkedUIDescription(Adopt, toAXElement(thisObject)->attributesOfLinkedUIElements());
</del><ins>+    auto linkedUIDescription = toAXElement(thisObject)->attributesOfLinkedUIElements();
</ins><span class="cx">     return JSValueMakeString(context, linkedUIDescription.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef attributesOfDocumentLinksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> linkedUIDescription(Adopt, toAXElement(thisObject)->attributesOfDocumentLinks());
</del><ins>+    auto linkedUIDescription = toAXElement(thisObject)->attributesOfDocumentLinks();
</ins><span class="cx">     return JSValueMakeString(context, linkedUIDescription.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef attributesOfChildrenCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> childrenDescription(Adopt, toAXElement(thisObject)->attributesOfChildren());
</del><ins>+    auto childrenDescription = toAXElement(thisObject)->attributesOfChildren();
</ins><span class="cx">     return JSValueMakeString(context, childrenDescription.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef parameterizedAttributeNamesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> parameterizedAttributeNames(Adopt, toAXElement(thisObject)->parameterizedAttributeNames());
</del><ins>+    auto parameterizedAttributeNames = toAXElement(thisObject)->parameterizedAttributeNames();
</ins><span class="cx">     return JSValueMakeString(context, parameterizedAttributeNames.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef attributesOfColumnHeadersCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> attributesOfColumnHeaders(Adopt, toAXElement(thisObject)->attributesOfColumnHeaders());
</del><ins>+    auto attributesOfColumnHeaders = toAXElement(thisObject)->attributesOfColumnHeaders();
</ins><span class="cx">     return JSValueMakeString(context, attributesOfColumnHeaders.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef attributesOfRowHeadersCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> attributesOfRowHeaders(Adopt, toAXElement(thisObject)->attributesOfRowHeaders());
</del><ins>+    auto attributesOfRowHeaders = toAXElement(thisObject)->attributesOfRowHeaders();
</ins><span class="cx">     return JSValueMakeString(context, attributesOfRowHeaders.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef attributesOfColumnsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> attributesOfColumns(Adopt, toAXElement(thisObject)->attributesOfColumns());
</del><ins>+    auto attributesOfColumns = toAXElement(thisObject)->attributesOfColumns();
</ins><span class="cx">     return JSValueMakeString(context, attributesOfColumns.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef attributesOfRowsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> attributesOfRows(Adopt, toAXElement(thisObject)->attributesOfRows());
</del><ins>+    auto attributesOfRows = toAXElement(thisObject)->attributesOfRows();
</ins><span class="cx">     return JSValueMakeString(context, attributesOfRows.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef attributesOfVisibleCellsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> attributesOfVisibleCells(Adopt, toAXElement(thisObject)->attributesOfVisibleCells());
</del><ins>+    auto attributesOfVisibleCells = toAXElement(thisObject)->attributesOfVisibleCells();
</ins><span class="cx">     return JSValueMakeString(context, attributesOfVisibleCells.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef attributesOfHeaderCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> attributesOfHeader(Adopt, toAXElement(thisObject)->attributesOfHeader());
</del><ins>+    auto attributesOfHeader = toAXElement(thisObject)->attributesOfHeader();
</ins><span class="cx">     return JSValueMakeString(context, attributesOfHeader.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -114,13 +113,13 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef rowIndexRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> rowIndexRange(Adopt, toAXElement(thisObject)->rowIndexRange());
</del><ins>+    auto rowIndexRange = toAXElement(thisObject)->rowIndexRange();
</ins><span class="cx">     return JSValueMakeString(context, rowIndexRange.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef columnIndexRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> columnIndexRange(Adopt, toAXElement(thisObject)->columnIndexRange());
</del><ins>+    auto columnIndexRange = toAXElement(thisObject)->columnIndexRange();
</ins><span class="cx">     return JSValueMakeString(context, columnIndexRange.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -139,7 +138,7 @@
</span><span class="cx">     if (argumentCount == 1)
</span><span class="cx">         indexNumber = JSValueToNumber(context, arguments[0], exception);
</span><span class="cx">     
</span><del>-    JSRetainPtr<JSStringRef> rangeLine(Adopt, toAXElement(thisObject)->rangeForLine(indexNumber));
</del><ins>+    auto rangeLine = toAXElement(thisObject)->rangeForLine(indexNumber);
</ins><span class="cx">     return JSValueMakeString(context, rangeLine.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -151,7 +150,7 @@
</span><span class="cx">         length = JSValueToNumber(context, arguments[1], exception);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> boundsDescription(Adopt, toAXElement(thisObject)->boundsForRange(location, length));
</del><ins>+    auto boundsDescription = toAXElement(thisObject)->boundsForRange(location, length);
</ins><span class="cx">     return JSValueMakeString(context, boundsDescription.get());    
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -163,7 +162,7 @@
</span><span class="cx">         y = JSValueToNumber(context, arguments[1], exception);
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    JSRetainPtr<JSStringRef> rangeDescription(Adopt, toAXElement(thisObject)->rangeForPosition(x, y));
</del><ins>+    auto rangeDescription = toAXElement(thisObject)->rangeForPosition(x, y);
</ins><span class="cx">     return JSValueMakeString(context, rangeDescription.get());    
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -175,7 +174,7 @@
</span><span class="cx">         length = JSValueToNumber(context, arguments[1], exception);
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    JSRetainPtr<JSStringRef> stringDescription(Adopt, toAXElement(thisObject)->stringForRange(location, length));
</del><ins>+    auto stringDescription = toAXElement(thisObject)->stringForRange(location, length);
</ins><span class="cx">     return JSValueMakeString(context, stringDescription.get());    
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -187,7 +186,7 @@
</span><span class="cx">         length = JSValueToNumber(context, arguments[1], exception);
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    JSRetainPtr<JSStringRef> stringDescription(Adopt, toAXElement(thisObject)->attributedStringForRange(location, length));
</del><ins>+    auto stringDescription = toAXElement(thisObject)->attributedStringForRange(location, length);
</ins><span class="cx">     return JSValueMakeString(context, stringDescription.get());    
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -219,7 +218,7 @@
</span><span class="cx">         searchKey = arguments[2];
</span><span class="cx">         
</span><span class="cx">         if (JSValueIsString(context, arguments[3]))
</span><del>-            searchText.adopt(JSValueToStringCopy(context, arguments[3], exception));
</del><ins>+            searchText = adopt(JSValueToStringCopy(context, arguments[3], exception));
</ins><span class="cx">         
</span><span class="cx">         visibleOnly = JSValueToBoolean(context, arguments[4]);
</span><span class="cx">         
</span><span class="lines">@@ -247,7 +246,7 @@
</span><span class="cx">         searchKey = arguments[2];
</span><span class="cx">         
</span><span class="cx">         if (JSValueIsString(context, arguments[3]))
</span><del>-            searchText.adopt(JSValueToStringCopy(context, arguments[3], exception));
</del><ins>+            searchText = adopt(JSValueToStringCopy(context, arguments[3], exception));
</ins><span class="cx">         
</span><span class="cx">         visibleOnly = JSValueToBoolean(context, arguments[4]);
</span><span class="cx">         
</span><span class="lines">@@ -263,7 +262,7 @@
</span><span class="cx">     if (argumentCount < 2 || argumentCount > 4)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx">     
</span><del>-    JSRetainPtr<JSStringRef> ambiguityResolution(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto ambiguityResolution = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     JSValueRef searchStrings = arguments[1];
</span><span class="cx">     JSStringRef replacementString = nullptr;
</span><span class="cx">     if (argumentCount == 3)
</span><span class="lines">@@ -272,7 +271,7 @@
</span><span class="cx">     if (argumentCount == 4)
</span><span class="cx">         activityString = JSValueToStringCopy(context, arguments[3], exception);
</span><span class="cx">     
</span><del>-    JSRetainPtr<JSStringRef> result(Adopt, toAXElement(thisObject)->selectTextWithCriteria(context, ambiguityResolution.get(), searchStrings, replacementString, activityString));
</del><ins>+    auto result = toAXElement(thisObject)->selectTextWithCriteria(context, ambiguityResolution.get(), searchStrings, replacementString, activityString);
</ins><span class="cx">     if (replacementString)
</span><span class="cx">         JSStringRelease(replacementString);
</span><span class="cx">     if (activityString)
</span><span class="lines">@@ -371,7 +370,7 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef attributedStringForElementCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> stringDescription(Adopt, toAXElement(thisObject)->attributedStringForElement());
</del><ins>+    auto stringDescription = toAXElement(thisObject)->attributedStringForElement();
</ins><span class="cx">     return JSValueMakeString(context, stringDescription.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -474,7 +473,7 @@
</span><span class="cx">     JSRetainPtr<JSStringRef> valueText = 0;
</span><span class="cx">     if (argumentCount == 1) {
</span><span class="cx">         if (JSValueIsString(context, arguments[0]))
</span><del>-            valueText.adopt(JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+            valueText = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     toAXElement(thisObject)->setValue(valueText.get());
</span><span class="lines">@@ -591,7 +590,7 @@
</span><span class="cx">     JSStringRef attribute = 0;
</span><span class="cx">     if (argumentCount == 1)
</span><span class="cx">         attribute = JSValueToStringCopy(context, arguments[0], exception);
</span><del>-    JSRetainPtr<JSStringRef> stringAttributeValue(Adopt, toAXElement(thisObject)->stringAttributeValue(attribute));
</del><ins>+    auto stringAttributeValue = toAXElement(thisObject)->stringAttributeValue(attribute);
</ins><span class="cx">     JSValueRef result = JSValueMakeString(context, stringAttributeValue.get());
</span><span class="cx">     if (attribute)
</span><span class="cx">         JSStringRelease(attribute);
</span><span class="lines">@@ -629,7 +628,7 @@
</span><span class="cx">     if (argumentCount != 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx">     
</span><del>-    JSRetainPtr<JSStringRef> attribute(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto attribute = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     
</span><span class="cx">     Vector<AccessibilityUIElement> elements;
</span><span class="cx">     toAXElement(thisObject)->uiElementArrayAttributeValue(attribute.get(), elements);
</span><span class="lines">@@ -640,7 +639,7 @@
</span><span class="cx"> {
</span><span class="cx">     JSRetainPtr<JSStringRef> attribute;
</span><span class="cx">     if (argumentCount == 1)
</span><del>-        attribute.adopt(JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+        attribute = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     
</span><span class="cx">     return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->uiElementAttributeValue(attribute.get()));
</span><span class="cx"> }
</span><span class="lines">@@ -883,7 +882,7 @@
</span><span class="cx">     if (argumentCount == 1)
</span><span class="cx">         markerRange = toTextMarkerRange(JSValueToObject(context, arguments[0], exception));
</span><span class="cx">     
</span><del>-    JSRetainPtr<JSStringRef> markerRangeString(Adopt, toAXElement(thisObject)->stringForTextMarkerRange(markerRange));
</del><ins>+    auto markerRangeString = toAXElement(thisObject)->stringForTextMarkerRange(markerRange);
</ins><span class="cx">     return JSValueMakeString(context, markerRangeString.get());    
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -893,7 +892,7 @@
</span><span class="cx">     if (argumentCount == 1)
</span><span class="cx">         markerRange = toTextMarkerRange(JSValueToObject(context, arguments[0], exception));
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> markerRangeString(Adopt, toAXElement(thisObject)->attributedStringForTextMarkerRange(markerRange));
</del><ins>+    auto markerRangeString = toAXElement(thisObject)->attributedStringForTextMarkerRange(markerRange);
</ins><span class="cx">     return JSValueMakeString(context, markerRangeString.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -906,7 +905,7 @@
</span><span class="cx">         includeSpellCheck = JSValueToBoolean(context, arguments[1]);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> markerRangeString(Adopt, toAXElement(thisObject)->attributedStringForTextMarkerRangeWithOptions(markerRange, includeSpellCheck));
</del><ins>+    auto markerRangeString = toAXElement(thisObject)->attributedStringForTextMarkerRangeWithOptions(markerRange, includeSpellCheck);
</ins><span class="cx">     return JSValueMakeString(context, markerRangeString.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1110,13 +1109,13 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getARIADropEffectsCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> dropEffects(Adopt, toAXElement(thisObject)->ariaDropEffects());
</del><ins>+    auto dropEffects = toAXElement(thisObject)->ariaDropEffects();
</ins><span class="cx">     return JSValueMakeString(context, dropEffects.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getClassListCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> classList(Adopt, toAXElement(thisObject)->classList());
</del><ins>+    auto classList = toAXElement(thisObject)->classList();
</ins><span class="cx">     return JSValueMakeString(context, classList.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1138,61 +1137,61 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getRoleCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> role(Adopt, toAXElement(thisObject)->role());
</del><ins>+    auto role = toAXElement(thisObject)->role();
</ins><span class="cx">     return JSValueMakeString(context, role.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getSubroleCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> role(Adopt, toAXElement(thisObject)->subrole());
</del><ins>+    auto role = toAXElement(thisObject)->subrole();
</ins><span class="cx">     return JSValueMakeString(context, role.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getRoleDescriptionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> roleDesc(Adopt, toAXElement(thisObject)->roleDescription());
</del><ins>+    auto roleDesc = toAXElement(thisObject)->roleDescription();
</ins><span class="cx">     return JSValueMakeString(context, roleDesc.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getComputedRoleStringCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> compRole(Adopt, toAXElement(thisObject)->computedRoleString());
</del><ins>+    auto compRole = toAXElement(thisObject)->computedRoleString();
</ins><span class="cx">     return JSValueMakeString(context, compRole.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getTitleCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> title(Adopt, toAXElement(thisObject)->title());
</del><ins>+    auto title = toAXElement(thisObject)->title();
</ins><span class="cx">     return JSValueMakeString(context, title.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getDescriptionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> description(Adopt, toAXElement(thisObject)->description());
</del><ins>+    auto description = toAXElement(thisObject)->description();
</ins><span class="cx">     return JSValueMakeString(context, description.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getStringValueCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> stringValue(Adopt, toAXElement(thisObject)->stringValue());
</del><ins>+    auto stringValue = toAXElement(thisObject)->stringValue();
</ins><span class="cx">     return JSValueMakeString(context, stringValue.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getLanguageCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> language(Adopt, toAXElement(thisObject)->language());
</del><ins>+    auto language = toAXElement(thisObject)->language();
</ins><span class="cx">     return JSValueMakeString(context, language.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getHelpTextCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> language(Adopt, toAXElement(thisObject)->helpText());
</del><ins>+    auto language = toAXElement(thisObject)->helpText();
</ins><span class="cx">     return JSValueMakeString(context, language.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getOrientationCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> orientation(Adopt, toAXElement(thisObject)->orientation());
</del><ins>+    auto orientation = toAXElement(thisObject)->orientation();
</ins><span class="cx">     return JSValueMakeString(context, orientation.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1263,13 +1262,13 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getPathDescriptionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> pathDescription(Adopt, toAXElement(thisObject)->pathDescription());
</del><ins>+    auto pathDescription = toAXElement(thisObject)->pathDescription();
</ins><span class="cx">     return JSValueMakeString(context, pathDescription.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getSelectedTextRangeCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> selectedTextRange(Adopt, toAXElement(thisObject)->selectedTextRange());
</del><ins>+    auto selectedTextRange = toAXElement(thisObject)->selectedTextRange();
</ins><span class="cx">     return JSValueMakeString(context, selectedTextRange.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1350,7 +1349,7 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef speakAsCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> speakAsString(Adopt, toAXElement(thisObject)->speakAs());
</del><ins>+    auto speakAsString = toAXElement(thisObject)->speakAs();
</ins><span class="cx">     return JSValueMakeString(context, speakAsString.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1381,31 +1380,31 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getValueDescriptionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> valueDescription(Adopt, toAXElement(thisObject)->valueDescription());
</del><ins>+    auto valueDescription = toAXElement(thisObject)->valueDescription();
</ins><span class="cx">     return JSValueMakeString(context, valueDescription.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getAccessibilityValueCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> accessibilityValue(Adopt, toAXElement(thisObject)->accessibilityValue());
</del><ins>+    auto accessibilityValue = toAXElement(thisObject)->accessibilityValue();
</ins><span class="cx">     return JSValueMakeString(context, accessibilityValue.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getDocumentEncodingCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> documentEncoding(Adopt, toAXElement(thisObject)->documentEncoding());
</del><ins>+    auto documentEncoding = toAXElement(thisObject)->documentEncoding();
</ins><span class="cx">     return JSValueMakeString(context, documentEncoding.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getDocumentURICallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> documentURI(Adopt, toAXElement(thisObject)->documentURI());
</del><ins>+    auto documentURI = toAXElement(thisObject)->documentURI();
</ins><span class="cx">     return JSValueMakeString(context, documentURI.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getURLCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> url(Adopt, toAXElement(thisObject)->url());
</del><ins>+    auto url = toAXElement(thisObject)->url();
</ins><span class="cx">     return JSValueMakeString(context, url.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1432,7 +1431,7 @@
</span><span class="cx">     if (argumentCount == 1)
</span><span class="cx">         offset = JSValueToNumber(context, arguments[0], exception);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> characterAtOffset(Adopt, toAXElement(thisObject)->characterAtOffset(offset));
</del><ins>+    auto characterAtOffset = toAXElement(thisObject)->characterAtOffset(offset);
</ins><span class="cx">     return JSValueMakeString(context, characterAtOffset.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1442,7 +1441,7 @@
</span><span class="cx">     if (argumentCount == 1)
</span><span class="cx">         offset = JSValueToNumber(context, arguments[0], exception);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> wordAtOffset(Adopt, toAXElement(thisObject)->wordAtOffset(offset));
</del><ins>+    auto wordAtOffset = toAXElement(thisObject)->wordAtOffset(offset);
</ins><span class="cx">     return JSValueMakeString(context, wordAtOffset.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1452,7 +1451,7 @@
</span><span class="cx">     if (argumentCount == 1)
</span><span class="cx">         offset = JSValueToNumber(context, arguments[0], exception);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> lineAtOffset(Adopt, toAXElement(thisObject)->lineAtOffset(offset));
</del><ins>+    auto lineAtOffset = toAXElement(thisObject)->lineAtOffset(offset);
</ins><span class="cx">     return JSValueMakeString(context, lineAtOffset.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1462,7 +1461,7 @@
</span><span class="cx">     if (argumentCount == 1)
</span><span class="cx">         offset = JSValueToNumber(context, arguments[0], exception);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> sentenceAtOffset(Adopt, toAXElement(thisObject)->sentenceAtOffset(offset));
</del><ins>+    auto sentenceAtOffset = toAXElement(thisObject)->sentenceAtOffset(offset);
</ins><span class="cx">     return JSValueMakeString(context, sentenceAtOffset.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1480,13 +1479,13 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef stringForSelectionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> labelString(Adopt, toAXElement(thisObject)->stringForSelection());
</del><ins>+    auto labelString = toAXElement(thisObject)->stringForSelection();
</ins><span class="cx">     return JSValueMakeString(context, labelString.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getIdentifierCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> valueString(Adopt, toAXElement(thisObject)->identifier());
</del><ins>+    auto valueString = toAXElement(thisObject)->identifier();
</ins><span class="cx">     return JSValueMakeString(context, valueString.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1493,7 +1492,7 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef getTraitsCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> valueString(Adopt, toAXElement(thisObject)->traits());
</del><ins>+    auto valueString = toAXElement(thisObject)->traits();
</ins><span class="cx">     return JSValueMakeString(context, valueString.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1534,19 +1533,19 @@
</span><span class="cx"> #if PLATFORM(MAC) && !PLATFORM(IOS)
</span><span class="cx"> static JSValueRef supportedActionsCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> valueString(Adopt, toAXElement(thisObject)->supportedActions());
</del><ins>+    auto valueString = toAXElement(thisObject)->supportedActions();
</ins><span class="cx">     return JSValueMakeString(context, valueString.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef mathPostscriptsDescriptionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> valueString(Adopt, toAXElement(thisObject)->mathPostscriptsDescription());
</del><ins>+    auto valueString = toAXElement(thisObject)->mathPostscriptsDescription();
</ins><span class="cx">     return JSValueMakeString(context, valueString.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef mathPrescriptsDescriptionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> valueString(Adopt, toAXElement(thisObject)->mathPrescriptsDescription());
</del><ins>+    auto valueString = toAXElement(thisObject)->mathPrescriptsDescription();
</ins><span class="cx">     return JSValueMakeString(context, valueString.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1556,8 +1555,8 @@
</span><span class="cx"> 
</span><span class="cx"> // Unsupported methods on various platforms.
</span><span class="cx"> #if !PLATFORM(MAC) || PLATFORM(IOS)
</span><del>-JSStringRef AccessibilityUIElement::rangeForLine(int line) { return 0; }
-JSStringRef AccessibilityUIElement::rangeForPosition(int, int) { return 0; }
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int line) { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForPosition(int, int) { return 0; }
</ins><span class="cx"> void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement*) const { }
</span><span class="cx"> void AccessibilityUIElement::setSelectedChildAtIndex(unsigned) const { }
</span><span class="cx"> void AccessibilityUIElement::removeSelectionAtIndex(unsigned) const { }
</span><span class="lines">@@ -1567,8 +1566,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(MAC) && !PLATFORM(IOS)
</span><del>-JSStringRef AccessibilityUIElement::speakAs() { return nullptr; }
-JSStringRef AccessibilityUIElement::pathDescription() const { return 0; }
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::speakAs() { return nullptr; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::pathDescription() const { return 0; }
</ins><span class="cx"> void AccessibilityUIElement::setValue(JSStringRef) { }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -1660,17 +1659,17 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange*)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange*)
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributedStringForTextMarkerRange(AccessibilityTextMarkerRange*)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForTextMarkerRange(AccessibilityTextMarkerRange*)
</ins><span class="cx"> {
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions(AccessibilityTextMarkerRange*, bool includeSpellCheck)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions(AccessibilityTextMarkerRange*, bool includeSpellCheck)
</ins><span class="cx"> {
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.h (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.h      2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.h 2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -23,11 +23,11 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef AccessibilityUIElement_h
-#define AccessibilityUIElement_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include "AccessibilityTextMarker.h"
</span><span class="cx"> #include <JavaScriptCore/JSObjectRef.h>
</span><ins>+#include <JavaScriptCore/JSRetainPtr.h>
</ins><span class="cx"> #include <wtf/Platform.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> 
</span><span class="lines">@@ -91,13 +91,13 @@
</span><span class="cx">     void removeSelection();
</span><span class="cx"> 
</span><span class="cx">     // Methods - platform-independent implementations
</span><del>-    JSStringRef allAttributes();
-    JSStringRef attributesOfLinkedUIElements();
</del><ins>+    JSRetainPtr<JSStringRef> allAttributes();
+    JSRetainPtr<JSStringRef> attributesOfLinkedUIElements();
</ins><span class="cx">     AccessibilityUIElement linkedUIElementAtIndex(unsigned);
</span><span class="cx">     
</span><del>-    JSStringRef attributesOfDocumentLinks();
-    JSStringRef attributesOfChildren();
-    JSStringRef parameterizedAttributeNames();
</del><ins>+    JSRetainPtr<JSStringRef> attributesOfDocumentLinks();
+    JSRetainPtr<JSStringRef> attributesOfChildren();
+    JSRetainPtr<JSStringRef> parameterizedAttributeNames();
</ins><span class="cx">     void increment();
</span><span class="cx">     void decrement();
</span><span class="cx">     void showMenu();
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx">     void press();
</span><span class="cx"> 
</span><span class="cx">     // Attributes - platform-independent implementations
</span><del>-    JSStringRef stringAttributeValue(JSStringRef attribute);
</del><ins>+    JSRetainPtr<JSStringRef> stringAttributeValue(JSStringRef attribute);
</ins><span class="cx">     double numberAttributeValue(JSStringRef attribute);
</span><span class="cx">     void uiElementArrayAttributeValue(JSStringRef attribute, Vector<AccessibilityUIElement>& elements) const;
</span><span class="cx">     AccessibilityUIElement uiElementAttributeValue(JSStringRef attribute) const;    
</span><span class="lines">@@ -115,18 +115,18 @@
</span><span class="cx">     bool isPressActionSupported();
</span><span class="cx">     bool isIncrementActionSupported();
</span><span class="cx">     bool isDecrementActionSupported();
</span><del>-    JSStringRef role();
-    JSStringRef subrole();
-    JSStringRef roleDescription();
-    JSStringRef computedRoleString();
-    JSStringRef title();
-    JSStringRef description();
-    JSStringRef language();
-    JSStringRef stringValue();
-    JSStringRef accessibilityValue() const;
</del><ins>+    JSRetainPtr<JSStringRef> role();
+    JSRetainPtr<JSStringRef> subrole();
+    JSRetainPtr<JSStringRef> roleDescription();
+    JSRetainPtr<JSStringRef> computedRoleString();
+    JSRetainPtr<JSStringRef> title();
+    JSRetainPtr<JSStringRef> description();
+    JSRetainPtr<JSStringRef> language();
+    JSRetainPtr<JSStringRef> stringValue();
+    JSRetainPtr<JSStringRef> accessibilityValue() const;
</ins><span class="cx">     void setValue(JSStringRef);
</span><del>-    JSStringRef helpText() const;
-    JSStringRef orientation() const;
</del><ins>+    JSRetainPtr<JSStringRef> helpText() const;
+    JSRetainPtr<JSStringRef> orientation() const;
</ins><span class="cx">     double x();
</span><span class="cx">     double y();
</span><span class="cx">     double width();
</span><span class="lines">@@ -134,10 +134,10 @@
</span><span class="cx">     double intValue() const;
</span><span class="cx">     double minValue();
</span><span class="cx">     double maxValue();
</span><del>-    JSStringRef pathDescription() const;
-    JSStringRef valueDescription();
</del><ins>+    JSRetainPtr<JSStringRef> pathDescription() const;
+    JSRetainPtr<JSStringRef> valueDescription();
</ins><span class="cx">     int insertionPointLineNumber();
</span><del>-    JSStringRef selectedTextRange();
</del><ins>+    JSRetainPtr<JSStringRef> selectedTextRange();
</ins><span class="cx">     bool isEnabled();
</span><span class="cx">     bool isRequired() const;
</span><span class="cx">     
</span><span class="lines">@@ -167,24 +167,24 @@
</span><span class="cx">     int hierarchicalLevel() const;
</span><span class="cx">     double clickPointX();
</span><span class="cx">     double clickPointY();
</span><del>-    JSStringRef documentEncoding();
-    JSStringRef documentURI();
-    JSStringRef url();
-    JSStringRef classList() const;
</del><ins>+    JSRetainPtr<JSStringRef> documentEncoding();
+    JSRetainPtr<JSStringRef> documentURI();
+    JSRetainPtr<JSStringRef> url();
+    JSRetainPtr<JSStringRef> classList() const;
</ins><span class="cx"> 
</span><span class="cx">     // CSS3-speech properties.
</span><del>-    JSStringRef speakAs();
</del><ins>+    JSRetainPtr<JSStringRef> speakAs();
</ins><span class="cx">     
</span><span class="cx">     // Table-specific attributes
</span><del>-    JSStringRef attributesOfColumnHeaders();
-    JSStringRef attributesOfRowHeaders();
-    JSStringRef attributesOfColumns();
-    JSStringRef attributesOfRows();
-    JSStringRef attributesOfVisibleCells();
-    JSStringRef attributesOfHeader();
</del><ins>+    JSRetainPtr<JSStringRef> attributesOfColumnHeaders();
+    JSRetainPtr<JSStringRef> attributesOfRowHeaders();
+    JSRetainPtr<JSStringRef> attributesOfColumns();
+    JSRetainPtr<JSStringRef> attributesOfRows();
+    JSRetainPtr<JSStringRef> attributesOfVisibleCells();
+    JSRetainPtr<JSStringRef> attributesOfHeader();
</ins><span class="cx">     int indexInTable();
</span><del>-    JSStringRef rowIndexRange();
-    JSStringRef columnIndexRange();
</del><ins>+    JSRetainPtr<JSStringRef> rowIndexRange();
+    JSRetainPtr<JSStringRef> columnIndexRange();
</ins><span class="cx">     int rowCount();
</span><span class="cx">     int columnCount();
</span><span class="cx">     void rowHeaders(Vector<AccessibilityUIElement>& elements) const;
</span><span class="lines">@@ -204,23 +204,23 @@
</span><span class="cx">     // ARIA Drag and Drop
</span><span class="cx">     bool ariaIsGrabbed() const;
</span><span class="cx">     // A space concatentated string of all the drop effects.
</span><del>-    JSStringRef ariaDropEffects() const;
</del><ins>+    JSRetainPtr<JSStringRef> ariaDropEffects() const;
</ins><span class="cx">     
</span><span class="cx">     // Parameterized attributes
</span><span class="cx">     int lineForIndex(int);
</span><del>-    JSStringRef rangeForLine(int);
-    JSStringRef rangeForPosition(int x, int y);
-    JSStringRef boundsForRange(unsigned location, unsigned length);
</del><ins>+    JSRetainPtr<JSStringRef> rangeForLine(int);
+    JSRetainPtr<JSStringRef> rangeForPosition(int x, int y);
+    JSRetainPtr<JSStringRef> boundsForRange(unsigned location, unsigned length);
</ins><span class="cx">     void setSelectedTextRange(unsigned location, unsigned length);
</span><del>-    JSStringRef stringForRange(unsigned location, unsigned length);
-    JSStringRef attributedStringForRange(unsigned location, unsigned length);
</del><ins>+    JSRetainPtr<JSStringRef> stringForRange(unsigned location, unsigned length);
+    JSRetainPtr<JSStringRef> attributedStringForRange(unsigned location, unsigned length);
</ins><span class="cx">     bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
</span><span class="cx">     unsigned uiElementCountForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly);
</span><span class="cx">     AccessibilityUIElement uiElementForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly);
</span><del>-    JSStringRef selectTextWithCriteria(JSContextRef, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity);
</del><ins>+    JSRetainPtr<JSStringRef> selectTextWithCriteria(JSContextRef, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity);
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     void elementsForRange(unsigned location, unsigned length, Vector<AccessibilityUIElement>& elements);
</span><del>-    JSStringRef stringForSelection();
</del><ins>+    JSRetainPtr<JSStringRef> stringForSelection();
</ins><span class="cx">     void increaseTextSelection();
</span><span class="cx">     void decreaseTextSelection();
</span><span class="cx">     AccessibilityUIElement linkedElement();
</span><span class="lines">@@ -232,15 +232,15 @@
</span><span class="cx">     
</span><span class="cx">     bool hasContainedByFieldsetTrait();
</span><span class="cx">     AccessibilityUIElement fieldsetAncestorElement();
</span><del>-    JSStringRef attributedStringForElement();
</del><ins>+    JSRetainPtr<JSStringRef> attributedStringForElement();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK)
</span><span class="cx">     // Text-specific
</span><del>-    JSStringRef characterAtOffset(int offset);
-    JSStringRef wordAtOffset(int offset);
-    JSStringRef lineAtOffset(int offset);
-    JSStringRef sentenceAtOffset(int offset);
</del><ins>+    JSRetainPtr<JSStringRef> characterAtOffset(int offset);
+    JSRetainPtr<JSStringRef> wordAtOffset(int offset);
+    JSRetainPtr<JSStringRef> lineAtOffset(int offset);
+    JSRetainPtr<JSStringRef> sentenceAtOffset(int offset);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // Table-specific
</span><span class="lines">@@ -278,9 +278,9 @@
</span><span class="cx">     void resetSelectedTextMarkerRange();
</span><span class="cx">     bool setSelectedVisibleTextRange(AccessibilityTextMarkerRange*);
</span><span class="cx">     
</span><del>-    JSStringRef stringForTextMarkerRange(AccessibilityTextMarkerRange*);
-    JSStringRef attributedStringForTextMarkerRange(AccessibilityTextMarkerRange*);
-    JSStringRef attributedStringForTextMarkerRangeWithOptions(AccessibilityTextMarkerRange*, bool includeSpellCheck);
</del><ins>+    JSRetainPtr<JSStringRef> stringForTextMarkerRange(AccessibilityTextMarkerRange*);
+    JSRetainPtr<JSStringRef> attributedStringForTextMarkerRange(AccessibilityTextMarkerRange*);
+    JSRetainPtr<JSStringRef> attributedStringForTextMarkerRangeWithOptions(AccessibilityTextMarkerRange*, bool includeSpellCheck);
</ins><span class="cx">     int textMarkerRangeLength(AccessibilityTextMarkerRange*);
</span><span class="cx">     bool attributedStringForTextMarkerRangeContainsAttribute(JSStringRef, AccessibilityTextMarkerRange*);
</span><span class="cx">     int indexForTextMarker(AccessibilityTextMarker*);
</span><span class="lines">@@ -298,8 +298,8 @@
</span><span class="cx">     void removeNotificationListener();
</span><span class="cx">     
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    JSStringRef traits();
-    JSStringRef identifier();
</del><ins>+    JSRetainPtr<JSStringRef> traits();
+    JSRetainPtr<JSStringRef> identifier();
</ins><span class="cx">     int elementTextPosition();
</span><span class="cx">     int elementTextLength();
</span><span class="cx">     AccessibilityUIElement headerElementAtIndex(unsigned);
</span><span class="lines">@@ -315,11 +315,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) && !PLATFORM(IOS)
</span><span class="cx">     // Returns an ordered list of supported actions for an element.
</span><del>-    JSStringRef supportedActions();
</del><ins>+    JSRetainPtr<JSStringRef> supportedActions();
</ins><span class="cx">     
</span><span class="cx">     // A general description of the elements making up multiscript pre/post objects.
</span><del>-    JSStringRef mathPostscriptsDescription() const;
-    JSStringRef mathPrescriptsDescription() const;
</del><ins>+    JSRetainPtr<JSStringRef> mathPostscriptsDescription() const;
+    JSRetainPtr<JSStringRef> mathPrescriptsDescription() const;
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx"> private:
</span><span class="lines">@@ -335,5 +335,3 @@
</span><span class="cx">     RefPtr<AccessibilityNotificationHandler> m_notificationHandler;
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><del>-
-#endif // AccessibilityUIElement_h
</del></span></pre></div>
<a id="trunkToolsDumpRenderTreeBindingsCodeGeneratorDumpRenderTreepm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm       2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/Bindings/CodeGeneratorDumpRenderTree.pm  2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -434,8 +434,8 @@
</span><span class="cx">     return "JSValueToNullableBoolean(context, $argumentName)" if $type->name eq "boolean" && $type->isNullable;
</span><span class="cx">     return "JSValueToBoolean(context, $argumentName)" if $type->name eq "boolean";
</span><span class="cx">     return "$argumentName" if $type->name eq "object";
</span><del>-    return "JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, $argumentName, 0))" if $$self{codeGenerator}->IsStringType($type);
-    return "JSValueToNumber(context, $argumentName, 0)" if $$self{codeGenerator}->IsPrimitiveType($type);
</del><ins>+    return "adopt(JSValueToStringCopy(context, $argumentName, nullptr))" if $$self{codeGenerator}->IsStringType($type);
+    return "JSValueToNumber(context, $argumentName, nullptr)" if $$self{codeGenerator}->IsPrimitiveType($type);
</ins><span class="cx">     return "to" . _implementationClassName($type) . "(context, $argumentName)";
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeGCControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/GCController.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/GCController.cpp      2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/GCController.cpp 2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx"> 
</span><span class="cx"> void GCController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> gcControllerStr(Adopt, JSStringCreateWithUTF8CString("GCController"));
</del><ins>+    auto gcControllerStr = adopt(JSStringCreateWithUTF8CString("GCController"));
</ins><span class="cx"> 
</span><span class="cx">     JSClassRef classRef = getJSClass();
</span><span class="cx">     JSValueRef gcControllerObject = JSObjectMake(context, classRef, this);
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/TestRunner.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/TestRunner.cpp        2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/TestRunner.cpp   2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -289,10 +289,10 @@
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><del>-    JSRetainPtr<JSStringRef> localPath(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto localPath = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> convertedPath(Adopt, controller->pathToLocalResource(context, localPath.get()));
</del><ins>+    auto convertedPath = controller->pathToLocalResource(context, localPath.get());
</ins><span class="cx">     if (!convertedPath)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><span class="lines">@@ -383,7 +383,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> url(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto url = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -397,10 +397,10 @@
</span><span class="cx">     if (argumentCount < 2)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> origin(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto origin = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> destination(Adopt, JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+    auto destination = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     size_t maxLength = JSStringGetMaximumUTF8CStringSize(origin.get());
</span><span class="lines">@@ -439,7 +439,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> originURL(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto originURL = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -453,7 +453,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> originURL(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto originURL = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx">     
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -500,11 +500,11 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto name = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><del>-    JSRetainPtr<JSStringRef> decodedHostName(Adopt, controller->copyDecodedHostName(name.get()));
</del><ins>+    auto decodedHostName = controller->copyDecodedHostName(name.get());
</ins><span class="cx">     return JSValueMakeString(context, decodedHostName.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -541,11 +541,11 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto name = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><del>-    JSRetainPtr<JSStringRef> encodedHostName(Adopt, controller->copyEncodedHostName(name.get()));
</del><ins>+    auto encodedHostName = controller->copyEncodedHostName(name.get());
</ins><span class="cx">     return JSValueMakeString(context, encodedHostName.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -555,7 +555,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto name = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     // Ignoring the second parameter (userInterface), as this command emulates a manual action.
</span><span class="lines">@@ -562,10 +562,10 @@
</span><span class="cx"> 
</span><span class="cx">     JSRetainPtr<JSStringRef> value;
</span><span class="cx">     if (argumentCount >= 3) {
</span><del>-        value.adopt(JSValueToStringCopy(context, arguments[2], exception));
</del><ins>+        value = adopt(JSValueToStringCopy(context, arguments[2], exception));
</ins><span class="cx">         ASSERT(!*exception);
</span><span class="cx">     } else
</span><del>-        value.adopt(JSStringCreateWithUTF8CString(""));
</del><ins>+        value = adopt(JSStringCreateWithUTF8CString(""));
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -580,7 +580,7 @@
</span><span class="cx">     if (argumentCount < 2)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> target(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto target = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     JSObjectRef options = JSValueToObject(context, arguments[1], exception);
</span><span class="lines">@@ -605,7 +605,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto name = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -618,9 +618,9 @@
</span><span class="cx">     if (argumentCount < 2)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> key(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto key = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><del>-    JSRetainPtr<JSStringRef> value(Adopt, JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+    auto value = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -698,15 +698,15 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> url(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto url = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     JSRetainPtr<JSStringRef> target;
</span><span class="cx">     if (argumentCount >= 2) {
</span><del>-        target.adopt(JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+        target = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">         ASSERT(!*exception);
</span><span class="cx">     } else
</span><del>-        target.adopt(JSStringCreateWithUTF8CString(""));
</del><ins>+        target = adopt(JSStringCreateWithUTF8CString(""));
</ins><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="cx">     controller->queueLoad(url.get(), target.get());
</span><span class="lines">@@ -720,21 +720,20 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> content(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto content = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     JSRetainPtr<JSStringRef> baseURL;
</span><span class="cx">     if (argumentCount >= 2) {
</span><del>-        baseURL.adopt(JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+        baseURL = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">         ASSERT(!*exception);
</span><span class="cx">     } else
</span><del>-        baseURL.adopt(JSStringCreateWithUTF8CString(""));
</del><ins>+        baseURL = adopt(JSStringCreateWithUTF8CString(""));
</ins><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="cx"> 
</span><span class="cx">     if (argumentCount >= 3) {
</span><del>-        JSRetainPtr<JSStringRef> unreachableURL;
-        unreachableURL.adopt(JSValueToStringCopy(context, arguments[2], exception));
</del><ins>+        auto unreachableURL = adopt(JSValueToStringCopy(context, arguments[2], exception));
</ins><span class="cx">         ASSERT(!*exception);
</span><span class="cx">         controller->queueLoadAlternateHTMLString(content.get(), baseURL.get(), unreachableURL.get());
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="lines">@@ -762,7 +761,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto script = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -778,7 +777,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto script = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -832,7 +831,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> password(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto password = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     size_t maxLength = JSStringGetMaximumUTF8CStringSize(password.get());
</span><span class="lines">@@ -852,7 +851,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> username(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto username = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     size_t maxLength = JSStringGetMaximumUTF8CStringSize(username.get());
</span><span class="lines">@@ -955,7 +954,7 @@
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="cx"> 
</span><span class="cx">     bool forbidden = JSValueToBoolean(context, arguments[0]);
</span><del>-    JSRetainPtr<JSStringRef> scheme(Adopt, JSValueToStringCopy(context, arguments[1], 0));
</del><ins>+    auto scheme = adopt(JSValueToStringCopy(context, arguments[1], 0));
</ins><span class="cx">     controller->setDomainRelaxationForbiddenForURLScheme(forbidden, scheme.get());
</span><span class="cx"> 
</span><span class="cx">     return JSValueMakeUndefined(context);
</span><span class="lines">@@ -1037,7 +1036,7 @@
</span><span class="cx">     if (argumentCount != 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> message(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto message = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = reinterpret_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -1100,7 +1099,7 @@
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><del>-    JSRetainPtr<JSStringRef> locale(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto locale = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx">     controller->setPOSIXLocale(locale.get());
</span><span class="cx"> 
</span><span class="lines">@@ -1137,7 +1136,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> path(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto path = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -1313,7 +1312,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> path(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto path = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -1328,7 +1327,7 @@
</span><span class="cx">     if (argumentCount != 2)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> value(Adopt, JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+    auto value = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -1343,7 +1342,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> header(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto header = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     size_t maxLength = JSStringGetMaximumUTF8CStringSize(header.get());
</span><span class="lines">@@ -1455,7 +1454,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> visibility(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto visibility = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     size_t maxLength = JSStringGetMaximumUTF8CStringSize(visibility.get());
</span><span class="lines">@@ -1510,7 +1509,7 @@
</span><span class="cx"> static JSValueRef evaluateInWebInspectorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><del>-    JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto script = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     controller->evaluateInWebInspector(script.get());
</span><span class="lines">@@ -1522,7 +1521,7 @@
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="cx">     double worldID = JSValueToNumber(context, arguments[0], exception);
</span><span class="cx">     ASSERT(!*exception);
</span><del>-    JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+    auto script = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     controller->evaluateScriptInIsolatedWorld(static_cast<unsigned>(worldID), JSContextGetGlobalObject(context), script.get());
</span><span class="lines">@@ -1534,7 +1533,7 @@
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="cx">     double worldID = JSValueToNumber(context, arguments[0], exception);
</span><span class="cx">     ASSERT(!*exception);
</span><del>-    JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+    auto script = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     controller->evaluateScriptInIsolatedWorldAndReturnValue(static_cast<unsigned>(worldID), JSContextGetGlobalObject(context), script.get());
</span><span class="lines">@@ -1553,11 +1552,11 @@
</span><span class="cx">     if (argumentCount != 4)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> sourceOrigin(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto sourceOrigin = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><del>-    JSRetainPtr<JSStringRef> destinationProtocol(Adopt, JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+    auto destinationProtocol = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><del>-    JSRetainPtr<JSStringRef> destinationHost(Adopt, JSValueToStringCopy(context, arguments[2], exception));
</del><ins>+    auto destinationHost = adopt(JSValueToStringCopy(context, arguments[2], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx">     bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]);
</span><span class="cx"> 
</span><span class="lines">@@ -1571,11 +1570,11 @@
</span><span class="cx">     if (argumentCount != 4)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> sourceOrigin(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto sourceOrigin = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><del>-    JSRetainPtr<JSStringRef> destinationProtocol(Adopt, JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+    auto destinationProtocol = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><del>-    JSRetainPtr<JSStringRef> destinationHost(Adopt, JSValueToStringCopy(context, arguments[2], exception));
</del><ins>+    auto destinationHost = adopt(JSValueToStringCopy(context, arguments[2], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx">     bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]);
</span><span class="cx"> 
</span><span class="lines">@@ -1589,9 +1588,9 @@
</span><span class="cx">     if (argumentCount != 2)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> orientation(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto orientation = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><del>-    JSRetainPtr<JSStringRef> policy(Adopt, JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+    auto policy = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -1604,7 +1603,7 @@
</span><span class="cx">     if (argumentCount != 3)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx">     
</span><del>-    JSRetainPtr<JSStringRef> source(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto source = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx">     bool runAtStart = JSValueToBoolean(context, arguments[1]);
</span><span class="cx">     bool allFrames = JSValueToBoolean(context, arguments[2]);
</span><span class="lines">@@ -1619,7 +1618,7 @@
</span><span class="cx">     if (argumentCount != 2)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx">     
</span><del>-    JSRetainPtr<JSStringRef> source(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto source = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx">     bool allFrames = JSValueToBoolean(context, arguments[1]);
</span><span class="cx">    
</span><span class="lines">@@ -1645,10 +1644,10 @@
</span><span class="cx">     if (argumentCount != 2)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> utf8Data(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto utf8Data = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> baseURL(Adopt, JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+    auto baseURL = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx">         
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -1688,11 +1687,11 @@
</span><span class="cx">     if (argumentCount != 3)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> url(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto url = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><del>-    JSRetainPtr<JSStringRef> username(Adopt, JSValueToStringCopy(context, arguments[1], exception));
</del><ins>+    auto username = adopt(JSValueToStringCopy(context, arguments[1], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><del>-    JSRetainPtr<JSStringRef> password(Adopt, JSValueToStringCopy(context, arguments[2], exception));
</del><ins>+    auto password = adopt(JSValueToStringCopy(context, arguments[2], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -1855,7 +1854,7 @@
</span><span class="cx"> static JSValueRef getTitleTextDirectionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><del>-    JSRetainPtr<JSStringRef> titleDirection(Adopt, JSStringCreateWithUTF8CString(controller->titleTextDirection().c_str()));
</del><ins>+    auto titleDirection = adopt(JSStringCreateWithUTF8CString(controller->titleTextDirection().c_str()));
</ins><span class="cx">     return JSValueMakeString(context, titleDirection.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1862,7 +1861,7 @@
</span><span class="cx"> static JSValueRef getInspectorTestStubURLCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><del>-    JSRetainPtr<JSStringRef> url(Adopt, controller->inspectorTestStubURL());
</del><ins>+    auto url = controller->inspectorTestStubURL();
</ins><span class="cx">     return JSValueMakeString(context, url.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1899,7 +1898,7 @@
</span><span class="cx"> static JSValueRef simulateLegacyWebNotificationClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 
</span><del>-    JSRetainPtr<JSStringRef> title(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto title = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     controller->simulateLegacyWebNotificationClick(title.get());
</span><span class="cx">     return JSValueMakeUndefined(context);
</span><span class="cx"> }
</span><span class="lines">@@ -1907,7 +1906,7 @@
</span><span class="cx"> static JSValueRef setTextDirectionCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     if (argumentCount == 1) {
</span><del>-        JSRetainPtr<JSStringRef> direction(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+        auto direction = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">         TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="cx">         controller->setTextDirection(direction.get());
</span><span class="cx">     }
</span><span class="lines">@@ -1956,7 +1955,7 @@
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> origin(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto origin = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx">     controller->grantWebNotificationPermission(origin.get());
</span><span class="cx"> 
</span><span class="lines">@@ -1971,7 +1970,7 @@
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> origin(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto origin = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx">     controller->denyWebNotificationPermission(origin.get());
</span><span class="cx"> 
</span><span class="lines">@@ -2035,7 +2034,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> channel(Adopt, JSValueToStringCopy(context, arguments[0], exception));
</del><ins>+    auto channel = adopt(JSValueToStringCopy(context, arguments[0], exception));
</ins><span class="cx">     ASSERT(!*exception);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -2049,7 +2048,7 @@
</span><span class="cx">     if (argumentCount < 1)
</span><span class="cx">         return JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> script = argumentCount > 0 ? JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, arguments[0], 0)) : JSRetainPtr<JSStringRef>();
</del><ins>+    auto script = argumentCount > 0 ? adopt(JSValueToStringCopy(context, arguments[0], 0)) : JSRetainPtr<JSStringRef>();
</ins><span class="cx">     JSValueRef callback = argumentCount > 1 ? arguments[1] : JSValueMakeUndefined(context);
</span><span class="cx"> 
</span><span class="cx">     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
</span><span class="lines">@@ -2068,7 +2067,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> testRunnerStr(Adopt, JSStringCreateWithUTF8CString("testRunner"));
</del><ins>+    auto testRunnerStr = adopt(JSStringCreateWithUTF8CString("testRunner"));
</ins><span class="cx">     ref();
</span><span class="cx"> 
</span><span class="cx">     JSClassRef classRef = getJSClass();
</span><span class="lines">@@ -2464,7 +2463,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::uiScriptDidComplete(const String& result, unsigned callbackID)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> stringRef(Adopt, JSStringCreateWithUTF8CString(result.utf8().data()));
</del><ins>+    auto stringRef = adopt(JSStringCreateWithUTF8CString(result.utf8().data()));
</ins><span class="cx">     callUIScriptCallback(callbackID, stringRef.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2479,7 +2478,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     JSObjectRef files = JSValueToObject(context, filesValue, nullptr);
</span><del>-    static auto lengthProperty = JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString("length"));
</del><ins>+    static auto lengthProperty = adopt(JSStringCreateWithUTF8CString("length"));
</ins><span class="cx">     JSValueRef filesLengthValue = JSObjectGetProperty(context, files, lengthProperty.get(), nullptr);
</span><span class="cx">     if (!JSValueIsNumber(context, filesLengthValue))
</span><span class="cx">         return;
</span><span class="lines">@@ -2491,7 +2490,7 @@
</span><span class="cx">         if (!JSValueIsString(context, fileValue))
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        auto file = JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, fileValue, nullptr));
</del><ins>+        auto file = adopt(JSValueToStringCopy(context, fileValue, nullptr));
</ins><span class="cx">         size_t fileBufferSize = JSStringGetMaximumUTF8CStringSize(file.get()) + 1;
</span><span class="cx">         auto fileBuffer = std::make_unique<char[]>(fileBufferSize);
</span><span class="cx">         JSStringGetUTF8CString(file.get(), fileBuffer.get(), fileBufferSize);
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeTestRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/TestRunner.h (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/TestRunner.h  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/TestRunner.h     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -66,8 +66,8 @@
</span><span class="cx">     void clearBackForwardList();
</span><span class="cx">     void clearPersistentUserStyleSheet();
</span><span class="cx">     bool callShouldCloseOnWebView();
</span><del>-    JSStringRef copyDecodedHostName(JSStringRef name);
-    JSStringRef copyEncodedHostName(JSStringRef name);
</del><ins>+    JSRetainPtr<JSStringRef> copyDecodedHostName(JSStringRef name);
+    JSRetainPtr<JSStringRef> copyEncodedHostName(JSStringRef name);
</ins><span class="cx">     void dispatchPendingLoadRequests();
</span><span class="cx">     void display();
</span><span class="cx">     void displayAndTrackRepaints();
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx">     int numberOfPendingGeolocationPermissionRequests();
</span><span class="cx">     bool isGeolocationProviderActive();
</span><span class="cx">     void overridePreference(JSStringRef key, JSStringRef value);
</span><del>-    JSStringRef pathToLocalResource(JSContextRef, JSStringRef url);
</del><ins>+    JSRetainPtr<JSStringRef> pathToLocalResource(JSContextRef, JSStringRef url);
</ins><span class="cx">     void queueBackNavigation(int howFarBackward);
</span><span class="cx">     void queueForwardNavigation(int howFarForward);
</span><span class="cx">     void queueLoad(JSStringRef url, JSStringRef target);
</span><span class="lines">@@ -319,7 +319,7 @@
</span><span class="cx">     void showWebInspector();
</span><span class="cx">     void closeWebInspector();
</span><span class="cx">     void evaluateInWebInspector(JSStringRef script);
</span><del>-    JSStringRef inspectorTestStubURL();
</del><ins>+    JSRetainPtr<JSStringRef> inspectorTestStubURL();
</ins><span class="cx"> 
</span><span class="cx">     void evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script);
</span><span class="cx">     void evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script);
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeiosAccessibilityControllerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/ios/AccessibilityControllerIOS.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/ios/AccessibilityControllerIOS.mm     2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/ios/AccessibilityControllerIOS.mm        2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -155,6 +155,5 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityController::platformName() const
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("ios"));
-    return platformName;
</del><ins>+    return adopt(JSStringCreateWithUTF8CString("ios"));
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeiosAccessibilityUIElementIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm      2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm 2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -30,8 +30,6 @@
</span><span class="cx"> #import "AccessibilityCommonMac.h"
</span><span class="cx"> #import "AccessibilityNotificationHandler.h"
</span><span class="cx"> #import <Foundation/Foundation.h>
</span><del>-#import <JavaScriptCore/JSRetainPtr.h>
-#import <JavaScriptCore/JSStringRef.h>
</del><span class="cx"> #import <JavaScriptCore/JSStringRefCF.h>
</span><span class="cx"> #import <WebCore/TextGranularity.h>
</span><span class="cx"> #import <WebKit/WebFrame.h>
</span><span class="lines">@@ -123,8 +121,13 @@
</span><span class="cx"> - (CGPathRef)_accessibilityPath;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-static JSStringRef concatenateAttributeAndValue(NSString* attribute, NSString* value)
</del><ins>+static JSRetainPtr<JSStringRef> createEmptyJSString()
</ins><span class="cx"> {
</span><ins>+    return adopt(JSStringCreateWithCharacters(nullptr, 0));
+}
+
+static JSRetainPtr<JSStringRef> concatenateAttributeAndValue(NSString *attribute, NSString *value)
+{
</ins><span class="cx">     Vector<UniChar> buffer([attribute length]);
</span><span class="cx">     [attribute getCharacters:buffer.data()];
</span><span class="cx">     buffer.append(':');
</span><span class="lines">@@ -133,13 +136,13 @@
</span><span class="cx">     Vector<UniChar> valueBuffer([value length]);
</span><span class="cx">     [value getCharacters:valueBuffer.data()];
</span><span class="cx">     buffer.appendVector(valueBuffer);
</span><del>-    
-    return JSStringCreateWithCharacters(buffer.data(), buffer.size());
</del><ins>+
+    return adopt(JSStringCreateWithCharacters(buffer.data(), buffer.size()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #pragma mark iPhone Attributes
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::identifier()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::identifier()
</ins><span class="cx"> {
</span><span class="cx">     return concatenateAttributeAndValue(@"AXIdentifier", [m_element accessibilityIdentifier]);
</span><span class="cx"> }
</span><span class="lines">@@ -154,7 +157,7 @@
</span><span class="cx">     return ([m_element accessibilityTraits] & [m_element _axSearchFieldTrait]) == [m_element _axSearchFieldTrait];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::traits()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::traits()
</ins><span class="cx"> {
</span><span class="cx">     return concatenateAttributeAndValue(@"AXTraits", [NSString stringWithFormat:@"%qu", [m_element accessibilityTraits]]);
</span><span class="cx"> }
</span><span class="lines">@@ -187,10 +190,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::url()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::url()
</ins><span class="cx"> {
</span><span class="cx">     NSURL *url = [m_element accessibilityURL];
</span><del>-    return [[url absoluteString] createJSStringRef];    
</del><ins>+    return [[url absoluteString] createJSStringRef];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double AccessibilityUIElement::x()
</span><span class="lines">@@ -360,30 +363,24 @@
</span><span class="cx">     [m_element accessibilityModifySelection:WebCore::CharacterGranularity increase:NO];    
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::speakAs()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::speakAs()
</ins><span class="cx"> {
</span><span class="cx">     return [[[m_element accessibilitySpeechHint] componentsJoinedByString:@", "] createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringForSelection() 
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForSelection()
</ins><span class="cx"> { 
</span><span class="cx">     NSString *stringForRange = [m_element selectionRangeString];
</span><del>-    if (!stringForRange)
-        return 0;
-    
</del><span class="cx">     return [stringForRange createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringForRange(unsigned location, unsigned length) 
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned location, unsigned length)
</ins><span class="cx"> { 
</span><span class="cx">     NSString *stringForRange = [m_element stringForRange:NSMakeRange(location, length)];
</span><del>-    if (!stringForRange)
-        return 0;
-    
</del><span class="cx">     return [stringForRange createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length)
</ins><span class="cx"> {
</span><span class="cx">     NSRange range = NSMakeRange(location, length);
</span><span class="cx">     NSAttributedString* string = [m_element attributedStringForRange:range];
</span><span class="lines">@@ -394,7 +391,7 @@
</span><span class="cx">     return [stringWithAttrs createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributedStringForElement()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForElement()
</ins><span class="cx"> {
</span><span class="cx">     NSAttributedString *string = [m_element attributedStringForElement];
</span><span class="cx">     if (![string isKindOfClass:[NSAttributedString class]])
</span><span class="lines">@@ -444,7 +441,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::pathDescription() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::pathDescription() const
</ins><span class="cx"> {
</span><span class="cx">     NSMutableString *result = [NSMutableString stringWithString:@"\nStart Path\n"];
</span><span class="cx">     CGPathRef pathRef = [m_element _accessibilityPath];
</span><span class="lines">@@ -545,20 +542,20 @@
</span><span class="cx">     return AccessibilityTextMarker(nextMarker);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
</ins><span class="cx"> {
</span><span class="cx">     id textMarkers = (id)markerRange->platformTextMarkerRange();
</span><span class="cx">     if (!textMarkers || ![textMarkers isKindOfClass:[NSArray class]])
</span><del>-        return JSStringCreateWithCharacters(0, 0);
</del><ins>+        return createEmptyJSString();
</ins><span class="cx">     return [[m_element stringForTextMarkers:textMarkers] createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributedStringForTextMarkerRange(AccessibilityTextMarkerRange*)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForTextMarkerRange(AccessibilityTextMarkerRange*)
</ins><span class="cx"> {
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions(AccessibilityTextMarkerRange*, bool)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions(AccessibilityTextMarkerRange*, bool)
</ins><span class="cx"> {
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -670,27 +667,27 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfLinkedUIElements()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfLinkedUIElements()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfDocumentLinks()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfDocumentLinks()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfChildren()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfChildren()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::allAttributes()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
</ins><span class="cx"> {
</span><span class="cx">     if (JSStringIsEqualToUTF8CString(attribute, "AXPlaceholderValue"))
</span><span class="cx">         return [[m_element accessibilityPlaceholderValue] createJSStringRef];
</span><span class="lines">@@ -704,7 +701,7 @@
</span><span class="cx">     if (JSStringIsEqualToUTF8CString(attribute, "AXSortDirection"))
</span><span class="cx">         return [[m_element accessibilitySortDirection] createJSStringRef];
</span><span class="cx">     
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityUIElement::isPressActionSupported()
</span><span class="lines">@@ -741,19 +738,19 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::parameterizedAttributeNames()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::parameterizedAttributeNames()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::role()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::role()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::subrole()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::subrole()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityUIElement::scrollPageUp()
</span><span class="lines">@@ -775,43 +772,42 @@
</span><span class="cx">     return [m_element accessibilityScroll:UIAccessibilityScrollDirectionRight];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::roleDescription()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::roleDescription()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::computedRoleString()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::computedRoleString()
</ins><span class="cx"> {
</span><del>-    // FIXME: implement
-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::title()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::title()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::description()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::description()
</ins><span class="cx"> {
</span><span class="cx">     return concatenateAttributeAndValue(@"AXLabel", [m_element accessibilityLabel]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::orientation() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringValue()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringValue()
</ins><span class="cx"> {
</span><span class="cx">     return concatenateAttributeAndValue(@"AXValue", [m_element accessibilityValue]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::language()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::language()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::helpText() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const
</ins><span class="cx"> {
</span><span class="cx">     return concatenateAttributeAndValue(@"AXHint", [m_element accessibilityHint]);
</span><span class="cx"> }
</span><span class="lines">@@ -836,9 +832,9 @@
</span><span class="cx">     [m_element _accessibilitySetValue:[NSString stringWithJSStringRef:valueText]];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::valueDescription()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::valueDescription()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int AccessibilityUIElement::insertionPointLineNumber()
</span><span class="lines">@@ -895,9 +891,9 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::ariaDropEffects() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::ariaDropEffects() const
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int AccessibilityUIElement::lineForIndex(int index)
</span><span class="lines">@@ -905,39 +901,39 @@
</span><span class="cx">     return -1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumnHeaders()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfRowHeaders()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRowHeaders()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfColumns()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumns()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfRows()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRows()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfVisibleCells()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfVisibleCells()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfHeader()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfHeader()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int AccessibilityUIElement::rowCount()
</span><span class="lines">@@ -955,7 +951,7 @@
</span><span class="cx">     return -1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::rowIndexRange()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::rowIndexRange()
</ins><span class="cx"> {
</span><span class="cx">     NSRange range = [m_element accessibilityRowRange];
</span><span class="cx">     NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%lu, %lu}", (unsigned long)range.location, (unsigned long)range.length];
</span><span class="lines">@@ -962,11 +958,11 @@
</span><span class="cx">     return [rangeDescription createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::columnIndexRange()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::columnIndexRange()
</ins><span class="cx"> {
</span><span class="cx">     NSRange range = [m_element accessibilityColumnRange];
</span><span class="cx">     NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%lu, %lu}", (unsigned long)range.location, (unsigned long)range.length];
</span><del>-    return [rangeDescription createJSStringRef];    
</del><ins>+    return [rangeDescription createJSStringRef];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned col, unsigned row)
</span><span class="lines">@@ -989,9 +985,9 @@
</span><span class="cx">     // FIXME: implement
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::selectedTextRange()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectedTextRange()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityUIElement::assistiveTechnologySimulatedFocus()
</span><span class="lines">@@ -1022,10 +1018,10 @@
</span><span class="cx">     [m_element _accessibilityActivate];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::accessibilityValue() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::accessibilityValue() const
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityUIElement::clearSelectedChildren() const
</span><span class="lines">@@ -1033,14 +1029,14 @@
</span><span class="cx">     // FIXME: implement
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::documentEncoding()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::documentURI()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallback)
</span><span class="lines">@@ -1174,7 +1170,7 @@
</span><span class="cx">     return AccessibilityUIElement([value firstObject]);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Implement.
</span><span class="cx">     return nullptr;
</span><span class="lines">@@ -1197,7 +1193,7 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::classList() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::classList() const
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span><span class="cx">     return nullptr;
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityCommonMach"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityCommonMac.h (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityCommonMac.h  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityCommonMac.h     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -28,24 +28,19 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef AccessibilityCommonMac_h
-#define AccessibilityCommonMac_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #import "AccessibilityUIElement.h"
</span><ins>+#import <JavaScriptCore/JSRetainPtr.h>
</ins><span class="cx"> 
</span><del>-#import <JavaScriptCore/JSStringRef.h>
-
</del><span class="cx"> // If an unsupported attribute is passed in, it will raise an accessibility exception. These are usually caught by the Accessibility Runtime to inform
</span><span class="cx"> // the AX client app of the error. However, DRT is the AX client app, so it must catch these exceptions.
</span><span class="cx"> #define BEGIN_AX_OBJC_EXCEPTIONS @try {
</span><span class="cx"> #define END_AX_OBJC_EXCEPTIONS } @catch(NSException *e) { if (![[e name] isEqualToString:NSAccessibilityException]) @throw; }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> @interface NSString (JSStringRefAdditions)
</span><span class="cx"> + (NSString *)stringWithJSStringRef:(JSStringRef)jsStringRef;
</span><del>-- (JSStringRef)createJSStringRef;
</del><ins>+- (JSRetainPtr<JSStringRef>)createJSStringRef;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> extern NSDictionary *searchPredicateParameterizedAttributeForSearchCriteria(JSContextRef, AccessibilityUIElement *startElement, bool isDirectionNext, unsigned resultsLimit, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly);
</span><del>-
-#endif // AccessibilityCommonMac_h
</del></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityCommonMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityCommonMac.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityCommonMac.mm 2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityCommonMac.mm    2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -31,8 +31,6 @@
</span><span class="cx"> #import "config.h"
</span><span class="cx"> #import "AccessibilityCommonMac.h"
</span><span class="cx"> 
</span><del>-#import <JavaScriptCore/JSRetainPtr.h>
-#import <JavaScriptCore/JSStringRef.h>
</del><span class="cx"> #import <JavaScriptCore/JSStringRefCF.h>
</span><span class="cx"> 
</span><span class="cx"> @implementation NSString (JSStringRefAdditions)
</span><span class="lines">@@ -45,9 +43,9 @@
</span><span class="cx">     return CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, jsStringRef));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (JSStringRef)createJSStringRef
</del><ins>+- (JSRetainPtr<JSStringRef>)createJSStringRef
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCFString((__bridge CFStringRef)self);
</del><ins>+    return adopt(JSStringCreateWithCFString((__bridge CFStringRef)self));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NSDictionary *searchPredicateParameterizedAttributeForSearchCriteria(JSContextRef context, AccessibilityUIElement *startElement, bool isDirectionNext, unsigned resultsLimit, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly)
</span><span class="lines">@@ -64,7 +62,7 @@
</span><span class="cx">     if (searchKey) {
</span><span class="cx">         id searchKeyParameter = nil;
</span><span class="cx">         if (JSValueIsString(context, searchKey)) {
</span><del>-            JSRetainPtr<JSStringRef> searchKeyString(Adopt, JSValueToStringCopy(context, searchKey, nullptr));
</del><ins>+            auto searchKeyString = adopt(JSValueToStringCopy(context, searchKey, nullptr));
</ins><span class="cx">             if (searchKeyString)
</span><span class="cx">                 searchKeyParameter = [NSString stringWithJSStringRef:searchKeyString.get()];
</span><span class="cx">         } else if (JSValueIsObject(context, searchKey)) {
</span><span class="lines">@@ -71,7 +69,7 @@
</span><span class="cx">             JSObjectRef searchKeyArray = JSValueToObject(context, searchKey, nullptr);
</span><span class="cx">             unsigned searchKeyArrayLength = 0;
</span><span class="cx">             
</span><del>-            JSRetainPtr<JSStringRef> lengthPropertyString(Adopt, JSStringCreateWithUTF8CString("length"));
</del><ins>+            auto lengthPropertyString = adopt(JSStringCreateWithUTF8CString("length"));
</ins><span class="cx">             JSValueRef searchKeyArrayLengthValue = JSObjectGetProperty(context, searchKeyArray, lengthPropertyString.get(), nullptr);
</span><span class="cx">             if (searchKeyArrayLengthValue && JSValueIsNumber(context, searchKeyArrayLengthValue))
</span><span class="cx">                 searchKeyArrayLength = static_cast<unsigned>(JSValueToNumber(context, searchKeyArrayLengthValue, nullptr));
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityControllerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm     2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm        2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -158,6 +158,5 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityController::platformName() const
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("mac"));
-    return platformName;
</del><ins>+    return adopt(JSStringCreateWithUTF8CString("mac"));
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityNotificationHandlermm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm       2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityNotificationHandler.mm  2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> #import "AccessibilityUIElement.h"
</span><span class="cx"> 
</span><span class="cx"> #import <JavaScriptCore/JSRetainPtr.h>
</span><del>-#import <JavaScriptCore/JSStringRef.h>
</del><span class="cx"> #import <JavaScriptCore/JSStringRefCF.h>
</span><span class="cx"> #import <WebKit/WebFrame.h>
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="lines">@@ -45,14 +44,14 @@
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface NSString (JSStringRefAdditions)
</span><del>-- (JSStringRef)createJSStringRef;
</del><ins>+- (JSRetainPtr<JSStringRef>)createJSStringRef;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation NSString (JSStringRefAdditions)
</span><span class="cx"> 
</span><del>-- (JSStringRef)createJSStringRef
</del><ins>+- (JSRetainPtr<JSStringRef>)createJSStringRef
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCFString((__bridge CFStringRef)self);
</del><ins>+    return adopt(JSStringCreateWithCFString((__bridge CFStringRef)self));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="lines">@@ -118,7 +117,7 @@
</span><span class="cx"> static JSValueRef makeValueRefForValue(JSContextRef context, id value)
</span><span class="cx"> {
</span><span class="cx">     if ([value isKindOfClass:[NSString class]])
</span><del>-        return JSValueMakeString(context, adopt([value createJSStringRef]).get());
</del><ins>+        return JSValueMakeString(context, [value createJSStringRef].get());
</ins><span class="cx">     if ([value isKindOfClass:[NSNumber class]]) {
</span><span class="cx">         if (!strcmp([value objCType], @encode(BOOL)))
</span><span class="cx">             return JSValueMakeBoolean(context, [value boolValue]);
</span><span class="lines">@@ -151,7 +150,7 @@
</span><span class="cx">     [dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop)
</span><span class="cx">     {
</span><span class="cx">         if (JSValueRef propertyValue = makeValueRefForValue(context, obj))
</span><del>-            JSObjectSetProperty(context, object, adopt([key createJSStringRef]).get(), propertyValue, kJSPropertyAttributeNone, nullptr);
</del><ins>+            JSObjectSetProperty(context, object, [key createJSStringRef].get(), propertyValue, kJSPropertyAttributeNone, nullptr);
</ins><span class="cx">     }];
</span><span class="cx"> 
</span><span class="cx">     return object;
</span><span class="lines">@@ -166,7 +165,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     NSDictionary *userInfo = [[notification userInfo] objectForKey:@"userInfo"];
</span><del>-    JSValueRef notificationNameArgument = JSValueMakeString([mainFrame globalContext], adopt([notificationName createJSStringRef]).get());
</del><ins>+    JSValueRef notificationNameArgument = JSValueMakeString([mainFrame globalContext], [notificationName createJSStringRef].get());
</ins><span class="cx">     JSValueRef userInfoArgument = makeObjectRefForDictionary([mainFrame globalContext], userInfo);
</span><span class="cx">     if (m_platformElement) {
</span><span class="cx">         // Listener for one element gets the notification name and userInfo.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm      2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm 2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -30,8 +30,6 @@
</span><span class="cx"> #import "AccessibilityUIElement.h"
</span><span class="cx"> 
</span><span class="cx"> #import <Foundation/Foundation.h>
</span><del>-#import <JavaScriptCore/JSRetainPtr.h>
-#import <JavaScriptCore/JSStringRef.h>
</del><span class="cx"> #import <JavaScriptCore/JSStringRefCF.h>
</span><span class="cx"> #import <WebKit/WebFrame.h>
</span><span class="cx"> #import <WebKit/WebHTMLView.h>
</span><span class="lines">@@ -81,6 +79,11 @@
</span><span class="cx"> - (void)_accessibilitySetValue:(id)value forAttribute:(NSString*)attributeName;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+static JSRetainPtr<JSStringRef> createEmptyJSString()
+{
+    return adopt(JSStringCreateWithCharacters(nullptr, 0));
+}
+
</ins><span class="cx"> AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
</span><span class="cx">     : m_element(element)
</span><span class="cx">     , m_notificationHandler(0)
</span><span class="lines">@@ -174,7 +177,7 @@
</span><span class="cx">     return attributesString;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSStringRef concatenateAttributeAndValue(NSString* attribute, NSString* value)
</del><ins>+static JSRetainPtr<JSStringRef> concatenateAttributeAndValue(NSString *attribute, NSString *value)
</ins><span class="cx"> {
</span><span class="cx">     Vector<UniChar> buffer([attribute length]);
</span><span class="cx">     [attribute getCharacters:buffer.data()];
</span><span class="lines">@@ -185,7 +188,7 @@
</span><span class="cx">     [value getCharacters:valueBuffer.data()];
</span><span class="cx">     buffer.appendVector(valueBuffer);
</span><span class="cx"> 
</span><del>-    return JSStringCreateWithCharacters(buffer.data(), buffer.size());
</del><ins>+    return adopt(JSStringCreateWithCharacters(buffer.data(), buffer.size()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void convertNSArrayToVector(NSArray* array, Vector<AccessibilityUIElement>& elementVector)
</span><span class="lines">@@ -195,7 +198,7 @@
</span><span class="cx">         elementVector.append(AccessibilityUIElement([array objectAtIndex:i]));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSStringRef descriptionOfElements(Vector<AccessibilityUIElement>& elementVector)
</del><ins>+static JSRetainPtr<JSStringRef> descriptionOfElements(Vector<AccessibilityUIElement>& elementVector)
</ins><span class="cx"> {
</span><span class="cx">     NSMutableString* allElementString = [NSMutableString string];
</span><span class="cx">     size_t size = elementVector.size();
</span><span class="lines">@@ -217,7 +220,7 @@
</span><span class="cx">     if (searchStrings) {
</span><span class="cx">         NSMutableArray *searchStringsParameter = [NSMutableArray array];
</span><span class="cx">         if (JSValueIsString(context, searchStrings)) {
</span><del>-            JSRetainPtr<JSStringRef> searchStringsString(Adopt, JSValueToStringCopy(context, searchStrings, nullptr));
</del><ins>+            auto searchStringsString = adopt(JSValueToStringCopy(context, searchStrings, nullptr));
</ins><span class="cx">             if (searchStringsString)
</span><span class="cx">                 [searchStringsParameter addObject:[NSString stringWithJSStringRef:searchStringsString.get()]];
</span><span class="cx">         }
</span><span class="lines">@@ -225,13 +228,13 @@
</span><span class="cx">             JSObjectRef searchStringsArray = JSValueToObject(context, searchStrings, nullptr);
</span><span class="cx">             unsigned searchStringsArrayLength = 0;
</span><span class="cx">             
</span><del>-            JSRetainPtr<JSStringRef> lengthPropertyString(Adopt, JSStringCreateWithUTF8CString("length"));
</del><ins>+            auto lengthPropertyString = adopt(JSStringCreateWithUTF8CString("length"));
</ins><span class="cx">             JSValueRef searchStringsArrayLengthValue = JSObjectGetProperty(context, searchStringsArray, lengthPropertyString.get(), nullptr);
</span><span class="cx">             if (searchStringsArrayLengthValue && JSValueIsNumber(context, searchStringsArrayLengthValue))
</span><span class="cx">                 searchStringsArrayLength = static_cast<unsigned>(JSValueToNumber(context, searchStringsArrayLengthValue, nullptr));
</span><span class="cx">             
</span><span class="cx">             for (unsigned i = 0; i < searchStringsArrayLength; ++i) {
</span><del>-                JSRetainPtr<JSStringRef> searchStringsString(Adopt, JSValueToStringCopy(context, JSObjectGetPropertyAtIndex(context, searchStringsArray, i, nullptr), nullptr));
</del><ins>+                auto searchStringsString = adopt(JSValueToStringCopy(context, JSObjectGetPropertyAtIndex(context, searchStringsArray, i, nullptr), nullptr));
</ins><span class="cx">                 if (searchStringsString)
</span><span class="cx">                     [searchStringsParameter addObject:[NSString stringWithJSStringRef:searchStringsString.get()]];
</span><span class="cx">             }
</span><span class="lines">@@ -445,7 +448,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfLinkedUIElements()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfLinkedUIElements()
</ins><span class="cx"> {
</span><span class="cx">     Vector<AccessibilityUIElement> linkedElements;
</span><span class="cx">     getLinkedUIElements(linkedElements);
</span><span class="lines">@@ -452,7 +455,7 @@
</span><span class="cx">     return descriptionOfElements(linkedElements);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfDocumentLinks()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfDocumentLinks()
</ins><span class="cx"> {
</span><span class="cx">     Vector<AccessibilityUIElement> linkElements;
</span><span class="cx">     getDocumentLinks(linkElements);
</span><span class="lines">@@ -459,7 +462,7 @@
</span><span class="cx">     return descriptionOfElements(linkElements);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfChildren()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfChildren()
</ins><span class="cx"> {
</span><span class="cx">     Vector<AccessibilityUIElement> children;
</span><span class="cx">     getChildren(children);
</span><span class="lines">@@ -466,13 +469,13 @@
</span><span class="cx">     return descriptionOfElements(children);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::allAttributes()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes()
</ins><span class="cx"> {
</span><span class="cx">     NSString* attributes = attributesOfElement(m_element);
</span><span class="cx">     return [attributes createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id value = [m_element accessibilityAttributeValue:[NSString stringWithJSStringRef:attribute]];
</span><span class="lines">@@ -568,7 +571,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::parameterizedAttributeNames()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::parameterizedAttributeNames()
</ins><span class="cx"> {
</span><span class="cx">     NSArray* supportedParameterizedAttributes = [m_element accessibilityParameterizedAttributeNames];
</span><span class="cx">     
</span><span class="lines">@@ -580,7 +583,7 @@
</span><span class="cx">     return [attributesString createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::role()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::role()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSString *role = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityRoleAttribute], m_element);
</span><span class="lines">@@ -590,7 +593,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::subrole()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::subrole()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSString* role = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilitySubroleAttribute], m_element);
</span><span class="lines">@@ -600,7 +603,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::roleDescription()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::roleDescription()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSString* role = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityRoleDescriptionAttribute], m_element);
</span><span class="lines">@@ -610,7 +613,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::computedRoleString()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::computedRoleString()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSString *computedRoleString = descriptionOfValue([m_element accessibilityAttributeValue:@"AXARIARole"], m_element);
</span><span class="lines">@@ -620,7 +623,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::title()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::title()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSString* title = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityTitleAttribute], m_element);
</span><span class="lines">@@ -630,7 +633,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::description()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::description()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityDescriptionAttribute], m_element);
</span><span class="lines">@@ -640,17 +643,17 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::orientation() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityOrientationAttribute], m_element);
</span><del>-    return concatenateAttributeAndValue(@"AXOrientation", description);    
</del><ins>+    return concatenateAttributeAndValue(@"AXOrientation", description);
</ins><span class="cx">     END_AX_OBJC_EXCEPTIONS
</span><span class="cx"> 
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringValue()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringValue()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityValueAttribute], m_element);
</span><span class="lines">@@ -661,7 +664,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::language()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::language()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id description = descriptionOfValue([m_element accessibilityAttributeValue:@"AXLanguage"], m_element);
</span><span class="lines">@@ -671,7 +674,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::helpText() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityHelpAttribute], m_element);
</span><span class="lines">@@ -774,7 +777,7 @@
</span><span class="cx">     return 0.0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::valueDescription()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::valueDescription()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSString* valueDescription = [m_element accessibilityAttributeValue:NSAccessibilityValueDescriptionAttribute];
</span><span class="lines">@@ -898,7 +901,7 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::speakAs()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::speakAs()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id value = [m_element accessibilityAttributeValue:@"AXDRTSpeechAttribute"];
</span><span class="lines">@@ -909,7 +912,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::classList() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::classList() const
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id value = [m_element accessibilityAttributeValue:@"AXDOMClassList"];
</span><span class="lines">@@ -941,7 +944,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::ariaDropEffects() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::ariaDropEffects() const
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id value = [m_element accessibilityAttributeValue:NSAccessibilityDropEffectsAttribute];
</span><span class="lines">@@ -974,7 +977,7 @@
</span><span class="cx">     return -1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::rangeForLine(int line)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int line)
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id value = [m_element accessibilityAttributeValue:NSAccessibilityRangeForLineParameterizedAttribute forParameter:[NSNumber numberWithInt:line]];
</span><span class="lines">@@ -985,7 +988,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::rangeForPosition(int x, int y)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForPosition(int x, int y)
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id value = [m_element accessibilityAttributeValue:NSAccessibilityRangeForPositionParameterizedAttribute forParameter:[NSValue valueWithPoint:NSMakePoint(x, y)]];
</span><span class="lines">@@ -997,7 +1000,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
</ins><span class="cx"> {
</span><span class="cx">     NSRange range = NSMakeRange(location, length);
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="lines">@@ -1014,7 +1017,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringForRange(unsigned location, unsigned length)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned location, unsigned length)
</ins><span class="cx"> {
</span><span class="cx">     NSRange range = NSMakeRange(location, length);
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="lines">@@ -1028,7 +1031,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length)
</ins><span class="cx"> {
</span><span class="cx">     NSRange range = NSMakeRange(location, length);
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="lines">@@ -1087,7 +1090,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSDictionary *parameterizedAttribute = selectTextParameterizedAttributeForCriteria(context, ambiguityResolution, searchStrings, replacementString, activity);
</span><span class="lines">@@ -1099,7 +1102,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumnHeaders()
</ins><span class="cx"> {
</span><span class="cx">     // not yet defined in AppKit... odd
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="lines">@@ -1112,7 +1115,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfRowHeaders()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRowHeaders()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSArray* rowHeadersArray = [m_element accessibilityAttributeValue:@"AXRowHeaderUIElements"];
</span><span class="lines">@@ -1124,7 +1127,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfColumns()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumns()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSArray* columnsArray = [m_element accessibilityAttributeValue:NSAccessibilityColumnsAttribute];
</span><span class="lines">@@ -1136,7 +1139,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfRows()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRows()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSArray* rowsArray = [m_element accessibilityAttributeValue:NSAccessibilityRowsAttribute];
</span><span class="lines">@@ -1148,7 +1151,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfVisibleCells()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfVisibleCells()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSArray* cellsArray = [m_element accessibilityAttributeValue:@"AXVisibleCells"];
</span><span class="lines">@@ -1160,7 +1163,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfHeader()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfHeader()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id headerObject = [m_element accessibilityAttributeValue:NSAccessibilityHeaderAttribute];
</span><span class="lines">@@ -1204,7 +1207,7 @@
</span><span class="cx">     return -1;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::rowIndexRange()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::rowIndexRange()
</ins><span class="cx"> {
</span><span class="cx">     NSRange range = NSMakeRange(0, 0);
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="lines">@@ -1218,7 +1221,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::columnIndexRange()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::columnIndexRange()
</ins><span class="cx"> {
</span><span class="cx">     NSRange range = NSMakeRange(0, 0);
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="lines">@@ -1226,7 +1229,7 @@
</span><span class="cx">     if (indexRange)
</span><span class="cx">         range = [indexRange rangeValue];
</span><span class="cx">     NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%lu, %lu}",static_cast<unsigned long>(range.location), static_cast<unsigned long>(range.length)];
</span><del>-    return [rangeDescription createJSStringRef];    
</del><ins>+    return [rangeDescription createJSStringRef];
</ins><span class="cx">     END_AX_OBJC_EXCEPTIONS
</span><span class="cx">     
</span><span class="cx">     return nullptr;
</span><span class="lines">@@ -1266,7 +1269,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::pathDescription() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::pathDescription() const
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSMutableString *result = [NSMutableString stringWithString:@"\nStart Path\n"];
</span><span class="lines">@@ -1299,7 +1302,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::selectedTextRange()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectedTextRange()
</ins><span class="cx"> {
</span><span class="cx">     NSRange range = NSMakeRange(NSNotFound, 0);
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="lines">@@ -1307,7 +1310,7 @@
</span><span class="cx">     if (indexRange)
</span><span class="cx">         range = [indexRange rangeValue];
</span><span class="cx">     NSMutableString *rangeDescription = [NSMutableString stringWithFormat:@"{%lu, %lu}", static_cast<unsigned long>(range.location), static_cast<unsigned long>(range.length)];
</span><del>-    return [rangeDescription createJSStringRef];    
</del><ins>+    return [rangeDescription createJSStringRef];
</ins><span class="cx">     END_AX_OBJC_EXCEPTIONS
</span><span class="cx">     
</span><span class="cx">     return nullptr;
</span><span class="lines">@@ -1397,13 +1400,13 @@
</span><span class="cx">     // FIXME: implement
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::accessibilityValue() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::accessibilityValue() const
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::documentEncoding()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id value = [m_element accessibilityAttributeValue:@"AXDocumentEncoding"];
</span><span class="lines">@@ -1411,10 +1414,10 @@
</span><span class="cx">         return [value createJSStringRef];
</span><span class="cx">     END_AX_OBJC_EXCEPTIONS
</span><span class="cx">     
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::documentURI()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id value = [m_element accessibilityAttributeValue:@"AXDocumentURI"];
</span><span class="lines">@@ -1422,14 +1425,14 @@
</span><span class="cx">         return [value createJSStringRef];
</span><span class="cx">     END_AX_OBJC_EXCEPTIONS
</span><span class="cx">     
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::url()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::url()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSURL *url = [m_element accessibilityAttributeValue:NSAccessibilityURLAttribute];
</span><del>-    return [[url absoluteString] createJSStringRef];    
</del><ins>+    return [[url absoluteString] createJSStringRef];
</ins><span class="cx">     END_AX_OBJC_EXCEPTIONS
</span><span class="cx">     
</span><span class="cx">     return nullptr;
</span><span class="lines">@@ -1705,7 +1708,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     id textString = [m_element accessibilityAttributeValue:@"AXStringForTextMarkerRange" forParameter:(__bridge id)markerRange->platformTextMarkerRange()];
</span><span class="lines">@@ -1715,7 +1718,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSStringRef createJSStringRef(id string)
</del><ins>+static JSRetainPtr<JSStringRef> createJSStringRef(id string)
</ins><span class="cx"> {
</span><span class="cx">     if (!string)
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -1736,13 +1739,13 @@
</span><span class="cx">     return [mutableString createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributedStringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
</ins><span class="cx"> {
</span><span class="cx">     id string = [m_element accessibilityAttributeValue:@"AXAttributedStringForTextMarkerRange" forParameter:(__bridge id)markerRange->platformTextMarkerRange()];
</span><span class="cx">     return createJSStringRef(string);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions(AccessibilityTextMarkerRange* markerRange, bool includeSpellCheck)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions(AccessibilityTextMarkerRange* markerRange, bool includeSpellCheck)
</ins><span class="cx"> {
</span><span class="cx">     id parameter = nil;
</span><span class="cx">     if (includeSpellCheck)
</span><span class="lines">@@ -1955,7 +1958,7 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // SUPPORTS_AX_TEXTMARKERS && PLATFORM(MAC)
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::supportedActions()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::supportedActions()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSArray *names = [m_element accessibilityActionNames];
</span><span class="lines">@@ -1976,7 +1979,7 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::mathPostscriptsDescription() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::mathPostscriptsDescription() const
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSArray *pairs = [m_element accessibilityAttributeValue:@"AXMathPostscripts"];
</span><span class="lines">@@ -1986,7 +1989,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::mathPrescriptsDescription() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::mathPrescriptsDescription() const
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="cx">     NSArray *pairs = [m_element accessibilityAttributeValue:@"AXMathPrescripts"];
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacFrameLoadDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm      2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm 2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -347,7 +347,7 @@
</span><span class="cx">     if (!globalObject)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    JSObjectSetProperty(ctx, globalObject, JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString("__worldID")).get(), JSValueMakeNumber(ctx, worldIDForWorld(world)), kJSPropertyAttributeReadOnly, 0);
</del><ins>+    JSObjectSetProperty(ctx, globalObject, adopt(JSStringCreateWithUTF8CString("__worldID")).get(), JSValueMakeNumber(ctx, worldIDForWorld(world)), kJSPropertyAttributeReadOnly, 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)webView:(WebView *)sender didClearWindowObjectForFrame:(WebFrame *)frame inScriptWorld:(WebScriptWorld *)world
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacTestRunnerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -40,8 +40,6 @@
</span><span class="cx"> #import "WorkQueue.h"
</span><span class="cx"> #import "WorkQueueItem.h"
</span><span class="cx"> #import <Foundation/Foundation.h>
</span><del>-#import <JavaScriptCore/JSRetainPtr.h>
-#import <JavaScriptCore/JSStringRef.h>
</del><span class="cx"> #import <JavaScriptCore/JSStringRefCF.h>
</span><span class="cx"> #import <WebCore/GeolocationPosition.h>
</span><span class="cx"> #import <WebKit/DOMDocument.h>
</span><span class="lines">@@ -187,7 +185,7 @@
</span><span class="cx">     JSObjectRef arrayObj = JSValueToObject(context, arrayResult, 0);
</span><span class="cx">     for (NSUInteger i = 0; i < count; i++) {
</span><span class="cx">         NSString *origin = [[origins objectAtIndex:i] databaseIdentifier];
</span><del>-        JSRetainPtr<JSStringRef> originJS(Adopt, JSStringCreateWithCFString((__bridge CFStringRef)origin));
</del><ins>+        auto originJS = adopt(JSStringCreateWithCFString((__bridge CFStringRef)origin));
</ins><span class="cx">         JSObjectSetPropertyAtIndex(context, arrayObj, i, JSValueMakeString(context, originJS.get()), 0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -249,18 +247,18 @@
</span><span class="cx">     [item release];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef TestRunner::copyDecodedHostName(JSStringRef name)
</del><ins>+JSRetainPtr<JSStringRef> TestRunner::copyDecodedHostName(JSStringRef name)
</ins><span class="cx"> {
</span><del>-    RetainPtr<CFStringRef> nameCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, name));
</del><ins>+    auto nameCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, name));
</ins><span class="cx">     NSString *nameNS = (__bridge NSString *)nameCF.get();
</span><del>-    return JSStringCreateWithCFString((__bridge CFStringRef)[nameNS _web_decodeHostName]);
</del><ins>+    return adopt(JSStringCreateWithCFString((__bridge CFStringRef)[nameNS _web_decodeHostName]));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef TestRunner::copyEncodedHostName(JSStringRef name)
</del><ins>+JSRetainPtr<JSStringRef> TestRunner::copyEncodedHostName(JSStringRef name)
</ins><span class="cx"> {
</span><del>-    RetainPtr<CFStringRef> nameCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, name));
</del><ins>+    auto nameCF = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, name));
</ins><span class="cx">     NSString *nameNS = (__bridge NSString *)nameCF.get();
</span><del>-    return JSStringCreateWithCFString((__bridge CFStringRef)[nameNS _web_encodeHostName]);
</del><ins>+    return adopt(JSStringCreateWithCFString((__bridge CFStringRef)[nameNS _web_encodeHostName]));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::display()
</span><span class="lines">@@ -344,7 +342,7 @@
</span><span class="cx">     return testURL.substr(0, indexOfSeparatorAfterDirectoryName(expectedRootName, testURL));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef localResourceJSString)
</del><ins>+JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSContextRef context, JSStringRef localResourceJSString)
</ins><span class="cx"> {
</span><span class="cx">     // The passed in path will be an absolute path to the resource starting
</span><span class="cx">     // with "/tmp" or "/tmp/LayoutTests", optionally starting with the explicit file:// protocol.
</span><span class="lines">@@ -372,7 +370,7 @@
</span><span class="cx">         ASSERT(absolutePathToLocalResource[0] == '/');
</span><span class="cx">         absolutePathToLocalResource = std::string("file://") + absolutePathToLocalResource;
</span><span class="cx">     }
</span><del>-    return JSStringCreateWithUTF8CString(absolutePathToLocalResource.c_str());
</del><ins>+    return adopt(JSStringCreateWithUTF8CString(absolutePathToLocalResource.c_str()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
</span><span class="lines">@@ -383,7 +381,7 @@
</span><span class="cx">     NSURL *nsurl = [NSURL URLWithString:urlNS relativeToURL:[[[mainFrame dataSource] response] URL]];
</span><span class="cx">     NSString *nsurlString = [nsurl absoluteString];
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> absoluteURL(Adopt, JSStringCreateWithUTF8CString([nsurlString UTF8String]));
</del><ins>+    auto absoluteURL = adopt(JSStringCreateWithUTF8CString([nsurlString UTF8String]));
</ins><span class="cx">     WorkQueue::singleton().queue(new LoadItem(absoluteURL.get(), target));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -681,7 +679,7 @@
</span><span class="cx"> {
</span><span class="cx">     WebFindOptions options = 0;
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> lengthPropertyName(Adopt, JSStringCreateWithUTF8CString("length"));
</del><ins>+    auto lengthPropertyName = adopt(JSStringCreateWithUTF8CString("length"));
</ins><span class="cx">     JSValueRef lengthValue = JSObjectGetProperty(context, optionsArray, lengthPropertyName.get(), 0);
</span><span class="cx">     if (!JSValueIsNumber(context, lengthValue))
</span><span class="cx">         return false;
</span><span class="lines">@@ -694,7 +692,7 @@
</span><span class="cx">         if (!JSValueIsString(context, value))
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        JSRetainPtr<JSStringRef> optionName(Adopt, JSValueToStringCopy(context, value, 0));
</del><ins>+        auto optionName = adopt(JSValueToStringCopy(context, value, nullptr));
</ins><span class="cx"> 
</span><span class="cx">         if (JSStringIsEqualToUTF8CString(optionName.get(), "CaseInsensitive"))
</span><span class="cx">             options |= WebFindOptionsCaseInsensitive;
</span><span class="lines">@@ -816,7 +814,7 @@
</span><span class="cx">     [[[mainFrame webView] inspector] evaluateInFrontend:nil script:scriptNS];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef TestRunner::inspectorTestStubURL()
</del><ins>+JSRetainPtr<JSStringRef> TestRunner::inspectorTestStubURL()
</ins><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     return nullptr;
</span><span class="lines">@@ -833,7 +831,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     CFStringRef urlString = CFURLGetString(url.get());
</span><del>-    return JSStringCreateWithCFString(urlString);
</del><ins>+    return adopt(JSStringCreateWithCFString(urlString));
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinAccessibilityControllerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp    2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp       2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -363,7 +363,7 @@
</span><span class="cx">         if (!isSame)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        JSRetainPtr<JSStringRef> jsNotification(Adopt, JSStringCreateWithUTF8CString(eventName.c_str()));
</del><ins>+        auto jsNotification = adopt(JSStringCreateWithUTF8CString(eventName.c_str()));
</ins><span class="cx">         JSValueRef argument = JSValueMakeString(frame->globalContext(), jsNotification.get());
</span><span class="cx">         JSObjectCallAsFunction(frame->globalContext(), slot.value, 0, 1, &argument, 0);
</span><span class="cx">     }
</span><span class="lines">@@ -391,6 +391,5 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityController::platformName() const
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("win"));
-    return platformName;
</del><ins>+    return adopt(JSStringCreateWithUTF8CString("win"));
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinAccessibilityUIElementWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp     2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp        2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2013, 2014-2015 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2008-2018 Apple Inc. All Rights Reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -38,6 +38,11 @@
</span><span class="cx"> 
</span><span class="cx"> using std::wstring;
</span><span class="cx"> 
</span><ins>+static JSRetainPtr<JSStringRef> createEmptyJSString()
+{
+    return adopt(JSStringCreateWithCharacters(nullptr, 0));
+}
+
</ins><span class="cx"> static COMPtr<IAccessibleComparable> comparableObject(IAccessible* accessible)
</span><span class="cx"> {
</span><span class="cx">     COMPtr<IServiceProvider> serviceProvider(Query, accessible);
</span><span class="lines">@@ -163,19 +168,19 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::allAttributes()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfLinkedUIElements()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfLinkedUIElements()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfDocumentLinks()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfDocumentLinks()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AccessibilityUIElement AccessibilityUIElement::titleUIElement()
</span><span class="lines">@@ -216,14 +221,14 @@
</span><span class="cx">     return parentAccessible;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfChildren()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfChildren()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::parameterizedAttributeNames()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::parameterizedAttributeNames()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static VARIANT& self()
</span><span class="lines">@@ -286,14 +291,14 @@
</span><span class="cx">     return roleName;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::role()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::role()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_element)
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXRole: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXRole: "));
</ins><span class="cx"> 
</span><span class="cx">     _variant_t vRole;
</span><span class="cx">     if (FAILED(m_element->get_accRole(self(), &vRole.GetVARIANT())))
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXRole: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXRole: "));
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(V_VT(&vRole) == VT_I4 || V_VT(&vRole) == VT_BSTR);
</span><span class="cx"> 
</span><span class="lines">@@ -309,95 +314,95 @@
</span><span class="cx">     } else if (V_VT(&vRole) == VT_BSTR)
</span><span class="cx">         result = V_BSTR(&vRole);
</span><span class="cx"> 
</span><del>-    return JSStringCreateWithBSTR(_bstr_t(L"AXRole: ") + convertToDRTLabel(result));
</del><ins>+    return adopt(JSStringCreateWithBSTR(_bstr_t(L"AXRole: ") + convertToDRTLabel(result)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::subrole()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::subrole()
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::roleDescription()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::roleDescription()
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::computedRoleString()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::computedRoleString()
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::title()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::title()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_element)
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXTitle: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXTitle: "));
</ins><span class="cx"> 
</span><span class="cx">     _bstr_t titleBSTR;
</span><span class="cx">     if (FAILED(m_element->get_accName(self(), &titleBSTR.GetBSTR())))
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXTitle: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXTitle: "));
</ins><span class="cx"> 
</span><del>-    return JSStringCreateWithBSTR(_bstr_t(L"AXTitle: ") + titleBSTR);
</del><ins>+    return adopt(JSStringCreateWithBSTR(_bstr_t(L"AXTitle: ") + titleBSTR));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::description()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::description()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_element)
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXDescription: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXDescription: "));
</ins><span class="cx"> 
</span><span class="cx">     _bstr_t descriptionBSTR;
</span><span class="cx">     if (FAILED(m_element->get_accDescription(self(), &descriptionBSTR.GetBSTR())))
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXDescription: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXDescription: "));
</ins><span class="cx"> 
</span><span class="cx">     if (!descriptionBSTR.length())
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXDescription: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXDescription: "));
</ins><span class="cx"> 
</span><span class="cx">     if (wcsstr(static_cast<wchar_t*>(descriptionBSTR), L"Description: ") == static_cast<wchar_t*>(descriptionBSTR)) {
</span><span class="cx">         // The Mozilla MSAA implementation requires that the string returned to us be prefixed with "Description: "
</span><span class="cx">         // To match the Mac test results, we will just prefix with AX -> AXDescription:
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AX") + descriptionBSTR);
</del><ins>+        return adopt(JSStringCreateWithBSTR(_bstr_t(L"AX") + descriptionBSTR));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return JSStringCreateWithBSTR(descriptionBSTR);
</del><ins>+    return adopt(JSStringCreateWithBSTR(descriptionBSTR));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringValue()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringValue()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_element)
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXValue: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXValue: "));
</ins><span class="cx"> 
</span><span class="cx">     _bstr_t valueBSTR;
</span><span class="cx">     if (FAILED(m_element->get_accValue(self(), &valueBSTR.GetBSTR())))
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXValue: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXValue: "));
</ins><span class="cx"> 
</span><del>-    return JSStringCreateWithBSTR(_bstr_t(L"AXValue: ") + valueBSTR);
</del><ins>+    return adopt(JSStringCreateWithBSTR(_bstr_t(L"AXValue: ") + valueBSTR));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::language()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::language()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_element)
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXLanguage: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXLanguage: "));
</ins><span class="cx"> 
</span><span class="cx">     COMPtr<IAccessibleComparable> accessible2Element = comparableObject(m_element.get());
</span><span class="cx">     if (!accessible2Element)
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXLanguage: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXLanguage: "));
</ins><span class="cx"> 
</span><span class="cx">     IA2Locale locale;
</span><span class="cx">     if (FAILED(accessible2Element->get_locale(&locale)))
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXLanguage: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXLanguage: "));
</ins><span class="cx"> 
</span><del>-    return JSStringCreateWithBSTR(_bstr_t(L"AXLanguage: ") + _bstr_t(locale.language, false));
</del><ins>+    return adopt(JSStringCreateWithBSTR(_bstr_t(L"AXLanguage: ") + _bstr_t(locale.language, false)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::helpText() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_element)
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXHelp: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXHelp: "));
</ins><span class="cx"> 
</span><span class="cx">     _bstr_t helpTextBSTR;
</span><span class="cx">     if (FAILED(m_element->get_accHelp(self(), &helpTextBSTR.GetBSTR())))
</span><del>-        return JSStringCreateWithBSTR(_bstr_t(L"AXHelp: "));
</del><ins>+        return adopt(JSStringCreateWithUTF8CString("AXHelp: "));
</ins><span class="cx"> 
</span><del>-    return JSStringCreateWithBSTR(_bstr_t(L"AXHelp: ") + helpTextBSTR);
</del><ins>+    return adopt(JSStringCreateWithBSTR(_bstr_t(L"AXHelp: ") + helpTextBSTR));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double AccessibilityUIElement::x()
</span><span class="lines">@@ -454,7 +459,7 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::valueDescription()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::valueDescription()
</ins><span class="cx"> {
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -494,7 +499,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx">  
</span><del>-JSStringRef AccessibilityUIElement::ariaDropEffects() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::ariaDropEffects() const
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -522,7 +527,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::orientation() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -592,34 +597,34 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumnHeaders()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfRowHeaders()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRowHeaders()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfColumns()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumns()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfRows()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRows()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfVisibleCells()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfVisibleCells()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributesOfHeader()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfHeader()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int AccessibilityUIElement::indexInTable()
</span><span class="lines">@@ -627,14 +632,14 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::rowIndexRange()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::rowIndexRange()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::columnIndexRange()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::columnIndexRange()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int AccessibilityUIElement::lineForIndex(int)
</span><span class="lines">@@ -642,19 +647,19 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringForRange(unsigned, unsigned)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned, unsigned)
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned, unsigned)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned, unsigned)
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned)
</span><span class="lines">@@ -672,7 +677,7 @@
</span><span class="cx">     return { nullptr };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings, JSStringRef replacementString, JSStringRef activity)
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -682,18 +687,18 @@
</span><span class="cx">     return { nullptr };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::selectedTextRange()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectedTextRange()
</ins><span class="cx"> {
</span><span class="cx">     COMPtr<IAccessibleComparable> comparable = comparableObject(platformUIElement().get());
</span><span class="cx">     if (!comparable)
</span><del>-        return JSStringCreateWithCharacters(0, 0);
</del><ins>+        return createEmptyJSString();
</ins><span class="cx"> 
</span><span class="cx">     _variant_t value;
</span><span class="cx">     if (FAILED(comparable->get_attribute(_bstr_t(L"AXSelectedTextRangeAttribute"), &value.GetVARIANT())))
</span><del>-        return JSStringCreateWithCharacters(0, 0);    
</del><ins>+        return createEmptyJSString();
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(V_VT(&value) == VT_BSTR);
</span><del>-    return JSStringCreateWithBSTR(value.bstrVal);
</del><ins>+    return adopt(JSStringCreateWithBSTR(value.bstrVal));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
</span><span class="lines">@@ -700,10 +705,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute)
</span><span class="lines">@@ -788,16 +793,16 @@
</span><span class="cx">     return { nullptr };
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::accessibilityValue() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::accessibilityValue() const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_element)
</span><del>-        return JSStringCreateWithCharacters(0, 0);
</del><ins>+        return createEmptyJSString();
</ins><span class="cx"> 
</span><span class="cx">     _bstr_t valueBSTR;
</span><span class="cx">     if (FAILED(m_element->get_accValue(self(), &valueBSTR.GetBSTR())) || !valueBSTR.length())
</span><del>-        return JSStringCreateWithCharacters(0, 0);
</del><ins>+        return createEmptyJSString();
</ins><span class="cx"> 
</span><del>-    return JSStringCreateWithBSTR(valueBSTR);
</del><ins>+    return adopt(JSStringCreateWithBSTR(valueBSTR));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityUIElement::clearSelectedChildren() const
</span><span class="lines">@@ -805,20 +810,20 @@
</span><span class="cx">     // FIXME: implement
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::documentEncoding()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::documentURI()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI()
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::url()
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::url()
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallback)
</span><span class="lines">@@ -949,7 +954,7 @@
</span><span class="cx">     // FIXME: implement
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef AccessibilityUIElement::classList() const
</del><ins>+JSRetainPtr<JSStringRef> AccessibilityUIElement::classList() const
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span><span class="cx">     return 0;
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinTestRunnerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp 2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp    2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -210,7 +210,7 @@
</span><span class="cx">     backForwardList->goToItem(item.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef TestRunner::copyDecodedHostName(JSStringRef name)
</del><ins>+JSRetainPtr<JSStringRef> TestRunner::copyDecodedHostName(JSStringRef name)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Implement!
</span><span class="cx">     fprintf(testResult, "ERROR: TestRunner::copyDecodedHostName(JSStringRef) not implemented\n");
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef TestRunner::copyEncodedHostName(JSStringRef name)
</del><ins>+JSRetainPtr<JSStringRef> TestRunner::copyEncodedHostName(JSStringRef name)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Implement!
</span><span class="cx">     fprintf(testResult, "ERROR: TestRunner::copyEncodedHostName(JSStringRef) not implemented\n");
</span><span class="lines">@@ -311,7 +311,7 @@
</span><span class="cx">     return buffer.data();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url)
</del><ins>+JSRetainPtr<JSStringRef> TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url)
</ins><span class="cx"> {
</span><span class="cx">     wstring input(JSStringGetCharactersPtr(url), JSStringGetLength(url));
</span><span class="cx"> 
</span><span class="lines">@@ -321,7 +321,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return JSStringCreateWithCharacters(localPath.c_str(), localPath.length());
</del><ins>+    return adopt(JSStringCreateWithCharacters(localPath.c_str(), localPath.length()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
</span><span class="lines">@@ -346,7 +346,7 @@
</span><span class="cx"> 
</span><span class="cx">     wstring wURL = jsStringRefToWString(url);
</span><span class="cx">     wstring wAbsoluteURL = responseURL + TEXT("/") + wURL;
</span><del>-    JSRetainPtr<JSStringRef> jsAbsoluteURL(Adopt, JSStringCreateWithCharacters(wAbsoluteURL.data(), wAbsoluteURL.length()));
</del><ins>+    auto jsAbsoluteURL = adopt(JSStringCreateWithCharacters(wAbsoluteURL.data(), wAbsoluteURL.length()));
</ins><span class="cx"> 
</span><span class="cx">     WorkQueue::singleton().queue(new LoadItem(jsAbsoluteURL.get(), target));
</span><span class="cx"> }
</span><span class="lines">@@ -991,7 +991,7 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned char options = 0;
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> lengthPropertyName(Adopt, JSStringCreateWithUTF8CString("length"));
</del><ins>+    auto lengthPropertyName = adopt(JSStringCreateWithUTF8CString("length"));
</ins><span class="cx">     JSValueRef lengthValue = JSObjectGetProperty(context, optionsArray, lengthPropertyName.get(), nullptr);
</span><span class="cx">     if (!JSValueIsNumber(context, lengthValue))
</span><span class="cx">         return false;
</span><span class="lines">@@ -1004,7 +1004,7 @@
</span><span class="cx">         if (!JSValueIsString(context, value))
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        JSRetainPtr<JSStringRef> optionName(Adopt, JSValueToStringCopy(context, value, nullptr));
</del><ins>+        auto optionName = adopt(JSValueToStringCopy(context, value, nullptr));
</ins><span class="cx"> 
</span><span class="cx">         if (JSStringIsEqualToUTF8CString(optionName.get(), "CaseInsensitive"))
</span><span class="cx">             options |= WebFindOptionsCaseInsensitive;
</span><span class="lines">@@ -1185,7 +1185,7 @@
</span><span class="cx">     inspectorPrivate->evaluateInFrontend(bstrT(script).GetBSTR());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSStringRef TestRunner::inspectorTestStubURL()
</del><ins>+JSRetainPtr<JSStringRef> TestRunner::inspectorTestStubURL()
</ins><span class="cx"> {
</span><span class="cx">     CFBundleRef webkitBundle = webKitBundle();
</span><span class="cx">     if (!webkitBundle)
</span><span class="lines">@@ -1195,7 +1195,7 @@
</span><span class="cx">     if (!url)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    return JSStringCreateWithCFString(CFURLGetString(url.get()));
</del><ins>+    return adopt(JSStringCreateWithCFString(CFURLGetString(url.get())));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> typedef HashMap<unsigned, COMPtr<IWebScriptWorld> > WorldMap;
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedBindingsJSWrapperh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/Bindings/JSWrapper.h (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/Bindings/JSWrapper.h        2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/TestRunnerShared/Bindings/JSWrapper.h   2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef JSWrapper_h
-#define JSWrapper_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include "JSWrappable.h"
</span><span class="cx"> #include <JavaScriptCore/JSRetainPtr.h>
</span><span class="lines">@@ -48,10 +47,8 @@
</span><span class="cx"> 
</span><span class="cx"> inline void setProperty(JSContextRef context, JSObjectRef object, const char* propertyName, JSWrappable* value, JSPropertyAttributes attributes, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
</del><ins>+    auto propertyNameString = adopt(JSStringCreateWithUTF8CString(propertyName));
</ins><span class="cx">     JSObjectSetProperty(context, object, propertyNameString.get(), JSWrapper::wrap(context, value), attributes, exception);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WTR
</span><del>-
-#endif // JSWrapper_h
</del></span></pre></div>
<a id="trunkToolsTestRunnerSharedUIScriptContextUIScriptContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptContext.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptContext.cpp 2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptContext.cpp    2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> UIScriptContext::UIScriptContext(UIScriptContextDelegate& delegate)
</span><del>-    : m_context(Adopt, JSGlobalContextCreate(nullptr))
</del><ins>+    : m_context(adopt(JSGlobalContextCreate(nullptr)))
</ins><span class="cx">     , m_delegate(delegate)
</span><span class="cx"> {
</span><span class="cx">     m_controller = UIScriptController::create(*this);
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> {
</span><span class="cx">     m_currentScriptCallbackID = scriptCallbackID;
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> stringRef(Adopt, JSStringCreateWithUTF8CString(script.utf8().data()));
</del><ins>+    auto stringRef = adopt(JSStringCreateWithUTF8CString(script.utf8().data()));
</ins><span class="cx"> 
</span><span class="cx">     JSValueRef exception = nullptr;
</span><span class="cx">     JSValueRef result = JSEvaluateScript(m_context.get(), stringRef.get(), 0, 0, 1, &exception);
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">     
</span><span class="cx">     if (!hasOutstandingAsyncTasks()) {
</span><span class="cx">         JSValueRef stringifyException = nullptr;
</span><del>-        JSRetainPtr<JSStringRef> stringified(Adopt, JSValueToStringCopy(m_context.get(), result, &stringifyException));
</del><ins>+        auto stringified = adopt(JSValueToStringCopy(m_context.get(), result, &stringifyException));
</ins><span class="cx">         requestUIScriptCompletion(stringified.get());
</span><span class="cx">         tryToCompleteUIScriptForCurrentParentCallback();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedUIScriptContextUIScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp      2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp 2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">         DeviceOrientation::LandscapeRight
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> option(Adopt, JSValueToStringCopy(context, value, nullptr));
</del><ins>+    auto option = adopt(JSValueToStringCopy(context, value, nullptr));
</ins><span class="cx">     if (option.get()->string() == "portrait")
</span><span class="cx">         return &values[0];
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkToolsTestRunnerSharedcocoaLayoutTestSpellCheckermm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm     2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm        2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -68,9 +68,9 @@
</span><span class="cx">     return "invalid";
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static NSTextCheckingType nsTextCheckingType(JSRetainPtr<JSStringRef>&& jsType)
</del><ins>+static NSTextCheckingType nsTextCheckingType(JSStringRef jsType)
</ins><span class="cx"> {
</span><del>-    auto cfType = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, jsType.get()));
</del><ins>+    auto cfType = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, jsType));
</ins><span class="cx">     if (CFStringCompare(cfType.get(), CFSTR("orthography"), kCFCompareCaseInsensitive) == kCFCompareEqualTo)
</span><span class="cx">         return NSTextCheckingTypeOrthography;
</span><span class="cx"> 
</span><span class="lines">@@ -251,7 +251,7 @@
</span><span class="cx">                 }
</span><span class="cx">                 JSPropertyNameArrayRelease(detailsObjectProperties);
</span><span class="cx">             }
</span><del>-            [resultsForWord addObject:[[[LayoutTestTextCheckingResult alloc] initWithType:nsTextCheckingType(WTFMove(typeValue)) range:NSMakeRange(fromValue, toValue - fromValue) replacement:(__bridge NSString *)replacementText.get() details:details.get()] autorelease]];
</del><ins>+            [resultsForWord addObject:[[[LayoutTestTextCheckingResult alloc] initWithType:nsTextCheckingType(typeValue.get()) range:NSMakeRange(fromValue, toValue - fromValue) replacement:(__bridge NSString *)replacementText.get() details:details.get()] autorelease]];
</ins><span class="cx">         }
</span><span class="cx">         auto cfTextToCheck = adoptCF(JSStringCopyCFString(kCFAllocatorDefault, textToCheck));
</span><span class="cx">         [results setObject:resultsForWord.get() forKey:(__bridge NSString *)cfTextToCheck.get()];
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIJavaScriptTestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/JavaScriptTest.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/JavaScriptTest.cpp     2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/TestWebKitAPI/JavaScriptTest.cpp        2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">     JSValueRef scriptValue = WKSerializedScriptValueDeserialize(resultSerializedScriptValue, scriptContext, 0);
</span><span class="cx">     ASSERT_NOT_NULL(scriptValue);
</span><span class="cx"> 
</span><del>-    context->actualString.adopt(JSValueToStringCopy(scriptContext, scriptValue, 0));
</del><ins>+    context->actualString = adopt(JSValueToStringCopy(scriptContext, scriptValue, 0));
</ins><span class="cx">     ASSERT_NOT_NULL(context->actualString.get());
</span><span class="cx"> 
</span><span class="cx">     context->didFinish = true;
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitWKPageIsPlayingAudiocpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/WKPageIsPlayingAudio.cpp     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include "PlatformUtilities.h"
</span><span class="cx"> #include "PlatformWebView.h"
</span><span class="cx"> #include "Test.h"
</span><del>-#include <JavaScriptCore/JSRetainPtr.h>
</del><span class="cx"> #include <JavaScriptCore/JavaScriptCore.h>
</span><span class="cx"> #include <WebKit/WKSerializedScriptValue.h>
</span><span class="cx"> #include <WebKit/WKPagePrivate.h>
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitCocoaPictureInPictureDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #import "PlatformWebView.h"
</span><span class="cx"> #import "Test.h"
</span><span class="cx"> #import "TestWKWebView.h"
</span><del>-#import <JavaScriptCore/JSRetainPtr.h>
</del><span class="cx"> #import <JavaScriptCore/JavaScriptCore.h>
</span><span class="cx"> #import <WebKit/WKPagePrivateMac.h>
</span><span class="cx"> #import <WebKit/WKPreferencesPrivate.h>
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsmacDOMNodeFromJSObjectmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm       2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm  2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">     WebScriptWorld *isolatedWorld = [WebScriptWorld world];
</span><span class="cx">     JSGlobalContextRef context = [[webView mainFrame] _globalContextForScriptWorld:isolatedWorld];
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> script(Adopt, JSStringCreateWithUTF8CString("document.body"));
</del><ins>+    auto script = adopt(JSStringCreateWithUTF8CString("document.body"));
</ins><span class="cx"> 
</span><span class="cx">     JSValueRef value = JSEvaluateScript(context, script.get(), 0, 0, 0, 0);
</span><span class="cx">     JSObjectRef jsBody = JSValueToObject(context, value, 0);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsmacJSWrapperForNodeInWebFramemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm        2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/JSWrapperForNodeInWebFrame.mm   2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -80,13 +80,15 @@
</span><span class="cx">     ASSERT_TRUE(JSValueIsObject(normalCtx, normalNodeJSValue));
</span><span class="cx">     JSObjectRef normalNodeJSObject = JSValueToObject(normalCtx, normalNodeJSValue, 0);
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> isolatedPropertyJSString = JSStringCreateWithUTF8CString("isolatedProperty");
</del><ins>+    auto isolatedPropertyJSString = adopt(JSStringCreateWithUTF8CString("isolatedProperty"));
+
</ins><span class="cx">     // Test for successful retrieval of the first property in the isolated script world
</span><span class="cx">     EXPECT_TRUE(JSValueIsBoolean(isolatedCtx, JSObjectGetProperty(isolatedCtx, isolatedNodeJSObject, isolatedPropertyJSString.get(), 0)));
</span><span class="cx">     // Test for failed retrieval of the first property in the standard script world
</span><span class="cx">     EXPECT_TRUE(JSValueIsUndefined(normalCtx, JSObjectGetProperty(normalCtx, normalNodeJSObject, isolatedPropertyJSString.get(), 0)));
</span><span class="cx"> 
</span><del>-    JSRetainPtr<JSStringRef> normalPropertyJSString = JSStringCreateWithUTF8CString("normalProperty");
</del><ins>+    auto normalPropertyJSString = adopt(JSStringCreateWithUTF8CString("normalProperty"));
+
</ins><span class="cx">     // Test for successful retrieval of the second property in the standard script world
</span><span class="cx">     EXPECT_TRUE(JSValueIsBoolean(normalCtx, JSObjectGetProperty(normalCtx, normalNodeJSObject, normalPropertyJSString.get(), 0)));
</span><span class="cx">     // Test for failed retrieval of the second property in the isolated script world
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleAccessibilityControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include "InjectedBundlePage.h"
</span><span class="cx"> #include "JSAccessibilityController.h"
</span><span class="cx"> 
</span><del>-#include <JavaScriptCore/JSRetainPtr.h>
</del><span class="cx"> #include <WebKit/WKBundle.h>
</span><span class="cx"> #include <WebKit/WKBundlePage.h>
</span><span class="cx"> #include <WebKit/WKBundlePagePrivate.h>
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleAccessibilityTextMarkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -29,8 +29,6 @@
</span><span class="cx"> #include "AccessibilityUIElement.h"
</span><span class="cx"> #include "JSAccessibilityTextMarker.h"
</span><span class="cx"> 
</span><del>-#include <JavaScriptCore/JSRetainPtr.h>
-
</del><span class="cx"> namespace WTR {
</span><span class="cx">     
</span><span class="cx"> Ref<AccessibilityTextMarker> AccessibilityTextMarker::create(PlatformTextMarker marker)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleAccessibilityTextMarkerRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp     2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp        2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -29,8 +29,6 @@
</span><span class="cx"> #include "AccessibilityUIElement.h"
</span><span class="cx"> #include "JSAccessibilityTextMarkerRange.h"
</span><span class="cx"> 
</span><del>-#include <JavaScriptCore/JSRetainPtr.h>
-
</del><span class="cx"> namespace WTR {
</span><span class="cx">     
</span><span class="cx"> Ref<AccessibilityTextMarkerRange> AccessibilityTextMarkerRange::create(PlatformTextMarkerRange markerRange)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp   2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp      2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include "AccessibilityUIElement.h"
</span><span class="cx"> 
</span><span class="cx"> #include "JSAccessibilityUIElement.h"
</span><del>-#include <JavaScriptCore/JSRetainPtr.h>
</del><span class="cx"> 
</span><span class="cx"> namespace WTR {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsCodeGeneratorTestRunnerpm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm  2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm     2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -448,8 +448,8 @@
</span><span class="cx">     return "JSValueToNullableBoolean(context, $argumentName)" if $type->name eq "boolean" && $type->isNullable;
</span><span class="cx">     return "JSValueToBoolean(context, $argumentName)" if $type->name eq "boolean";
</span><span class="cx">     return "$argumentName" if $type->name eq "object";
</span><del>-    return "JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, $argumentName, 0))" if $$self{codeGenerator}->IsStringType($type);
-    return "JSValueToNumber(context, $argumentName, 0)" if $$self{codeGenerator}->IsPrimitiveType($type);
</del><ins>+    return "adopt(JSValueToStringCopy(context, $argumentName, nullptr))" if $$self{codeGenerator}->IsStringType($type);
+    return "JSValueToNumber(context, $argumentName, nullptr)" if $$self{codeGenerator}->IsPrimitiveType($type);
</ins><span class="cx">     return "to" . _implementationClassName($type) . "(context, $argumentName)";
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleEventSendingControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp   2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp      2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx"> 
</span><span class="cx"> static unsigned arrayLength(JSContextRef context, JSObjectRef array)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> lengthString(Adopt, JSStringCreateWithUTF8CString("length"));
</del><ins>+    auto lengthString = adopt(JSStringCreateWithUTF8CString("length"));
</ins><span class="cx">     JSValueRef lengthValue = JSObjectGetProperty(context, array, lengthString.get(), 0);
</span><span class="cx">     if (!lengthValue)
</span><span class="cx">         return 0;
</span><span class="lines">@@ -144,7 +144,7 @@
</span><span class="cx"> 
</span><span class="cx">     // The value may either be a string with a single modifier or an array of modifiers.
</span><span class="cx">     if (JSValueIsString(context, arrayValue)) {
</span><del>-        JSRetainPtr<JSStringRef> string(Adopt, JSValueToStringCopy(context, arrayValue, 0));
</del><ins>+        auto string = adopt(JSValueToStringCopy(context, arrayValue, 0));
</ins><span class="cx">         return parseModifier(string.get());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">         JSValueRef value = JSObjectGetPropertyAtIndex(context, array, i, &exception);
</span><span class="cx">         if (exception)
</span><span class="cx">             continue;
</span><del>-        JSRetainPtr<JSStringRef> string(Adopt, JSValueToStringCopy(context, value, &exception));
</del><ins>+        auto string = adopt(JSValueToStringCopy(context, value, &exception));
</ins><span class="cx">         if (exception)
</span><span class="cx">             continue;
</span><span class="cx">         modifiers |= parseModifier(string.get());
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp       2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp  2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!object)
</span><span class="cx">         return 0;
</span><del>-    JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
</del><ins>+    auto propertyNameString = adopt(JSStringCreateWithUTF8CString(propertyName));
</ins><span class="cx">     return JSObjectGetProperty(context, object, propertyNameString.get(), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> static WTF::String dumpPath(JSGlobalContextRef context, JSObjectRef nodeValue)
</span><span class="cx"> {
</span><span class="cx">     JSValueRef nodeNameValue = propertyValue(context, nodeValue, "nodeName");
</span><del>-    JSRetainPtr<JSStringRef> jsStringNodeName(Adopt, JSValueToStringCopy(context, nodeNameValue, 0));
</del><ins>+    auto jsStringNodeName = adopt(JSValueToStringCopy(context, nodeNameValue, 0));
</ins><span class="cx">     WKRetainPtr<WKStringRef> nodeName = toWK(jsStringNodeName);
</span><span class="cx"> 
</span><span class="cx">     JSValueRef parentNode = propertyValue(context, nodeValue, "parentNode");
</span><span class="lines">@@ -818,7 +818,7 @@
</span><span class="cx"> 
</span><span class="cx"> static JSRetainPtr<JSStringRef> toJS(const char* string)
</span><span class="cx"> {
</span><del>-    return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString(string));
</del><ins>+    return adopt(JSStringCreateWithUTF8CString(string));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool hasDocumentElement(WKBundleFrameRef frame)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp       2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp  2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -306,7 +306,7 @@
</span><span class="cx">     auto& injectedBundle = InjectedBundle::singleton();
</span><span class="cx">     WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(injectedBundle.page()->page());
</span><span class="cx">     JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
</span><del>-    JSRetainPtr<JSStringRef> lengthPropertyName(Adopt, JSStringCreateWithUTF8CString("length"));
</del><ins>+    auto lengthPropertyName = adopt(JSStringCreateWithUTF8CString("length"));
</ins><span class="cx">     JSObjectRef optionsArray = JSValueToObject(context, optionsArrayAsValue, 0);
</span><span class="cx">     JSValueRef lengthValue = JSObjectGetProperty(context, optionsArray, lengthPropertyName.get(), 0);
</span><span class="cx">     if (!JSValueIsNumber(context, lengthValue))
</span><span class="lines">@@ -318,7 +318,7 @@
</span><span class="cx">         if (!JSValueIsString(context, value))
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        JSRetainPtr<JSStringRef> optionName(Adopt, JSValueToStringCopy(context, value, 0));
</del><ins>+        auto optionName = adopt(JSValueToStringCopy(context, value, 0));
</ins><span class="cx"> 
</span><span class="cx">         if (JSStringIsEqualToUTF8CString(optionName.get(), "CaseInsensitive"))
</span><span class="cx">             options |= kWKFindOptionsCaseInsensitive;
</span><span class="lines">@@ -1836,8 +1836,8 @@
</span><span class="cx">     stringBuilder.appendNumber(top3SubframeUnderTopFrameOrigins);
</span><span class="cx">     stringBuilder.appendLiteral(" }");
</span><span class="cx">     
</span><del>-    JSValueRef result = JSValueMakeFromJSONString(context, JSStringCreateWithUTF8CString(stringBuilder.toString().utf8().data()));
-    
</del><ins>+    JSValueRef result = JSValueMakeFromJSONString(context, adopt(JSStringCreateWithUTF8CString(stringBuilder.toString().utf8().data())).get());
+
</ins><span class="cx">     callTestRunnerCallback(StatisticsDidRunTelemetryCallbackID, 1, &result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2029,7 +2029,7 @@
</span><span class="cx">     }
</span><span class="cx">     stringBuilder.appendLiteral("]");
</span><span class="cx">     
</span><del>-    JSValueRef result = JSValueMakeFromJSONString(context, JSStringCreateWithUTF8CString(stringBuilder.toString().utf8().data()));
</del><ins>+    JSValueRef result = JSValueMakeFromJSONString(context, adopt(JSStringCreateWithUTF8CString(stringBuilder.toString().utf8().data())).get());
</ins><span class="cx"> 
</span><span class="cx">     callTestRunnerCallback(AllStorageAccessEntriesCallbackID, 1, &result);
</span><span class="cx"> }
</span><span class="lines">@@ -2239,7 +2239,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     JSObjectRef files = JSValueToObject(context, filesValue, nullptr);
</span><del>-    static auto lengthProperty = JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString("length"));
</del><ins>+    static auto lengthProperty = adopt(JSStringCreateWithUTF8CString("length"));
</ins><span class="cx">     JSValueRef filesLengthValue = JSObjectGetProperty(context, files, lengthProperty.get(), nullptr);
</span><span class="cx">     if (!JSValueIsNumber(context, filesLengthValue))
</span><span class="cx">         return;
</span><span class="lines">@@ -2251,7 +2251,7 @@
</span><span class="cx">         if (!JSValueIsString(context, fileValue))
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        auto file = JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, fileValue, nullptr));
</del><ins>+        auto file = adopt(JSValueToStringCopy(context, fileValue, nullptr));
</ins><span class="cx">         size_t fileBufferSize = JSStringGetMaximumUTF8CStringSize(file.get()) + 1;
</span><span class="cx">         auto fileBuffer = std::make_unique<char[]>(fileBufferSize);
</span><span class="cx">         JSStringGetUTF8CString(file.get(), fileBuffer.get(), fileBufferSize);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleiosAccessibilityControllerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm    2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm       2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -30,8 +30,6 @@
</span><span class="cx"> #import "InjectedBundle.h"
</span><span class="cx"> #import "InjectedBundlePage.h"
</span><span class="cx"> 
</span><del>-#import <JavaScriptCore/JSRetainPtr.h>
-#import <JavaScriptCore/JSStringRef.h>
</del><span class="cx"> #import <JavaScriptCore/JSStringRefCF.h>
</span><span class="cx"> #import <UIKit/UIAccessibility.h>
</span><span class="cx"> #import <WebKit/WKBundle.h>
</span><span class="lines">@@ -64,8 +62,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityController::platformName()
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("ios"));
-    return platformName;
</del><ins>+    return adopt(JSStringCreateWithUTF8CString("ios"));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityController::resetToConsistentState()
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleiosAccessibilityUIElementIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm     2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm        2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -30,8 +30,6 @@
</span><span class="cx"> #import "InjectedBundle.h"
</span><span class="cx"> #import "InjectedBundlePage.h"
</span><span class="cx"> #import <Foundation/Foundation.h>
</span><del>-#import <JavaScriptCore/JSRetainPtr.h>
-#import <JavaScriptCore/JSStringRef.h>
</del><span class="cx"> #import <JavaScriptCore/JSStringRefCF.h>
</span><span class="cx"> #import <UIKit/UIKit.h>
</span><span class="cx"> #import <WebCore/TextGranularity.h>
</span><span class="lines">@@ -112,9 +110,9 @@
</span><span class="cx">     return CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, jsStringRef));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (JSStringRef)createJSStringRef
</del><ins>+- (JSRetainPtr<JSStringRef>)createJSStringRef
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCFString((__bridge CFStringRef)self);
</del><ins>+    return adopt(JSStringCreateWithCFString((__bridge CFStringRef)self));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="lines">@@ -121,6 +119,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTR {
</span><span class="cx"> 
</span><ins>+static JSRetainPtr<JSStringRef> createEmptyJSString()
+{
+    return adopt(JSStringCreateWithCharacters(nullptr, 0));
+}
+
</ins><span class="cx"> static void convertNSArrayToVector(NSArray* array, Vector<RefPtr<AccessibilityUIElement> >& elementVector)
</span><span class="cx"> {
</span><span class="cx">     NSUInteger count = [array count];
</span><span class="lines">@@ -128,18 +131,18 @@
</span><span class="cx">         elementVector.append(AccessibilityUIElement::create([array objectAtIndex:i]));
</span><span class="cx"> }    
</span><span class="cx"> 
</span><del>-static JSStringRef concatenateAttributeAndValue(NSString* attribute, NSString* value)
</del><ins>+static JSRetainPtr<JSStringRef> concatenateAttributeAndValue(NSString *attribute, NSString *value)
</ins><span class="cx"> {
</span><span class="cx">     Vector<UniChar> buffer([attribute length]);
</span><span class="cx">     [attribute getCharacters:buffer.data()];
</span><span class="cx">     buffer.append(':');
</span><span class="cx">     buffer.append(' ');
</span><del>-    
</del><ins>+
</ins><span class="cx">     Vector<UniChar> valueBuffer([value length]);
</span><span class="cx">     [value getCharacters:valueBuffer.data()];
</span><span class="cx">     buffer.appendVector(valueBuffer);
</span><del>-    
-    return JSStringCreateWithCharacters(buffer.data(), buffer.size());
</del><ins>+
+    return adopt(JSStringCreateWithCharacters(buffer.data(), buffer.size()));
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
</span><span class="lines">@@ -326,22 +329,22 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfLinkedUIElements()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfDocumentLinks()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfChildren()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
</span><span class="lines">@@ -364,7 +367,7 @@
</span><span class="cx">         return [rectStr createJSStringRef];
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute)
</span><span class="lines">@@ -425,33 +428,33 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::parameterizedAttributeNames()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::role()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::subrole()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::roleDescription()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::computedRoleString()
</span><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::title()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::description()
</span><span class="lines">@@ -461,7 +464,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::stringValue()
</span><span class="lines">@@ -471,7 +474,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::language()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const
</span><span class="lines">@@ -531,7 +534,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::valueDescription()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int AccessibilityUIElement::insertionPointLineNumber()
</span><span class="lines">@@ -620,7 +623,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::ariaDropEffects() const
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // parameterized attributes
</span><span class="lines">@@ -641,15 +644,12 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned location, unsigned length)
</span><span class="cx"> {
</span><span class="cx">     NSString *stringForRange = [m_element stringForRange:NSMakeRange(location, length)];
</span><del>-    if (!stringForRange)
-        return nullptr;
-    
</del><span class="cx">     return [stringForRange createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -656,9 +656,6 @@
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length)
</span><span class="cx"> {
</span><span class="cx">     NSAttributedString *stringForRange = [m_element attributedStringForRange:NSMakeRange(location, length)];
</span><del>-    if (!stringForRange)
-        return nullptr;
-    
</del><span class="cx">     return [[stringForRange description] createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -701,32 +698,32 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumnHeaders()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRowHeaders()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumns()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRows()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfVisibleCells()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfHeader()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::traits()
</span><span class="lines">@@ -822,7 +819,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::selectedTextRange()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityUIElement::setSelectedVisibleTextRange(AccessibilityTextMarkerRange*)
</span><span class="lines">@@ -879,17 +876,17 @@
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::accessibilityValue() const
</span><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI()
</span><span class="cx"> {
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityUIElement::assistiveTechnologySimulatedFocus()
</span><span class="lines">@@ -929,9 +926,6 @@
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForSelection()
</span><span class="cx"> {
</span><span class="cx">     NSString *stringForRange = [m_element selectionRangeString];
</span><del>-    if (!stringForRange)
-        return nullptr;
-    
</del><span class="cx">     return [stringForRange createJSStringRef];
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="lines">@@ -1099,7 +1093,7 @@
</span><span class="cx"> {
</span><span class="cx">     id textMarkers = (id)markerRange->platformTextMarkerRange();
</span><span class="cx">     if (!textMarkers || ![textMarkers isKindOfClass:[NSArray class]])
</span><del>-        return JSStringCreateWithCharacters(0, 0);
</del><ins>+        return createEmptyJSString();
</ins><span class="cx">     return [[m_element stringForTextMarkers:textMarkers] createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityCommonMach"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.h (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.h 2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.h    2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -28,22 +28,19 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef AccessibilityCommonMac_h
-#define AccessibilityCommonMac_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #import "AccessibilityUIElement.h"
</span><ins>+#import <JavaScriptCore/JSRetainPtr.h>
</ins><span class="cx"> 
</span><del>-#import <JavaScriptCore/JSStringRef.h>
-
</del><span class="cx"> // If an unsupported attribute is passed in, it will raise an accessibility exception. These are usually caught by the Accessibility Runtime to inform
</span><span class="cx"> // the AX client app of the error. However, DRT is the AX client app, so it must catch these exceptions.
</span><span class="cx"> #define BEGIN_AX_OBJC_EXCEPTIONS @try {
</span><span class="cx"> #define END_AX_OBJC_EXCEPTIONS } @catch(NSException *e) { if (![[e name] isEqualToString:NSAccessibilityException]) @throw; }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> @interface NSString (JSStringRefAdditions)
</span><span class="cx"> + (NSString *)stringWithJSStringRef:(JSStringRef)jsStringRef;
</span><del>-- (JSStringRef)createJSStringRef;
</del><ins>+- (JSRetainPtr<JSStringRef>)createJSStringRef;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> namespace WTR {
</span><span class="lines">@@ -51,5 +48,3 @@
</span><span class="cx"> extern NSDictionary *searchPredicateParameterizedAttributeForSearchCriteria(JSContextRef, AccessibilityUIElement *startElement, bool isDirectionNext, unsigned resultsLimit, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly, bool immediateDescendantsOnly);
</span><span class="cx"> 
</span><span class="cx"> };
</span><del>-
-#endif // AccessibilityCommonMac_h
</del></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityCommonMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm        2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityCommonMac.mm   2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -31,8 +31,6 @@
</span><span class="cx"> #import "config.h"
</span><span class="cx"> #import "AccessibilityCommonMac.h"
</span><span class="cx"> 
</span><del>-#import <JavaScriptCore/JSRetainPtr.h>
-#import <JavaScriptCore/JSStringRef.h>
</del><span class="cx"> #import <JavaScriptCore/JSStringRefCF.h>
</span><span class="cx"> 
</span><span class="cx"> @implementation NSString (JSStringRefAdditions)
</span><span class="lines">@@ -45,9 +43,9 @@
</span><span class="cx">     return CFBridgingRelease(JSStringCopyCFString(kCFAllocatorDefault, jsStringRef));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (JSStringRef)createJSStringRef
</del><ins>+- (JSRetainPtr<JSStringRef>)createJSStringRef
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCFString((__bridge CFStringRef)self);
</del><ins>+    return adopt(JSStringCreateWithCFString((__bridge CFStringRef)self));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WTR {
</span><span class="lines">@@ -66,7 +64,7 @@
</span><span class="cx">     if (searchKey) {
</span><span class="cx">         id searchKeyParameter = nil;
</span><span class="cx">         if (JSValueIsString(context, searchKey)) {
</span><del>-            JSRetainPtr<JSStringRef> searchKeyString(Adopt, JSValueToStringCopy(context, searchKey, nullptr));
</del><ins>+            auto searchKeyString = adopt(JSValueToStringCopy(context, searchKey, nullptr));
</ins><span class="cx">             if (searchKeyString)
</span><span class="cx">                 searchKeyParameter = [NSString stringWithJSStringRef:searchKeyString.get()];
</span><span class="cx">         } else if (JSValueIsObject(context, searchKey)) {
</span><span class="lines">@@ -73,7 +71,7 @@
</span><span class="cx">             JSObjectRef searchKeyArray = JSValueToObject(context, searchKey, nullptr);
</span><span class="cx">             unsigned searchKeyArrayLength = 0;
</span><span class="cx">             
</span><del>-            JSRetainPtr<JSStringRef> lengthPropertyString(Adopt, JSStringCreateWithUTF8CString("length"));
</del><ins>+            auto lengthPropertyString = adopt(JSStringCreateWithUTF8CString("length"));
</ins><span class="cx">             JSValueRef searchKeyArrayLengthValue = JSObjectGetProperty(context, searchKeyArray, lengthPropertyString.get(), nullptr);
</span><span class="cx">             if (searchKeyArrayLengthValue && JSValueIsNumber(context, searchKeyArrayLengthValue))
</span><span class="cx">                 searchKeyArrayLength = static_cast<unsigned>(JSValueToNumber(context, searchKeyArrayLengthValue, nullptr));
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityControllerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm    2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm       2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -35,8 +35,6 @@
</span><span class="cx"> #import "AccessibilityNotificationHandler.h"
</span><span class="cx"> #import "InjectedBundle.h"
</span><span class="cx"> #import "InjectedBundlePage.h"
</span><del>-#import <JavaScriptCore/JSRetainPtr.h>
-#import <JavaScriptCore/JSStringRef.h>
</del><span class="cx"> #import <JavaScriptCore/JSStringRefCF.h>
</span><span class="cx"> #import <WebKit/WKBundle.h>
</span><span class="cx"> #import <WebKit/WKBundlePage.h>
</span><span class="lines">@@ -108,8 +106,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityController::platformName()
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("mac"));
-    return platformName;
</del><ins>+    return adopt(JSStringCreateWithUTF8CString("mac"));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WTR
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityNotificationHandlermm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm      2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm 2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -47,14 +47,14 @@
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface NSString (JSStringRefAdditions)
</span><del>-- (JSStringRef)createJSStringRef;
</del><ins>+- (JSRetainPtr<JSStringRef>)createJSStringRef;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation NSString (JSStringRefAdditions)
</span><span class="cx"> 
</span><del>-- (JSStringRef)createJSStringRef
</del><ins>+- (JSRetainPtr<JSStringRef>)createJSStringRef
</ins><span class="cx"> {
</span><del>-    return JSStringCreateWithCFString((__bridge CFStringRef)self);
</del><ins>+    return adopt(JSStringCreateWithCFString((__bridge CFStringRef)self));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx"> static JSValueRef makeValueRefForValue(JSContextRef context, id value)
</span><span class="cx"> {
</span><span class="cx">     if ([value isKindOfClass:[NSString class]])
</span><del>-        return JSValueMakeString(context, adopt([value createJSStringRef]).get());
</del><ins>+        return JSValueMakeString(context, [value createJSStringRef].get());
</ins><span class="cx">     if ([value isKindOfClass:[NSNumber class]]) {
</span><span class="cx">         if (!strcmp([value objCType], @encode(BOOL)))
</span><span class="cx">             return JSValueMakeBoolean(context, [value boolValue]);
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx">     [dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop)
</span><span class="cx">     {
</span><span class="cx">         if (JSValueRef propertyValue = makeValueRefForValue(context, obj))
</span><del>-            JSObjectSetProperty(context, object, adopt([key createJSStringRef]).get(), propertyValue, kJSPropertyAttributeNone, nullptr);
</del><ins>+            JSObjectSetProperty(context, object, [key createJSStringRef].get(), propertyValue, kJSPropertyAttributeNone, nullptr);
</ins><span class="cx">     }];
</span><span class="cx"> 
</span><span class="cx">     return object;
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx">     WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(WTR::InjectedBundle::singleton().page()->page());
</span><span class="cx">     JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
</span><span class="cx"> 
</span><del>-    JSValueRef notificationNameArgument = JSValueMakeString(context, adopt([notificationName createJSStringRef]).get());
</del><ins>+    JSValueRef notificationNameArgument = JSValueMakeString(context, [notificationName createJSStringRef].get());
</ins><span class="cx">     JSValueRef userInfoArgument = makeObjectRefForDictionary(context, userInfo);
</span><span class="cx">     if (m_platformElement) {
</span><span class="cx">         // Listener for one element gets the notification name and userInfo.
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm     2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -35,8 +35,6 @@
</span><span class="cx"> 
</span><span class="cx"> #import <AppKit/NSAccessibility.h>
</span><span class="cx"> #import <Foundation/Foundation.h>
</span><del>-#import <JavaScriptCore/JSRetainPtr.h>
-#import <JavaScriptCore/JSStringRef.h>
</del><span class="cx"> #import <JavaScriptCore/JSStringRefCF.h>
</span><span class="cx"> #import <JavaScriptCore/JSObjectRef.h>
</span><span class="cx"> #import <WebKit/WKBundleFrame.h>
</span><span class="lines">@@ -87,6 +85,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTR {
</span><span class="cx"> 
</span><ins>+static JSRetainPtr<JSStringRef> createEmptyJSString()
+{
+    return adopt(JSStringCreateWithCharacters(nullptr, 0));
+}
+
</ins><span class="cx"> AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
</span><span class="cx">     : m_element(element)
</span><span class="cx">     , m_notificationHandler(0)
</span><span class="lines">@@ -199,7 +202,7 @@
</span><span class="cx">     return arrayResult;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSStringRef concatenateAttributeAndValue(NSString* attribute, NSString* value)
</del><ins>+static JSRetainPtr<JSStringRef> concatenateAttributeAndValue(NSString* attribute, NSString* value)
</ins><span class="cx"> {
</span><span class="cx">     Vector<UniChar> buffer([attribute length]);
</span><span class="cx">     [attribute getCharacters:buffer.data()];
</span><span class="lines">@@ -210,7 +213,7 @@
</span><span class="cx">     [value getCharacters:valueBuffer.data()];
</span><span class="cx">     buffer.appendVector(valueBuffer);
</span><span class="cx"> 
</span><del>-    return JSStringCreateWithCharacters(buffer.data(), buffer.size());
</del><ins>+    return adopt(JSStringCreateWithCharacters(buffer.data(), buffer.size()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void convertNSArrayToVector(NSArray* array, Vector<RefPtr<AccessibilityUIElement> >& elementVector)
</span><span class="lines">@@ -220,7 +223,7 @@
</span><span class="cx">         elementVector.append(AccessibilityUIElement::create([array objectAtIndex:i]));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSStringRef descriptionOfElements(Vector<RefPtr<AccessibilityUIElement> >& elementVector)
</del><ins>+static JSRetainPtr<JSStringRef> descriptionOfElements(Vector<RefPtr<AccessibilityUIElement> >& elementVector)
</ins><span class="cx"> {
</span><span class="cx">     NSMutableString* allElementString = [NSMutableString string];
</span><span class="cx">     size_t size = elementVector.size();
</span><span class="lines">@@ -243,7 +246,7 @@
</span><span class="cx">     if (searchStrings) {
</span><span class="cx">         NSMutableArray *searchStringsParameter = [NSMutableArray array];
</span><span class="cx">         if (JSValueIsString(context, searchStrings)) {
</span><del>-            JSRetainPtr<JSStringRef> searchStringsString(Adopt, JSValueToStringCopy(context, searchStrings, nullptr));
</del><ins>+            auto searchStringsString = adopt(JSValueToStringCopy(context, searchStrings, nullptr));
</ins><span class="cx">             if (searchStringsString)
</span><span class="cx">                 [searchStringsParameter addObject:[NSString stringWithJSStringRef:searchStringsString.get()]];
</span><span class="cx">         }
</span><span class="lines">@@ -251,13 +254,13 @@
</span><span class="cx">             JSObjectRef searchStringsArray = JSValueToObject(context, searchStrings, nullptr);
</span><span class="cx">             unsigned searchStringsArrayLength = 0;
</span><span class="cx">             
</span><del>-            JSRetainPtr<JSStringRef> lengthPropertyString(Adopt, JSStringCreateWithUTF8CString("length"));
</del><ins>+            auto lengthPropertyString = adopt(JSStringCreateWithUTF8CString("length"));
</ins><span class="cx">             JSValueRef searchStringsArrayLengthValue = JSObjectGetProperty(context, searchStringsArray, lengthPropertyString.get(), nullptr);
</span><span class="cx">             if (searchStringsArrayLengthValue && JSValueIsNumber(context, searchStringsArrayLengthValue))
</span><span class="cx">                 searchStringsArrayLength = static_cast<unsigned>(JSValueToNumber(context, searchStringsArrayLengthValue, nullptr));
</span><span class="cx">             
</span><span class="cx">             for (unsigned i = 0; i < searchStringsArrayLength; ++i) {
</span><del>-                JSRetainPtr<JSStringRef> searchStringsString(Adopt, JSValueToStringCopy(context, JSObjectGetPropertyAtIndex(context, searchStringsArray, i, nullptr), nullptr));
</del><ins>+                auto searchStringsString = adopt(JSValueToStringCopy(context, JSObjectGetPropertyAtIndex(context, searchStringsArray, i, nullptr), nullptr));
</ins><span class="cx">                 if (searchStringsString)
</span><span class="cx">                     [searchStringsParameter addObject:[NSString stringWithJSStringRef:searchStringsString.get()]];
</span><span class="cx">             }
</span><span class="lines">@@ -1500,7 +1503,7 @@
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::accessibilityValue() const
</span><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding()
</span><span class="lines">@@ -1511,7 +1514,7 @@
</span><span class="cx">         return [value createJSStringRef];
</span><span class="cx">     END_AX_OBJC_EXCEPTIONS
</span><span class="cx">     
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI()
</span><span class="lines">@@ -1522,7 +1525,7 @@
</span><span class="cx">         return [value createJSStringRef];
</span><span class="cx">     END_AX_OBJC_EXCEPTIONS
</span><span class="cx">     
</span><del>-    return JSStringCreateWithCharacters(0, 0);
</del><ins>+    return createEmptyJSString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr<JSStringRef> AccessibilityUIElement::url()
</span><span class="lines">@@ -1825,7 +1828,7 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSStringRef createJSStringRef(id string)
</del><ins>+static JSRetainPtr<JSStringRef> createJSStringRef(id string)
</ins><span class="cx"> {
</span><span class="cx">     id mutableString = [[[NSMutableString alloc] init] autorelease];
</span><span class="cx">     id attributes = [string attributesAtIndex:0 effectiveRange:nil];
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerStringFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/StringFunctions.h (236031 => 236032)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/StringFunctions.h   2018-09-15 14:08:47 UTC (rev 236031)
+++ trunk/Tools/WebKitTestRunner/StringFunctions.h      2018-09-15 16:17:24 UTC (rev 236032)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">     return adoptWK(WKStringCreateWithJSString(string));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline WKRetainPtr<WKStringRef> toWK(JSRetainPtr<JSStringRef> string)
</del><ins>+inline WKRetainPtr<WKStringRef> toWK(const JSRetainPtr<JSStringRef>& string)
</ins><span class="cx"> {
</span><span class="cx">     return toWK(string.get());
</span><span class="cx"> }
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx"> 
</span><span class="cx"> inline JSRetainPtr<JSStringRef> toJS(WKStringRef string)
</span><span class="cx"> {
</span><del>-    return JSRetainPtr<JSStringRef>(Adopt, WKStringCopyJSString(string));
</del><ins>+    return adopt(WKStringCopyJSString(string));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline JSRetainPtr<JSStringRef> toJS(const WKRetainPtr<WKStringRef>& string)
</span></span></pre>
</div>
</div>

</body>
</html>