<!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>[237009] 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/237009">237009</a></dd>
<dt>Author</dt> <dd>yusukesuzuki@slowstart.org</dd>
<dt>Date</dt> <dd>2018-10-10 11:29:44 -0700 (Wed, 10 Oct 2018)</dd>
</dl>

<h3>Log Message</h3>
<pre>[JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
https://bugs.webkit.org/show_bug.cgi?id=190429

Reviewed by Saam Barati.

Source/JavaScriptCore:

Some createXXX functions can fail. But sometimes the caller does not perform error checking.
To make it explicit that these functions can fail, we rename these functions from createXXX
to tryCreateXXX. In this patch, we focus on non-JS-managed factory functions. If the factory
function does not fail, it should return Ref<>. Otherwise, it should be named as tryCreateXXX
and it should return RefPtr<>.

This patch mainly focuses on TypedArray factory functions. Previously, these functions are
`RefPtr<XXXArray> create(...)`. This patch changes them to `RefPtr<XXXArray> tryCreate(...)`.
And we also introduce `Ref<XXXArray> create(...)` function which internally performs
RELEASE_ASSERT on the result of `tryCreate(...)`.

And we also convert OpaqueJSString::create to OpaqueJSString::tryCreate since it can fail.

This change actually finds one place which does not perform any null checkings while it uses
`RefPtr<> create(...)` function.

* API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::getOwnPropertySlot):
(JSC::JSCallbackObject<Parent>::put):
(JSC::JSCallbackObject<Parent>::putByIndex):
(JSC::JSCallbackObject<Parent>::deleteProperty):
(JSC::JSCallbackObject<Parent>::callbackGetter):
* API/JSClassRef.h:
(StaticValueEntry::StaticValueEntry):
* API/JSContext.mm:
(-[JSContext evaluateScript:withSourceURL:]):
(-[JSContext setName:]):
* API/JSContextRef.cpp:
(JSGlobalContextCopyName):
(JSContextCreateBacktrace):
* API/JSObjectRef.cpp:
(JSObjectCopyPropertyNames):
* API/JSScriptRef.cpp:
* API/JSStringRef.cpp:
(JSStringCreateWithCharactersNoCopy):
* API/JSValue.mm:
(+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]):
(+[JSValue valueWithNewErrorFromMessage:inContext:]):
(+[JSValue valueWithNewSymbolFromDescription:inContext:]):
(performPropertyOperation):
(-[JSValue invokeMethod:withArguments:]):
(containerValueToObject):
(objectToValueWithoutCopy):
(objectToValue):
* API/JSValueRef.cpp:
(JSValueCreateJSONString):
(JSValueToStringCopy):
* API/OpaqueJSString.cpp:
(OpaqueJSString::tryCreate):
(OpaqueJSString::create): Deleted.
* API/OpaqueJSString.h:
* API/glib/JSCContext.cpp:
(evaluateScriptInContext):
* API/glib/JSCValue.cpp:
(jsc_value_new_string_from_bytes):
* ftl/FTLLazySlowPath.h:
(JSC::FTL::LazySlowPath::createGenerator):
* ftl/FTLLazySlowPathCall.h:
(JSC::FTL::createLazyCallGenerator):
* ftl/FTLOSRExit.cpp:
(JSC::FTL::OSRExitDescriptor::emitOSRExit):
(JSC::FTL::OSRExitDescriptor::emitOSRExitLater):
(JSC::FTL::OSRExitDescriptor::prepareOSRExitHandle):
* ftl/FTLOSRExit.h:
* ftl/FTLPatchpointExceptionHandle.cpp:
(JSC::FTL::PatchpointExceptionHandle::create):
(JSC::FTL::PatchpointExceptionHandle::createHandle):
* ftl/FTLPatchpointExceptionHandle.h:
* heap/EdenGCActivityCallback.h:
(JSC::GCActivityCallback::tryCreateEdenTimer):
(JSC::GCActivityCallback::createEdenTimer): Deleted.
* heap/FullGCActivityCallback.h:
(JSC::GCActivityCallback::tryCreateFullTimer):
(JSC::GCActivityCallback::createFullTimer): Deleted.
* heap/GCActivityCallback.h:
* heap/Heap.cpp:
(JSC::Heap::Heap):
* inspector/AsyncStackTrace.cpp:
(Inspector::AsyncStackTrace::create):
* inspector/AsyncStackTrace.h:
* jsc.cpp:
(fillBufferWithContentsOfFile):
* runtime/ArrayBuffer.h:
* runtime/GenericTypedArrayView.h:
* runtime/GenericTypedArrayViewInlines.h:
(JSC::GenericTypedArrayView<Adaptor>::create):
(JSC::GenericTypedArrayView<Adaptor>::tryCreate):
(JSC::GenericTypedArrayView<Adaptor>::createUninitialized):
(JSC::GenericTypedArrayView<Adaptor>::tryCreateUninitialized):
(JSC::GenericTypedArrayView<Adaptor>::subarray const):
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::possiblySharedImpl):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::possiblySharedTypedImpl):
(JSC::JSGenericTypedArrayView<Adaptor>::unsharedTypedImpl):
* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::tryCreate):
* wasm/WasmMemory.h:
* wasm/WasmTable.cpp:
(JSC::Wasm::Table::tryCreate):
(JSC::Wasm::Table::create): Deleted.
* wasm/WasmTable.h:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::create):
* wasm/js/JSWebAssemblyMemory.cpp:
(JSC::JSWebAssemblyMemory::JSWebAssemblyMemory):
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::constructJSWebAssemblyMemory):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::constructJSWebAssemblyTable):

Source/WebCore:

Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.

* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::cachedKeyForKeyID const):
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::jsValueWithDictionaryInContext):
* Modules/webaudio/AudioBuffer.cpp:
(WebCore::AudioBuffer::AudioBuffer):
(WebCore::AudioBuffer::getChannelData):
* Modules/webvr/VREyeParameters.cpp:
(WebCore::VREyeParameters::offset const):
* Modules/webvr/VRFrameData.cpp:
(WebCore::matrixToArray):
* Modules/webvr/VRPose.cpp:
(WebCore::optionalFloat3ToJSCArray):
(WebCore::VRPose::position const):
(WebCore::VRPose::orientation const):
* Modules/webvr/VRStageParameters.cpp:
(WebCore::VRStageParameters::sittingToStandingTransform const):
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::enqueue):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readArrayBufferView):
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::algorithm const):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::algorithm const):
* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::toFloat32Array const):
(WebCore::DOMMatrixReadOnly::toFloat64Array const):
* css/FontFace.cpp:
(WebCore::FontFace::create):
* dom/TextEncoder.cpp:
(WebCore::TextEncoder::encode const):
* html/ImageData.cpp:
(WebCore::ImageData::ImageData):
* html/ImageData.h:
(WebCore::ImageData::data const):
(): Deleted.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
(WebCore::WebGL2RenderingContext::getInternalformatParameter):
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getUniform):
(WebCore::WebGLRenderingContextBase::getVertexAttrib):
(WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
(WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
(WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
(WebCore::CDMSessionAVContentKeySession::releaseKeys):
(WebCore::CDMSessionAVContentKeySession::update):
(WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::generateKeyRequest):
(WebCore::CDMSessionAVStreamSession::releaseKeys):
(WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::getRGBAImageData const):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::getImageData):
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData const):
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::platformApplySoftware):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::unmultipliedResult):
(WebCore::FilterEffect::premultipliedResult):
(WebCore::FilterEffect::copyUnmultipliedResult):
(WebCore::FilterEffect::copyPremultipliedResult):
(WebCore::FilterEffect::createUnmultipliedImageResult):
(WebCore::FilterEffect::createPremultipliedImageResult):
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData const):
* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::jsValueWithDictionaryInContext):
* platform/mock/mediasource/MockBox.cpp:
(WebCore::MockBox::peekType):
(WebCore::MockBox::peekLength):
(WebCore::MockTrackBox::MockTrackBox):
(WebCore::MockInitializationBox::MockInitializationBox):
(WebCore::MockSampleBox::MockSampleBox):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
* testing/LegacyMockCDM.cpp:
(WebCore::initDataPrefix):
(WebCore::keyPrefix):
(WebCore::keyRequest):

Source/WebKit:

Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.

* Shared/API/c/WKString.cpp:
(WKStringCopyJSString):
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::toJSValue):
(WebKit::callPropertyFunction):
(WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::runScriptsInPDFDocument):

Source/WebKitLegacy/ios:

Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.

* WebView/WebPDFViewIOS.mm:
(-[WebPDFView finishedLoadingWithDataSource:]):
* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder _evaluateJSForDocument:]):

Source/WebKitLegacy/mac:

Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.

* WebView/WebPDFRepresentation.mm:
(-[WebPDFRepresentation finishedLoadingWithDataSource:]):

Tools:

* TestWebKitAPI/Tests/WebCore/mac/GPUBuffer.mm:
(TestWebKitAPI::TEST_F):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreAPIJSCallbackObjectFunctionsh">trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSClassRefh">trunk/Source/JavaScriptCore/API/JSClassRef.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSContextmm">trunk/Source/JavaScriptCore/API/JSContext.mm</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSContextRefcpp">trunk/Source/JavaScriptCore/API/JSContextRef.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSObjectRefcpp">trunk/Source/JavaScriptCore/API/JSObjectRef.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSScriptRefcpp">trunk/Source/JavaScriptCore/API/JSScriptRef.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSStringRefcpp">trunk/Source/JavaScriptCore/API/JSStringRef.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSValuemm">trunk/Source/JavaScriptCore/API/JSValue.mm</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSValueRefcpp">trunk/Source/JavaScriptCore/API/JSValueRef.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIOpaqueJSStringcpp">trunk/Source/JavaScriptCore/API/OpaqueJSString.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIOpaqueJSStringh">trunk/Source/JavaScriptCore/API/OpaqueJSString.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIglibJSCContextcpp">trunk/Source/JavaScriptCore/API/glib/JSCContext.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIglibJSCValuecpp">trunk/Source/JavaScriptCore/API/glib/JSCValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLLazySlowPathh">trunk/Source/JavaScriptCore/ftl/FTLLazySlowPath.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLLazySlowPathCallh">trunk/Source/JavaScriptCore/ftl/FTLLazySlowPathCall.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLOSRExitcpp">trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLOSRExith">trunk/Source/JavaScriptCore/ftl/FTLOSRExit.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLPatchpointExceptionHandlecpp">trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLPatchpointExceptionHandleh">trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapEdenGCActivityCallbackh">trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapFullGCActivityCallbackh">trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapGCActivityCallbackh">trunk/Source/JavaScriptCore/heap/GCActivityCallback.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapcpp">trunk/Source/JavaScriptCore/heap/Heap.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorAsyncStackTracecpp">trunk/Source/JavaScriptCore/inspector/AsyncStackTrace.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorAsyncStackTraceh">trunk/Source/JavaScriptCore/inspector/AsyncStackTrace.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejsccpp">trunk/Source/JavaScriptCore/jsc.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeArrayBufferh">trunk/Source/JavaScriptCore/runtime/ArrayBuffer.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeGenericTypedArrayViewh">trunk/Source/JavaScriptCore/runtime/GenericTypedArrayView.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeGenericTypedArrayViewInlinesh">trunk/Source/JavaScriptCore/runtime/GenericTypedArrayViewInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayBufferViewcpp">trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewInlinesh">trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmMemorycpp">trunk/Source/JavaScriptCore/wasm/WasmMemory.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmMemoryh">trunk/Source/JavaScriptCore/wasm/WasmMemory.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmTablecpp">trunk/Source/JavaScriptCore/wasm/WasmTable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmTableh">trunk/Source/JavaScriptCore/wasm/WasmTable.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyInstancecpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsJSWebAssemblyMemorycpp">trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyMemoryConstructorcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyModuleRecordcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyTableConstructorcpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMSessionClearKeycpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioBuffercpp">trunk/Source/WebCore/Modules/webaudio/AudioBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebvrVREyeParameterscpp">trunk/Source/WebCore/Modules/webvr/VREyeParameters.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebvrVRFrameDatacpp">trunk/Source/WebCore/Modules/webvr/VRFrameData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebvrVRPosecpp">trunk/Source/WebCore/Modules/webvr/VRPose.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebvrVRStageParameterscpp">trunk/Source/WebCore/Modules/webvr/VRStageParameters.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsReadableStreamDefaultControllerh">trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsSerializedScriptValuecpp">trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptogcryptCryptoKeyRSAGCryptcpp">trunk/Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptomacCryptoKeyRSAMaccpp">trunk/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp</a></li>
<li><a href="#trunkSourceWebCorecssDOMMatrixReadOnlycpp">trunk/Source/WebCore/css/DOMMatrixReadOnly.cpp</a></li>
<li><a href="#trunkSourceWebCorecssFontFacecpp">trunk/Source/WebCore/css/FontFace.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTextEncodercpp">trunk/Source/WebCore/dom/TextEncoder.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlImageDatacpp">trunk/Source/WebCore/html/ImageData.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlImageDatah">trunk/Source/WebCore/html/ImageData.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGL2RenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfCDMSessionAVFoundationCFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVContentKeySessionmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVStreamSessionmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSampleAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoImageBufferCairocpp">trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageBufferDataCGcpp">trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFEGaussianBlurcpp">trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFilterEffectcpp">trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinImageBufferDataDirect2Dcpp">trunk/Source/WebCore/platform/graphics/win/ImageBufferDataDirect2D.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacSerializedPlatformRepresentationMacmm">trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockBoxcpp">trunk/Source/WebCore/platform/mock/mediasource/MockBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesShapecpp">trunk/Source/WebCore/rendering/shapes/Shape.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingLegacyMockCDMcpp">trunk/Source/WebCore/testing/LegacyMockCDM.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedAPIcWKStringcpp">trunk/Source/WebKit/Shared/API/c/WKString.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessAutomationWebAutomationSessionProxycpp">trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessPluginsPDFPDFPluginmm">trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm</a></li>
<li><a href="#trunkSourceWebKitLegacyiosChangeLog">trunk/Source/WebKitLegacy/ios/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacyiosWebViewWebPDFViewIOSmm">trunk/Source/WebKitLegacy/ios/WebView/WebPDFViewIOS.mm</a></li>
<li><a href="#trunkSourceWebKitLegacyiosWebViewWebPDFViewPlaceholdermm">trunk/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm</a></li>
<li><a href="#trunkSourceWebKitLegacymacChangeLog">trunk/Source/WebKitLegacy/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebViewWebPDFRepresentationmm">trunk/Source/WebKitLegacy/mac/WebView/WebPDFRepresentation.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoremacGPUBuffermm">trunk/Tools/TestWebKitAPI/Tests/WebCore/mac/GPUBuffer.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreAPIJSCallbackObjectFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h      2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h 2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx">             // optional optimization to bypass getProperty in cases when we only need to know if the property exists
</span><span class="cx">             if (JSObjectHasPropertyCallback hasProperty = jsClass->hasProperty) {
</span><span class="cx">                 if (!propertyNameRef)
</span><del>-                    propertyNameRef = OpaqueJSString::create(name);
</del><ins>+                    propertyNameRef = OpaqueJSString::tryCreate(name);
</ins><span class="cx">                 JSLock::DropAllLocks dropAllLocks(exec);
</span><span class="cx">                 if (hasProperty(ctx, thisRef, propertyNameRef.get())) {
</span><span class="cx">                     slot.setCustom(thisObject, PropertyAttribute::ReadOnly | PropertyAttribute::DontEnum, callbackGetter);
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx">                 }
</span><span class="cx">             } else if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) {
</span><span class="cx">                 if (!propertyNameRef)
</span><del>-                    propertyNameRef = OpaqueJSString::create(name);
</del><ins>+                    propertyNameRef = OpaqueJSString::tryCreate(name);
</ins><span class="cx">                 JSValueRef exception = 0;
</span><span class="cx">                 JSValueRef value;
</span><span class="cx">                 {
</span><span class="lines">@@ -252,7 +252,7 @@
</span><span class="cx">         for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) {
</span><span class="cx">             if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) {
</span><span class="cx">                 if (!propertyNameRef)
</span><del>-                    propertyNameRef = OpaqueJSString::create(name);
</del><ins>+                    propertyNameRef = OpaqueJSString::tryCreate(name);
</ins><span class="cx">                 JSValueRef exception = 0;
</span><span class="cx">                 bool result;
</span><span class="cx">                 {
</span><span class="lines">@@ -316,7 +316,7 @@
</span><span class="cx">     for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) {
</span><span class="cx">         if (JSObjectSetPropertyCallback setProperty = jsClass->setProperty) {
</span><span class="cx">             if (!propertyNameRef)
</span><del>-                propertyNameRef = OpaqueJSString::create(propertyName.impl());
</del><ins>+                propertyNameRef = OpaqueJSString::tryCreate(propertyName.impl());
</ins><span class="cx">             JSValueRef exception = 0;
</span><span class="cx">             bool result;
</span><span class="cx">             {
</span><span class="lines">@@ -375,7 +375,7 @@
</span><span class="cx">         for (JSClassRef jsClass = thisObject->classRef(); jsClass; jsClass = jsClass->parentClass) {
</span><span class="cx">             if (JSObjectDeletePropertyCallback deleteProperty = jsClass->deleteProperty) {
</span><span class="cx">                 if (!propertyNameRef)
</span><del>-                    propertyNameRef = OpaqueJSString::create(name);
</del><ins>+                    propertyNameRef = OpaqueJSString::tryCreate(name);
</ins><span class="cx">                 JSValueRef exception = 0;
</span><span class="cx">                 bool result;
</span><span class="cx">                 {
</span><span class="lines">@@ -679,7 +679,7 @@
</span><span class="cx">         for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) {
</span><span class="cx">             if (JSObjectGetPropertyCallback getProperty = jsClass->getProperty) {
</span><span class="cx">                 if (!propertyNameRef)
</span><del>-                    propertyNameRef = OpaqueJSString::create(name);
</del><ins>+                    propertyNameRef = OpaqueJSString::tryCreate(name);
</ins><span class="cx">                 JSValueRef exception = 0;
</span><span class="cx">                 JSValueRef value;
</span><span class="cx">                 {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSClassRefh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSClassRef.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSClassRef.h     2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/JSClassRef.h        2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -37,7 +37,10 @@
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx">     StaticValueEntry(JSObjectGetPropertyCallback _getProperty, JSObjectSetPropertyCallback _setProperty, JSPropertyAttributes _attributes, String& propertyName)
</span><del>-    : getProperty(_getProperty), setProperty(_setProperty), attributes(_attributes), propertyNameRef(OpaqueJSString::create(propertyName))
</del><ins>+        : getProperty(_getProperty)
+        , setProperty(_setProperty)
+        , attributes(_attributes)
+        , propertyNameRef(OpaqueJSString::tryCreate(propertyName))
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSContextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSContext.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSContext.mm     2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/JSContext.mm        2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -100,8 +100,8 @@
</span><span class="cx"> - (JSValue *)evaluateScript:(NSString *)script withSourceURL:(NSURL *)sourceURL
</span><span class="cx"> {
</span><span class="cx">     JSValueRef exceptionValue = nullptr;
</span><del>-    auto scriptJS = OpaqueJSString::create(script);
-    auto sourceURLJS = OpaqueJSString::create([sourceURL absoluteString]);
</del><ins>+    auto scriptJS = OpaqueJSString::tryCreate(script);
+    auto sourceURLJS = OpaqueJSString::tryCreate([sourceURL absoluteString]);
</ins><span class="cx">     JSValueRef result = JSEvaluateScript(m_context, scriptJS.get(), nullptr, sourceURLJS.get(), 0, &exceptionValue);
</span><span class="cx"> 
</span><span class="cx">     if (exceptionValue)
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)setName:(NSString *)name
</span><span class="cx"> {
</span><del>-    JSGlobalContextSetName(m_context, OpaqueJSString::create(name).get());
</del><ins>+    JSGlobalContextSetName(m_context, OpaqueJSString::tryCreate(name).get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)_remoteInspectionEnabled
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSContextRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSContextRef.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSContextRef.cpp 2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/JSContextRef.cpp    2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -232,7 +232,7 @@
</span><span class="cx">     if (name.isNull())
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    return OpaqueJSString::create(name).leakRef();
</del><ins>+    return OpaqueJSString::tryCreate(name).leakRef();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSGlobalContextSetName(JSGlobalContextRef ctx, JSStringRef name)
</span><span class="lines">@@ -316,7 +316,7 @@
</span><span class="cx">     BacktraceFunctor functor(builder, maxStackSize);
</span><span class="cx">     frame->iterate(functor);
</span><span class="cx"> 
</span><del>-    return OpaqueJSString::create(builder.toString()).leakRef();
</del><ins>+    return OpaqueJSString::tryCreate(builder.toString()).leakRef();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSGlobalContextGetRemoteInspectionEnabled(JSGlobalContextRef ctx)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSObjectRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSObjectRef.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSObjectRef.cpp  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/JSObjectRef.cpp     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -820,7 +820,7 @@
</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(OpaqueJSString::create(array[i].string()).releaseNonNull());
</del><ins>+        propertyNames->array.uncheckedAppend(OpaqueJSString::tryCreate(array[i].string()).releaseNonNull());
</ins><span class="cx"> 
</span><span class="cx">     return JSPropertyNameArrayRetain(propertyNames);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSScriptRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSScriptRef.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSScriptRef.cpp  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/JSScriptRef.cpp     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">     ParserError error;
</span><span class="cx">     if (!parseScript(vm, SourceCode(result.copyRef()), error)) {
</span><span class="cx">         if (errorMessage)
</span><del>-            *errorMessage = OpaqueJSString::create(error.message()).leakRef();
</del><ins>+            *errorMessage = OpaqueJSString::tryCreate(error.message()).leakRef();
</ins><span class="cx">         if (errorLine)
</span><span class="cx">             *errorLine = error.line();
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx">     ParserError error;
</span><span class="cx">     if (!parseScript(vm, SourceCode(result.copyRef()), error)) {
</span><span class="cx">         if (errorMessage)
</span><del>-            *errorMessage = OpaqueJSString::create(error.message()).leakRef();
</del><ins>+            *errorMessage = OpaqueJSString::tryCreate(error.message()).leakRef();
</ins><span class="cx">         if (errorLine)
</span><span class="cx">             *errorLine = error.line();
</span><span class="cx">         return nullptr;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSStringRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSStringRef.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSStringRef.cpp  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/JSStringRef.cpp     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx"> JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars)
</span><span class="cx"> {
</span><span class="cx">     initializeThreading();
</span><del>-    return OpaqueJSString::create(StringImpl::createWithoutCopying(reinterpret_cast<const UChar*>(chars), numChars)).leakRef();
</del><ins>+    return OpaqueJSString::tryCreate(StringImpl::createWithoutCopying(reinterpret_cast<const UChar*>(chars), numChars)).leakRef();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSStringRef JSStringRetain(JSStringRef string)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSValuemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSValue.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSValue.mm       2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/JSValue.mm  2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -126,8 +126,8 @@
</span><span class="cx"> 
</span><span class="cx"> + (JSValue *)valueWithNewRegularExpressionFromPattern:(NSString *)pattern flags:(NSString *)flags inContext:(JSContext *)context
</span><span class="cx"> {
</span><del>-    auto patternString = OpaqueJSString::create(pattern);
-    auto flagsString = OpaqueJSString::create(flags);
</del><ins>+    auto patternString = OpaqueJSString::tryCreate(pattern);
+    auto flagsString = OpaqueJSString::tryCreate(flags);
</ins><span class="cx">     JSValueRef arguments[2] = { JSValueMakeString([context JSGlobalContextRef], patternString.get()), JSValueMakeString([context JSGlobalContextRef], flagsString.get()) };
</span><span class="cx">     return [JSValue valueWithJSValueRef:JSObjectMakeRegExp([context JSGlobalContextRef], 2, arguments, 0) inContext:context];
</span><span class="cx"> }
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> 
</span><span class="cx"> + (JSValue *)valueWithNewErrorFromMessage:(NSString *)message inContext:(JSContext *)context
</span><span class="cx"> {
</span><del>-    auto string = OpaqueJSString::create(message);
</del><ins>+    auto string = OpaqueJSString::tryCreate(message);
</ins><span class="cx">     JSValueRef argument = JSValueMakeString([context JSGlobalContextRef], string.get());
</span><span class="cx">     return [JSValue valueWithJSValueRef:JSObjectMakeError([context JSGlobalContextRef], 1, &argument, 0) inContext:context];
</span><span class="cx"> }
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> 
</span><span class="cx"> + (JSValue *)valueWithNewSymbolFromDescription:(NSString *)description inContext:(JSContext *)context
</span><span class="cx"> {
</span><del>-    auto string = OpaqueJSString::create(description);
</del><ins>+    auto string = OpaqueJSString::tryCreate(description);
</ins><span class="cx">     return [JSValue valueWithJSValueRef:JSValueMakeSymbol([context JSGlobalContextRef], string.get()) inContext:context];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -292,7 +292,7 @@
</span><span class="cx">     Result result;
</span><span class="cx">     // If it's a NSString already, reduce indirection and just pass the NSString.
</span><span class="cx">     if ([propertyKey isKindOfClass:[NSString class]]) {
</span><del>-        auto name = OpaqueJSString::create((NSString *)propertyKey);
</del><ins>+        auto name = OpaqueJSString::tryCreate((NSString *)propertyKey);
</ins><span class="cx">         result = stringFunction([context JSGlobalContextRef], object, name.get(), arguments..., &exception);
</span><span class="cx">     } else
</span><span class="cx">         result = jsFunction([context JSGlobalContextRef], object, [[JSValue valueWithObject:propertyKey inContext:context] JSValueRef], arguments..., &exception);
</span><span class="lines">@@ -520,7 +520,7 @@
</span><span class="cx">     if (exception)
</span><span class="cx">         return [_context valueFromNotifyException:exception];
</span><span class="cx"> 
</span><del>-    auto name = OpaqueJSString::create(method);
</del><ins>+    auto name = OpaqueJSString::tryCreate(method);
</ins><span class="cx">     JSValueRef function = JSObjectGetProperty([_context JSGlobalContextRef], thisObject, name.get(), &exception);
</span><span class="cx">     if (exception)
</span><span class="cx">         return [_context valueFromNotifyException:exception];
</span><span class="lines">@@ -774,7 +774,7 @@
</span><span class="cx">             ASSERT([current.objc isKindOfClass:[NSMutableArray class]]);
</span><span class="cx">             NSMutableArray *array = (NSMutableArray *)current.objc;
</span><span class="cx">         
</span><del>-            auto lengthString = OpaqueJSString::create("length"_s);
</del><ins>+            auto lengthString = OpaqueJSString::tryCreate("length"_s);
</ins><span class="cx">             unsigned length = JSC::toUInt32(JSValueToNumber(context, JSObjectGetProperty(context, js, lengthString.get(), 0), 0));
</span><span class="cx"> 
</span><span class="cx">             for (unsigned i = 0; i < length; ++i) {
</span><span class="lines">@@ -984,7 +984,7 @@
</span><span class="cx">             return { object, ((JSValue *)object)->m_value, ContainerNone };
</span><span class="cx"> 
</span><span class="cx">         if ([object isKindOfClass:[NSString class]]) {
</span><del>-            auto string = OpaqueJSString::create((NSString *)object);
</del><ins>+            auto string = OpaqueJSString::tryCreate((NSString *)object);
</ins><span class="cx">             return { object, JSValueMakeString(contextRef, string.get()), ContainerNone };
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1041,7 +1041,7 @@
</span><span class="cx">             NSDictionary *dictionary = (NSDictionary *)current.objc;
</span><span class="cx">             for (id key in [dictionary keyEnumerator]) {
</span><span class="cx">                 if ([key isKindOfClass:[NSString class]]) {
</span><del>-                    auto propertyName = OpaqueJSString::create((NSString *)key);
</del><ins>+                    auto propertyName = OpaqueJSString::tryCreate((NSString *)key);
</ins><span class="cx">                     JSObjectSetProperty(contextRef, js, propertyName.get(), convertor.convert([dictionary objectForKey:key]), 0, 0);
</span><span class="cx">                 }
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSValueRefcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/JSValueRef.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSValueRef.cpp   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/JSValueRef.cpp      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -386,7 +386,7 @@
</span><span class="cx">         *exception = 0;
</span><span class="cx">     if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow)
</span><span class="cx">         return 0;
</span><del>-    return OpaqueJSString::create(result).leakRef();
</del><ins>+    return OpaqueJSString::tryCreate(result).leakRef();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSValueToBoolean(JSContextRef ctx, JSValueRef value)
</span><span class="lines">@@ -434,7 +434,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSValue jsValue = toJS(exec, value);
</span><span class="cx">     
</span><del>-    auto stringRef(OpaqueJSString::create(jsValue.toWTFString(exec)));
</del><ins>+    auto stringRef(OpaqueJSString::tryCreate(jsValue.toWTFString(exec)));
</ins><span class="cx">     if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow)
</span><span class="cx">         stringRef = nullptr;
</span><span class="cx">     return stringRef.leakRef();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIOpaqueJSStringcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/OpaqueJSString.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/OpaqueJSString.cpp       2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/OpaqueJSString.cpp  2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><del>-RefPtr<OpaqueJSString> OpaqueJSString::create(const String& string)
</del><ins>+RefPtr<OpaqueJSString> OpaqueJSString::tryCreate(const String& string)
</ins><span class="cx"> {
</span><span class="cx">     if (string.isNull())
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">     return adoptRef(new OpaqueJSString(string));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<OpaqueJSString> OpaqueJSString::create(String&& string)
</del><ins>+RefPtr<OpaqueJSString> OpaqueJSString::tryCreate(String&& string)
</ins><span class="cx"> {
</span><span class="cx">     if (string.isNull())
</span><span class="cx">         return nullptr;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIOpaqueJSStringh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/OpaqueJSString.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/OpaqueJSString.h 2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/OpaqueJSString.h    2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -51,8 +51,8 @@
</span><span class="cx">         return adoptRef(*new OpaqueJSString(characters, length));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JS_EXPORT_PRIVATE static RefPtr<OpaqueJSString> create(const String&);
-    JS_EXPORT_PRIVATE static RefPtr<OpaqueJSString> create(String&&);
</del><ins>+    JS_EXPORT_PRIVATE static RefPtr<OpaqueJSString> tryCreate(const String&);
+    JS_EXPORT_PRIVATE static RefPtr<OpaqueJSString> tryCreate(String&&);
</ins><span class="cx"> 
</span><span class="cx">     JS_EXPORT_PRIVATE ~OpaqueJSString();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIglibJSCContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/glib/JSCContext.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/glib/JSCContext.cpp      2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/glib/JSCContext.cpp 2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -819,7 +819,7 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef evaluateScriptInContext(JSGlobalContextRef jsContext, String&& script, const char* uri, unsigned lineNumber, JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    JSRetainPtr<JSStringRef> scriptJS(Adopt, OpaqueJSString::create(WTFMove(script)).leakRef());
</del><ins>+    JSRetainPtr<JSStringRef> scriptJS(Adopt, OpaqueJSString::tryCreate(WTFMove(script)).leakRef());
</ins><span class="cx">     JSRetainPtr<JSStringRef> sourceURI = uri ? adopt(JSStringCreateWithUTF8CString(uri)) : nullptr;
</span><span class="cx">     return JSEvaluateScript(jsContext, scriptJS.get(), nullptr, sourceURI.get(), lineNumber, exception);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIglibJSCValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/glib/JSCValue.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/glib/JSCValue.cpp        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/API/glib/JSCValue.cpp   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -367,7 +367,7 @@
</span><span class="cx">     gsize dataSize;
</span><span class="cx">     const auto* data = static_cast<const char*>(g_bytes_get_data(bytes, &dataSize));
</span><span class="cx">     auto string = String::fromUTF8(data, dataSize);
</span><del>-    JSRetainPtr<JSStringRef> jsString(Adopt, OpaqueJSString::create(WTFMove(string)).leakRef());
</del><ins>+    JSRetainPtr<JSStringRef> jsString(Adopt, OpaqueJSString::tryCreate(WTFMove(string)).leakRef());
</ins><span class="cx">     return jscContextGetOrCreateValue(context, JSValueMakeString(jscContextGetJSContext(context), jsString.get())).leakRef();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/ChangeLog       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -1,3 +1,124 @@
</span><ins>+2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
+
+        [JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
+        https://bugs.webkit.org/show_bug.cgi?id=190429
+
+        Reviewed by Saam Barati.
+
+        Some createXXX functions can fail. But sometimes the caller does not perform error checking.
+        To make it explicit that these functions can fail, we rename these functions from createXXX
+        to tryCreateXXX. In this patch, we focus on non-JS-managed factory functions. If the factory
+        function does not fail, it should return Ref<>. Otherwise, it should be named as tryCreateXXX
+        and it should return RefPtr<>.
+
+        This patch mainly focuses on TypedArray factory functions. Previously, these functions are
+        `RefPtr<XXXArray> create(...)`. This patch changes them to `RefPtr<XXXArray> tryCreate(...)`.
+        And we also introduce `Ref<XXXArray> create(...)` function which internally performs
+        RELEASE_ASSERT on the result of `tryCreate(...)`.
+
+        And we also convert OpaqueJSString::create to OpaqueJSString::tryCreate since it can fail.
+
+        This change actually finds one place which does not perform any null checkings while it uses
+        `RefPtr<> create(...)` function.
+
+        * API/JSCallbackObjectFunctions.h:
+        (JSC::JSCallbackObject<Parent>::getOwnPropertySlot):
+        (JSC::JSCallbackObject<Parent>::put):
+        (JSC::JSCallbackObject<Parent>::putByIndex):
+        (JSC::JSCallbackObject<Parent>::deleteProperty):
+        (JSC::JSCallbackObject<Parent>::callbackGetter):
+        * API/JSClassRef.h:
+        (StaticValueEntry::StaticValueEntry):
+        * API/JSContext.mm:
+        (-[JSContext evaluateScript:withSourceURL:]):
+        (-[JSContext setName:]):
+        * API/JSContextRef.cpp:
+        (JSGlobalContextCopyName):
+        (JSContextCreateBacktrace):
+        * API/JSObjectRef.cpp:
+        (JSObjectCopyPropertyNames):
+        * API/JSScriptRef.cpp:
+        * API/JSStringRef.cpp:
+        (JSStringCreateWithCharactersNoCopy):
+        * API/JSValue.mm:
+        (+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]):
+        (+[JSValue valueWithNewErrorFromMessage:inContext:]):
+        (+[JSValue valueWithNewSymbolFromDescription:inContext:]):
+        (performPropertyOperation):
+        (-[JSValue invokeMethod:withArguments:]):
+        (containerValueToObject):
+        (objectToValueWithoutCopy):
+        (objectToValue):
+        * API/JSValueRef.cpp:
+        (JSValueCreateJSONString):
+        (JSValueToStringCopy):
+        * API/OpaqueJSString.cpp:
+        (OpaqueJSString::tryCreate):
+        (OpaqueJSString::create): Deleted.
+        * API/OpaqueJSString.h:
+        * API/glib/JSCContext.cpp:
+        (evaluateScriptInContext):
+        * API/glib/JSCValue.cpp:
+        (jsc_value_new_string_from_bytes):
+        * ftl/FTLLazySlowPath.h:
+        (JSC::FTL::LazySlowPath::createGenerator):
+        * ftl/FTLLazySlowPathCall.h:
+        (JSC::FTL::createLazyCallGenerator):
+        * ftl/FTLOSRExit.cpp:
+        (JSC::FTL::OSRExitDescriptor::emitOSRExit):
+        (JSC::FTL::OSRExitDescriptor::emitOSRExitLater):
+        (JSC::FTL::OSRExitDescriptor::prepareOSRExitHandle):
+        * ftl/FTLOSRExit.h:
+        * ftl/FTLPatchpointExceptionHandle.cpp:
+        (JSC::FTL::PatchpointExceptionHandle::create):
+        (JSC::FTL::PatchpointExceptionHandle::createHandle):
+        * ftl/FTLPatchpointExceptionHandle.h:
+        * heap/EdenGCActivityCallback.h:
+        (JSC::GCActivityCallback::tryCreateEdenTimer):
+        (JSC::GCActivityCallback::createEdenTimer): Deleted.
+        * heap/FullGCActivityCallback.h:
+        (JSC::GCActivityCallback::tryCreateFullTimer):
+        (JSC::GCActivityCallback::createFullTimer): Deleted.
+        * heap/GCActivityCallback.h:
+        * heap/Heap.cpp:
+        (JSC::Heap::Heap):
+        * inspector/AsyncStackTrace.cpp:
+        (Inspector::AsyncStackTrace::create):
+        * inspector/AsyncStackTrace.h:
+        * jsc.cpp:
+        (fillBufferWithContentsOfFile):
+        * runtime/ArrayBuffer.h:
+        * runtime/GenericTypedArrayView.h:
+        * runtime/GenericTypedArrayViewInlines.h:
+        (JSC::GenericTypedArrayView<Adaptor>::create):
+        (JSC::GenericTypedArrayView<Adaptor>::tryCreate):
+        (JSC::GenericTypedArrayView<Adaptor>::createUninitialized):
+        (JSC::GenericTypedArrayView<Adaptor>::tryCreateUninitialized):
+        (JSC::GenericTypedArrayView<Adaptor>::subarray const):
+        * runtime/JSArrayBufferView.cpp:
+        (JSC::JSArrayBufferView::possiblySharedImpl):
+        * runtime/JSGenericTypedArrayViewInlines.h:
+        (JSC::JSGenericTypedArrayView<Adaptor>::possiblySharedTypedImpl):
+        (JSC::JSGenericTypedArrayView<Adaptor>::unsharedTypedImpl):
+        * wasm/WasmMemory.cpp:
+        (JSC::Wasm::Memory::create):
+        (JSC::Wasm::Memory::tryCreate):
+        * wasm/WasmMemory.h:
+        * wasm/WasmTable.cpp:
+        (JSC::Wasm::Table::tryCreate):
+        (JSC::Wasm::Table::create): Deleted.
+        * wasm/WasmTable.h:
+        * wasm/js/JSWebAssemblyInstance.cpp:
+        (JSC::JSWebAssemblyInstance::create):
+        * wasm/js/JSWebAssemblyMemory.cpp:
+        (JSC::JSWebAssemblyMemory::JSWebAssemblyMemory):
+        * wasm/js/WebAssemblyMemoryConstructor.cpp:
+        (JSC::constructJSWebAssemblyMemory):
+        * wasm/js/WebAssemblyModuleRecord.cpp:
+        (JSC::WebAssemblyModuleRecord::link):
+        * wasm/js/WebAssemblyTableConstructor.cpp:
+        (JSC::constructJSWebAssemblyTable):
+
</ins><span class="cx"> 2018-10-09  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: show redirect requests in Network and Timelines tabs
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLLazySlowPathh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLLazySlowPath.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLLazySlowPath.h        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/ftl/FTLLazySlowPath.h   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     typedef SharedTask<GeneratorFunction> Generator;
</span><span class="cx"> 
</span><span class="cx">     template<typename Functor>
</span><del>-    static RefPtr<Generator> createGenerator(const Functor& functor)
</del><ins>+    static Ref<Generator> createGenerator(const Functor& functor)
</ins><span class="cx">     {
</span><span class="cx">         return createSharedTask<GeneratorFunction>(functor);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLLazySlowPathCallh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLLazySlowPathCall.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLLazySlowPathCall.h    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/ftl/FTLLazySlowPathCall.h       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> namespace JSC { namespace FTL {
</span><span class="cx"> 
</span><span class="cx"> template<typename ResultType, typename... ArgumentTypes>
</span><del>-RefPtr<LazySlowPath::Generator> createLazyCallGenerator(
</del><ins>+Ref<LazySlowPath::Generator> createLazyCallGenerator(
</ins><span class="cx">     VM& vm, FunctionPtr<CFunctionPtrTag> function, ResultType result, ArgumentTypes... arguments)
</span><span class="cx"> {
</span><span class="cx">     return LazySlowPath::createGenerator(
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLOSRExitcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -63,17 +63,17 @@
</span><span class="cx">         materialization->validateReferences(trackedReferences);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<OSRExitHandle> OSRExitDescriptor::emitOSRExit(
</del><ins>+Ref<OSRExitHandle> OSRExitDescriptor::emitOSRExit(
</ins><span class="cx">     State& state, ExitKind exitKind, const NodeOrigin& nodeOrigin, CCallHelpers& jit,
</span><span class="cx">     const StackmapGenerationParams& params, unsigned offset)
</span><span class="cx"> {
</span><del>-    RefPtr<OSRExitHandle> handle =
</del><ins>+    Ref<OSRExitHandle> handle =
</ins><span class="cx">         prepareOSRExitHandle(state, exitKind, nodeOrigin, params, offset);
</span><span class="cx">     handle->emitExitThunk(state, jit);
</span><span class="cx">     return handle;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<OSRExitHandle> OSRExitDescriptor::emitOSRExitLater(
</del><ins>+Ref<OSRExitHandle> OSRExitDescriptor::emitOSRExitLater(
</ins><span class="cx">     State& state, ExitKind exitKind, const NodeOrigin& nodeOrigin,
</span><span class="cx">     const StackmapGenerationParams& params, unsigned offset)
</span><span class="cx"> {
</span><span class="lines">@@ -83,10 +83,10 @@
</span><span class="cx">         [handle, &state] (CCallHelpers& jit) {
</span><span class="cx">             handle->emitExitThunk(state, jit);
</span><span class="cx">         });
</span><del>-    return handle;
</del><ins>+    return handle.releaseNonNull();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<OSRExitHandle> OSRExitDescriptor::prepareOSRExitHandle(
</del><ins>+Ref<OSRExitHandle> OSRExitDescriptor::prepareOSRExitHandle(
</ins><span class="cx">     State& state, ExitKind exitKind, const NodeOrigin& nodeOrigin,
</span><span class="cx">     const StackmapGenerationParams& params, unsigned offset)
</span><span class="cx"> {
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">     unsigned index = state.jitCode->osrExit.size();
</span><span class="cx">     OSRExit& exit = state.jitCode->osrExit.alloc(
</span><span class="cx">         this, exitKind, nodeOrigin.forExit, nodeOrigin.semantic, nodeOrigin.wasHoisted);
</span><del>-    RefPtr<OSRExitHandle> handle = adoptRef(new OSRExitHandle(index, exit));
</del><ins>+    Ref<OSRExitHandle> handle = adoptRef(*new OSRExitHandle(index, exit));
</ins><span class="cx">     for (unsigned i = offset; i < params.size(); ++i)
</span><span class="cx">         exit.m_valueReps.append(params[i]);
</span><span class="cx">     exit.m_valueReps.shrinkToFit();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLOSRExith"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLOSRExit.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLOSRExit.h     2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/ftl/FTLOSRExit.h        2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">     // up to the OSRExit object, which this creates. Note that it's OK to drop the OSRExitHandle object
</span><span class="cx">     // on the ground. It contains information that is mostly not useful if you use this API, since after
</span><span class="cx">     // this call, the OSRExit is simply ready to go.
</span><del>-    RefPtr<OSRExitHandle> emitOSRExit(
</del><ins>+    Ref<OSRExitHandle> emitOSRExit(
</ins><span class="cx">         State&, ExitKind, const DFG::NodeOrigin&, CCallHelpers&, const B3::StackmapGenerationParams&,
</span><span class="cx">         unsigned offset = 0);
</span><span class="cx"> 
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">     // This API is meant to be used for things like exception handling, where some patchpoint wants to
</span><span class="cx">     // have a place to jump to for OSR exit. It doesn't care where that OSR exit is emitted so long as it
</span><span class="cx">     // eventually gets access to its label.
</span><del>-    RefPtr<OSRExitHandle> emitOSRExitLater(
</del><ins>+    Ref<OSRExitHandle> emitOSRExitLater(
</ins><span class="cx">         State&, ExitKind, const DFG::NodeOrigin&, const B3::StackmapGenerationParams&,
</span><span class="cx">         unsigned offset = 0);
</span><span class="cx"> 
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx">     // This is the low-level interface. It will create a handle representing the desire to emit code for
</span><span class="cx">     // an OSR exit. You can call OSRExitHandle::emitExitThunk() once you have a place to emit it. Note
</span><span class="cx">     // that the above two APIs are written in terms of this and OSRExitHandle::emitExitThunk().
</span><del>-    RefPtr<OSRExitHandle> prepareOSRExitHandle(
</del><ins>+    Ref<OSRExitHandle> prepareOSRExitHandle(
</ins><span class="cx">         State&, ExitKind, const DFG::NodeOrigin&, const B3::StackmapGenerationParams&,
</span><span class="cx">         unsigned offset = 0);
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLPatchpointExceptionHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.cpp 2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.cpp    2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -38,11 +38,11 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace DFG;
</span><span class="cx"> 
</span><del>-RefPtr<PatchpointExceptionHandle> PatchpointExceptionHandle::create(
</del><ins>+Ref<PatchpointExceptionHandle> PatchpointExceptionHandle::create(
</ins><span class="cx">     State& state, OSRExitDescriptor* descriptor, NodeOrigin origin, unsigned offset,
</span><span class="cx">     const HandlerInfo& handler)
</span><span class="cx"> {
</span><del>-    return adoptRef(new PatchpointExceptionHandle(state, descriptor, origin, offset, handler));
</del><ins>+    return adoptRef(*new PatchpointExceptionHandle(state, descriptor, origin, offset, handler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<PatchpointExceptionHandle> PatchpointExceptionHandle::defaultHandle(State& state)
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<OSRExitHandle> PatchpointExceptionHandle::createHandle(
</del><ins>+Ref<OSRExitHandle> PatchpointExceptionHandle::createHandle(
</ins><span class="cx">     ExitKind kind, const B3::StackmapGenerationParams& params)
</span><span class="cx"> {
</span><span class="cx">     return m_descriptor->emitOSRExitLater(
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLPatchpointExceptionHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.h   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.h      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx"> 
</span><span class="cx"> class PatchpointExceptionHandle : public ThreadSafeRefCounted<PatchpointExceptionHandle> {
</span><span class="cx"> public:
</span><del>-    static RefPtr<PatchpointExceptionHandle> create(
</del><ins>+    static Ref<PatchpointExceptionHandle> create(
</ins><span class="cx">         State&, OSRExitDescriptor*, DFG::NodeOrigin, unsigned offset, const HandlerInfo&);
</span><span class="cx"> 
</span><span class="cx">     static RefPtr<PatchpointExceptionHandle> defaultHandle(State&);
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">     PatchpointExceptionHandle(
</span><span class="cx">         State&, OSRExitDescriptor*, DFG::NodeOrigin, unsigned offset, const HandlerInfo&);
</span><span class="cx"> 
</span><del>-    RefPtr<OSRExitHandle> createHandle(ExitKind, const B3::StackmapGenerationParams&);
</del><ins>+    Ref<OSRExitHandle> createHandle(ExitKind, const B3::StackmapGenerationParams&);
</ins><span class="cx"> 
</span><span class="cx">     State& m_state;
</span><span class="cx">     OSRExitDescriptor* m_descriptor;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapEdenGCActivityCallbackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.h        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.h   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">     double deathRate(Heap&) override;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline RefPtr<GCActivityCallback> GCActivityCallback::createEdenTimer(Heap* heap)
</del><ins>+inline RefPtr<GCActivityCallback> GCActivityCallback::tryCreateEdenTimer(Heap* heap)
</ins><span class="cx"> {
</span><span class="cx">     return s_shouldCreateGCTimer ? adoptRef(new EdenGCActivityCallback(heap)) : nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapFullGCActivityCallbackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.h        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.h   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     bool m_didGCRecently { false };
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline RefPtr<FullGCActivityCallback> GCActivityCallback::createFullTimer(Heap* heap)
</del><ins>+inline RefPtr<FullGCActivityCallback> GCActivityCallback::tryCreateFullTimer(Heap* heap)
</ins><span class="cx"> {
</span><span class="cx">     return s_shouldCreateGCTimer ? adoptRef(new FullGCActivityCallback(heap)) : nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapGCActivityCallbackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/GCActivityCallback.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/GCActivityCallback.h    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/heap/GCActivityCallback.h       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -43,8 +43,8 @@
</span><span class="cx"> class JS_EXPORT_PRIVATE GCActivityCallback : public JSRunLoopTimer {
</span><span class="cx"> public:
</span><span class="cx">     using Base = JSRunLoopTimer;
</span><del>-    static RefPtr<FullGCActivityCallback> createFullTimer(Heap*);
-    static RefPtr<GCActivityCallback> createEdenTimer(Heap*);
</del><ins>+    static RefPtr<FullGCActivityCallback> tryCreateFullTimer(Heap*);
+    static RefPtr<GCActivityCallback> tryCreateEdenTimer(Heap*);
</ins><span class="cx"> 
</span><span class="cx">     GCActivityCallback(Heap*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.cpp        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/heap/Heap.cpp   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -304,8 +304,8 @@
</span><span class="cx">     // schedule the timer if we've never done a collection.
</span><span class="cx">     , m_lastFullGCLength(0.01)
</span><span class="cx">     , m_lastEdenGCLength(0.01)
</span><del>-    , m_fullActivityCallback(GCActivityCallback::createFullTimer(this))
-    , m_edenActivityCallback(GCActivityCallback::createEdenTimer(this))
</del><ins>+    , m_fullActivityCallback(GCActivityCallback::tryCreateFullTimer(this))
+    , m_edenActivityCallback(GCActivityCallback::tryCreateEdenTimer(this))
</ins><span class="cx">     , m_sweeper(adoptRef(new IncrementalSweeper(this)))
</span><span class="cx">     , m_stopIfNecessaryTimer(adoptRef(new StopIfNecessaryTimer(vm)))
</span><span class="cx">     , m_deferralDepth(0)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorAsyncStackTracecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/AsyncStackTrace.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/AsyncStackTrace.cpp        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/inspector/AsyncStackTrace.cpp   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace Inspector {
</span><span class="cx"> 
</span><del>-RefPtr<AsyncStackTrace> AsyncStackTrace::create(Ref<ScriptCallStack>&& callStack, bool singleShot, RefPtr<AsyncStackTrace> parent)
</del><ins>+Ref<AsyncStackTrace> AsyncStackTrace::create(Ref<ScriptCallStack>&& callStack, bool singleShot, RefPtr<AsyncStackTrace> parent)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(callStack->size());
</span><span class="cx">     return adoptRef(*new AsyncStackTrace(WTFMove(callStack), singleShot, WTFMove(parent)));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorAsyncStackTraceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/AsyncStackTrace.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/AsyncStackTrace.h  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/inspector/AsyncStackTrace.h     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">         Canceled,
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    static RefPtr<AsyncStackTrace> create(Ref<ScriptCallStack>&&, bool singleShot, RefPtr<AsyncStackTrace> parent);
</del><ins>+    static Ref<AsyncStackTrace> create(Ref<ScriptCallStack>&&, bool singleShot, RefPtr<AsyncStackTrace> parent);
</ins><span class="cx"> 
</span><span class="cx">     bool isPending() const;
</span><span class="cx">     bool isLocked() const;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jsc.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jsc.cpp      2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/jsc.cpp 2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -887,7 +887,9 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     if (fseek(file, 0, SEEK_SET) == -1)
</span><span class="cx">         return nullptr;
</span><del>-    RefPtr<Uint8Array> result = Uint8Array::create(bufferCapacity);
</del><ins>+    auto result = Uint8Array::tryCreate(bufferCapacity);
+    if (!result)
+        return nullptr;
</ins><span class="cx">     size_t readSize = fread(result->data(), 1, bufferCapacity, file);
</span><span class="cx">     if (readSize != static_cast<size_t>(bufferCapacity))
</span><span class="cx">         return nullptr;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeArrayBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ArrayBuffer.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ArrayBuffer.h        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/runtime/ArrayBuffer.h   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">     JS_EXPORT_PRIVATE static RefPtr<ArrayBuffer> tryCreate(ArrayBuffer&);
</span><span class="cx">     JS_EXPORT_PRIVATE static RefPtr<ArrayBuffer> tryCreate(const void* source, unsigned byteLength);
</span><span class="cx"> 
</span><del>-    // Only for use by Uint8ClampedArray::createUninitialized and SharedBuffer::tryCreateArrayBuffer.
</del><ins>+    // Only for use by Uint8ClampedArray::tryCreateUninitialized and SharedBuffer::tryCreateArrayBuffer.
</ins><span class="cx">     JS_EXPORT_PRIVATE static Ref<ArrayBuffer> createUninitialized(unsigned numElements, unsigned elementByteSize);
</span><span class="cx">     JS_EXPORT_PRIVATE static RefPtr<ArrayBuffer> tryCreateUninitialized(unsigned numElements, unsigned elementByteSize);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeGenericTypedArrayViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/GenericTypedArrayView.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/GenericTypedArrayView.h      2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/runtime/GenericTypedArrayView.h 2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -36,11 +36,15 @@
</span><span class="cx">     GenericTypedArrayView(RefPtr<ArrayBuffer>&&, unsigned byteOffset, unsigned length);
</span><span class="cx"> 
</span><span class="cx"> public:
</span><del>-    static RefPtr<GenericTypedArrayView> create(unsigned length);
-    static RefPtr<GenericTypedArrayView> create(const typename Adaptor::Type* array, unsigned length);
-    static RefPtr<GenericTypedArrayView> create(RefPtr<ArrayBuffer>&&, unsigned byteOffset, unsigned length);
</del><ins>+    static Ref<GenericTypedArrayView> create(unsigned length);
+    static Ref<GenericTypedArrayView> create(const typename Adaptor::Type* array, unsigned length);
+    static Ref<GenericTypedArrayView> create(RefPtr<ArrayBuffer>&&, unsigned byteOffset, unsigned length);
+    static RefPtr<GenericTypedArrayView> tryCreate(unsigned length);
+    static RefPtr<GenericTypedArrayView> tryCreate(const typename Adaptor::Type* array, unsigned length);
+    static RefPtr<GenericTypedArrayView> tryCreate(RefPtr<ArrayBuffer>&&, unsigned byteOffset, unsigned length);
</ins><span class="cx">     
</span><del>-    static RefPtr<GenericTypedArrayView> createUninitialized(unsigned length);
</del><ins>+    static Ref<GenericTypedArrayView> createUninitialized(unsigned length);
+    static RefPtr<GenericTypedArrayView> tryCreateUninitialized(unsigned length);
</ins><span class="cx">     
</span><span class="cx">     typename Adaptor::Type* data() const { return static_cast<typename Adaptor::Type*>(baseAddress()); }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeGenericTypedArrayViewInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/GenericTypedArrayViewInlines.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/GenericTypedArrayViewInlines.h       2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/runtime/GenericTypedArrayViewInlines.h  2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -39,25 +39,53 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename Adaptor>
</span><del>-RefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(unsigned length)
</del><ins>+Ref<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(unsigned length)
</ins><span class="cx"> {
</span><ins>+    auto result = tryCreate(length);
+    RELEASE_ASSERT(result);
+    return result.releaseNonNull();
+}
+
+template<typename Adaptor>
+Ref<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(
+    const typename Adaptor::Type* array, unsigned length)
+{
+    auto result = tryCreate(array, length);
+    RELEASE_ASSERT(result);
+    return result.releaseNonNull();
+}
+
+template<typename Adaptor>
+Ref<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(
+    RefPtr<ArrayBuffer>&& buffer, unsigned byteOffset, unsigned length)
+{
+    auto result = tryCreate(WTFMove(buffer), byteOffset, length);
+    RELEASE_ASSERT(result);
+    return result.releaseNonNull();
+}
+
+template<typename Adaptor>
+RefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::tryCreate(unsigned length)
+{
</ins><span class="cx">     auto buffer = ArrayBuffer::tryCreate(length, sizeof(typename Adaptor::Type));
</span><span class="cx">     if (!buffer)
</span><span class="cx">         return nullptr;
</span><del>-    return create(WTFMove(buffer), 0, length);
</del><ins>+    return tryCreate(WTFMove(buffer), 0, length);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename Adaptor>
</span><del>-RefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(
</del><ins>+RefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::tryCreate(
</ins><span class="cx">     const typename Adaptor::Type* array, unsigned length)
</span><span class="cx"> {
</span><del>-    RefPtr<GenericTypedArrayView> result = create(length);
</del><ins>+    RefPtr<GenericTypedArrayView> result = tryCreate(length);
+    if (!result)
+        return nullptr;
</ins><span class="cx">     memcpy(result->data(), array, length * sizeof(typename Adaptor::Type));
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename Adaptor>
</span><del>-RefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(
</del><ins>+RefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::tryCreate(
</ins><span class="cx">     RefPtr<ArrayBuffer>&& buffer, unsigned byteOffset, unsigned length)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(buffer);
</span><span class="lines">@@ -70,14 +98,23 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename Adaptor>
</span><del>-RefPtr<GenericTypedArrayView<Adaptor>>
</del><ins>+Ref<GenericTypedArrayView<Adaptor>>
</ins><span class="cx"> GenericTypedArrayView<Adaptor>::createUninitialized(unsigned length)
</span><span class="cx"> {
</span><ins>+    auto result = tryCreateUninitialized(length);
+    RELEASE_ASSERT(result);
+    return result.releaseNonNull();
+}
+
+template<typename Adaptor>
+RefPtr<GenericTypedArrayView<Adaptor>>
+GenericTypedArrayView<Adaptor>::tryCreateUninitialized(unsigned length)
+{
</ins><span class="cx">     RefPtr<ArrayBuffer> buffer =
</span><span class="cx">         ArrayBuffer::tryCreateUninitialized(length, sizeof(typename Adaptor::Type));
</span><span class="cx">     if (!buffer)
</span><span class="cx">         return nullptr;
</span><del>-    return create(WTFMove(buffer), 0, length);
</del><ins>+    return tryCreate(WTFMove(buffer), 0, length);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename Adaptor>
</span><span class="lines">@@ -96,7 +133,7 @@
</span><span class="cx">     ArrayBuffer* buffer = possiblySharedBuffer();
</span><span class="cx">     ASSERT(buffer);
</span><span class="cx">     clampOffsetAndNumElements<Adaptor::Type>(*buffer, byteOffset(), &offset, &length);
</span><del>-    return create(buffer, offset, length);
</del><ins>+    return tryCreate(buffer, offset, length);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename Adaptor>
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayBufferViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayBufferView.cpp   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -302,7 +302,7 @@
</span><span class="cx">     switch (type()) {
</span><span class="cx"> #define FACTORY(type) \
</span><span class="cx">     case type ## ArrayType: \
</span><del>-        return type ## Array::create(buffer, byteOffset, length);
</del><ins>+        return type ## Array::tryCreate(buffer, byteOffset, length);
</ins><span class="cx">     FOR_EACH_TYPED_ARRAY_TYPE_EXCLUDING_DATA_VIEW(FACTORY)
</span><span class="cx"> #undef FACTORY
</span><span class="cx">     case DataViewType:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h     2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h        2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -314,13 +314,13 @@
</span><span class="cx"> template<typename Adaptor>
</span><span class="cx"> RefPtr<typename Adaptor::ViewType> JSGenericTypedArrayView<Adaptor>::possiblySharedTypedImpl()
</span><span class="cx"> {
</span><del>-    return Adaptor::ViewType::create(possiblySharedBuffer(), byteOffset(), length());
</del><ins>+    return Adaptor::ViewType::tryCreate(possiblySharedBuffer(), byteOffset(), length());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename Adaptor>
</span><span class="cx"> RefPtr<typename Adaptor::ViewType> JSGenericTypedArrayView<Adaptor>::unsharedTypedImpl()
</span><span class="cx"> {
</span><del>-    return Adaptor::ViewType::create(unsharedBuffer(), byteOffset(), length());
</del><ins>+    return Adaptor::ViewType::tryCreate(unsharedBuffer(), byteOffset(), length());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template<typename Adaptor>
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmMemorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmMemory.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmMemory.cpp  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/wasm/WasmMemory.cpp     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -269,12 +269,12 @@
</span><span class="cx">     dataLogLnIf(verbose, "Memory::Memory allocating ", *this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<Memory> Memory::create()
</del><ins>+Ref<Memory> Memory::create()
</ins><span class="cx"> {
</span><del>-    return adoptRef(new Memory());
</del><ins>+    return adoptRef(*new Memory());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<Memory> Memory::create(PageCount initial, PageCount maximum, WTF::Function<void(NotifyPressure)>&& notifyMemoryPressure, WTF::Function<void(SyncTryToReclaim)>&& syncTryToReclaimMemory, WTF::Function<void(GrowSuccess, PageCount, PageCount)>&& growSuccessCallback)
</del><ins>+RefPtr<Memory> Memory::tryCreate(PageCount initial, PageCount maximum, WTF::Function<void(NotifyPressure)>&& notifyMemoryPressure, WTF::Function<void(SyncTryToReclaim)>&& syncTryToReclaimMemory, WTF::Function<void(GrowSuccess, PageCount, PageCount)>&& growSuccessCallback)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(initial);
</span><span class="cx">     RELEASE_ASSERT(!maximum || maximum >= initial); // This should be guaranteed by our caller.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmMemoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmMemory.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmMemory.h    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/wasm/WasmMemory.h       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -59,8 +59,8 @@
</span><span class="cx">     enum SyncTryToReclaim { SyncTryToReclaimTag };
</span><span class="cx">     enum GrowSuccess { GrowSuccessTag };
</span><span class="cx"> 
</span><del>-    static RefPtr<Memory> create();
-    static RefPtr<Memory> create(PageCount initial, PageCount maximum, WTF::Function<void(NotifyPressure)>&& notifyMemoryPressure, WTF::Function<void(SyncTryToReclaim)>&& syncTryToReclaimMemory, WTF::Function<void(GrowSuccess, PageCount, PageCount)>&& growSuccessCallback);
</del><ins>+    static Ref<Memory> create();
+    static RefPtr<Memory> tryCreate(PageCount initial, PageCount maximum, WTF::Function<void(NotifyPressure)>&& notifyMemoryPressure, WTF::Function<void(SyncTryToReclaim)>&& syncTryToReclaimMemory, WTF::Function<void(GrowSuccess, PageCount, PageCount)>&& growSuccessCallback);
</ins><span class="cx"> 
</span><span class="cx">     ~Memory();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmTable.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmTable.cpp   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/wasm/WasmTable.cpp      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">     ASSERT(m_mask == WTF::maskForSize(allocatedLength(length)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr<Table> Table::create(uint32_t initial, std::optional<uint32_t> maximum)
</del><ins>+RefPtr<Table> Table::tryCreate(uint32_t initial, std::optional<uint32_t> maximum)
</ins><span class="cx"> {
</span><span class="cx">     if (!isValidLength(initial))
</span><span class="cx">         return nullptr;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmTableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmTable.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmTable.h     2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/wasm/WasmTable.h        2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> 
</span><span class="cx"> class Table : public ThreadSafeRefCounted<Table> {
</span><span class="cx"> public:
</span><del>-    static RefPtr<Table> create(uint32_t initial, std::optional<uint32_t> maximum);
</del><ins>+    static RefPtr<Table> tryCreate(uint32_t initial, std::optional<uint32_t> maximum);
</ins><span class="cx"> 
</span><span class="cx">     JS_EXPORT_PRIVATE ~Table();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyInstancecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx">             auto* jsMemory = JSWebAssemblyMemory::create(exec, vm, globalObject->WebAssemblyMemoryStructure());
</span><span class="cx">             RETURN_IF_EXCEPTION(throwScope, nullptr);
</span><span class="cx"> 
</span><del>-            RefPtr<Wasm::Memory> memory = Wasm::Memory::create(moduleInformation.memory.initial(), moduleInformation.memory.maximum(),
</del><ins>+            RefPtr<Wasm::Memory> memory = Wasm::Memory::tryCreate(moduleInformation.memory.initial(), moduleInformation.memory.maximum(),
</ins><span class="cx">                 [&vm] (Wasm::Memory::NotifyPressure) { vm.heap.collectAsync(CollectionScope::Full); },
</span><span class="cx">                 [&vm] (Wasm::Memory::SyncTryToReclaim) { vm.heap.collectSync(CollectionScope::Full); },
</span><span class="cx">                 [&vm, jsMemory] (Wasm::Memory::GrowSuccess, Wasm::PageCount oldPageCount, Wasm::PageCount newPageCount) { jsMemory->growSuccessCallback(vm, oldPageCount, newPageCount); });
</span><span class="lines">@@ -297,7 +297,7 @@
</span><span class="cx">     if (!jsInstance->memory()) {
</span><span class="cx">         // Make sure we have a dummy memory, so that wasm -> wasm thunks avoid checking for a nullptr Memory when trying to set pinned registers.
</span><span class="cx">         auto* jsMemory = JSWebAssemblyMemory::create(exec, vm, globalObject->WebAssemblyMemoryStructure());
</span><del>-        jsMemory->adopt(Wasm::Memory::create().releaseNonNull());
</del><ins>+        jsMemory->adopt(Wasm::Memory::create());
</ins><span class="cx">         jsInstance->setMemory(vm, jsMemory);
</span><span class="cx">         RETURN_IF_EXCEPTION(throwScope, nullptr);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsJSWebAssemblyMemorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp      2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp 2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSWebAssemblyMemory::JSWebAssemblyMemory(VM& vm, Structure* structure)
</span><span class="cx">     : Base(vm, structure)
</span><del>-    , m_memory(Wasm::Memory::create().releaseNonNull())
</del><ins>+    , m_memory(Wasm::Memory::create())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyMemoryConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp     2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyMemoryConstructor.cpp        2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">     auto* jsMemory = JSWebAssemblyMemory::create(exec, vm, exec->lexicalGlobalObject()->WebAssemblyMemoryStructure());
</span><span class="cx">     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
</span><span class="cx"> 
</span><del>-    RefPtr<Wasm::Memory> memory = Wasm::Memory::create(initialPageCount, maximumPageCount,
</del><ins>+    RefPtr<Wasm::Memory> memory = Wasm::Memory::tryCreate(initialPageCount, maximumPageCount,
</ins><span class="cx">         [&vm] (Wasm::Memory::NotifyPressure) { vm.heap.collectAsync(CollectionScope::Full); },
</span><span class="cx">         [&vm] (Wasm::Memory::SyncTryToReclaim) { vm.heap.collectSync(CollectionScope::Full); },
</span><span class="cx">         [&vm, jsMemory] (Wasm::Memory::GrowSuccess, Wasm::PageCount oldPageCount, Wasm::PageCount newPageCount) { jsMemory->growSuccessCallback(vm, oldPageCount, newPageCount); });
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyModuleRecordcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -298,7 +298,7 @@
</span><span class="cx">         if (!!moduleInformation.tableInformation && !hasTableImport) {
</span><span class="cx">             RELEASE_ASSERT(!moduleInformation.tableInformation.isImport());
</span><span class="cx">             // We create a Table when it's a Table definition.
</span><del>-            RefPtr<Wasm::Table> wasmTable = Wasm::Table::create(moduleInformation.tableInformation.initial(), moduleInformation.tableInformation.maximum());
</del><ins>+            RefPtr<Wasm::Table> wasmTable = Wasm::Table::tryCreate(moduleInformation.tableInformation.initial(), moduleInformation.tableInformation.maximum());
</ins><span class="cx">             if (!wasmTable)
</span><span class="cx">                 return exception(createJSWebAssemblyLinkError(exec, vm, "couldn't create Table"));
</span><span class="cx">             JSWebAssemblyTable* table = JSWebAssemblyTable::create(exec, vm, globalObject->WebAssemblyTableStructure(), wasmTable.releaseNonNull());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyTableConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp      2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyTableConstructor.cpp 2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr<Wasm::Table> wasmTable = Wasm::Table::create(initial, maximum);
</del><ins>+    RefPtr<Wasm::Table> wasmTable = Wasm::Table::tryCreate(initial, maximum);
</ins><span class="cx">     if (!wasmTable) {
</span><span class="cx">         return JSValue::encode(throwException(exec, throwScope,
</span><span class="cx">             createRangeError(exec, "couldn't create Table"_s)));
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/ChangeLog      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -1,3 +1,114 @@
</span><ins>+2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
+
+        [JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
+        https://bugs.webkit.org/show_bug.cgi?id=190429
+
+        Reviewed by Saam Barati.
+
+        Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.
+
+        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
+        (WebCore::CDMSessionClearKey::cachedKeyForKeyID const):
+        * Modules/plugins/QuickTimePluginReplacement.mm:
+        (WebCore::jsValueWithDictionaryInContext):
+        * Modules/webaudio/AudioBuffer.cpp:
+        (WebCore::AudioBuffer::AudioBuffer):
+        (WebCore::AudioBuffer::getChannelData):
+        * Modules/webvr/VREyeParameters.cpp:
+        (WebCore::VREyeParameters::offset const):
+        * Modules/webvr/VRFrameData.cpp:
+        (WebCore::matrixToArray):
+        * Modules/webvr/VRPose.cpp:
+        (WebCore::optionalFloat3ToJSCArray):
+        (WebCore::VRPose::position const):
+        (WebCore::VRPose::orientation const):
+        * Modules/webvr/VRStageParameters.cpp:
+        (WebCore::VRStageParameters::sittingToStandingTransform const):
+        * bindings/js/ReadableStreamDefaultController.h:
+        (WebCore::ReadableStreamDefaultController::enqueue):
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneDeserializer::readArrayBufferView):
+        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
+        (WebCore::CryptoKeyRSA::algorithm const):
+        * crypto/mac/CryptoKeyRSAMac.cpp:
+        (WebCore::CryptoKeyRSA::algorithm const):
+        * css/DOMMatrixReadOnly.cpp:
+        (WebCore::DOMMatrixReadOnly::toFloat32Array const):
+        (WebCore::DOMMatrixReadOnly::toFloat64Array const):
+        * css/FontFace.cpp:
+        (WebCore::FontFace::create):
+        * dom/TextEncoder.cpp:
+        (WebCore::TextEncoder::encode const):
+        * html/ImageData.cpp:
+        (WebCore::ImageData::ImageData):
+        * html/ImageData.h:
+        (WebCore::ImageData::data const):
+        (): Deleted.
+        * html/canvas/WebGL2RenderingContext.cpp:
+        (WebCore::WebGL2RenderingContext::bufferData):
+        (WebCore::WebGL2RenderingContext::bufferSubData):
+        (WebCore::WebGL2RenderingContext::getInternalformatParameter):
+        (WebCore::WebGL2RenderingContext::getParameter):
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::getParameter):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::getUniform):
+        (WebCore::WebGLRenderingContextBase::getVertexAttrib):
+        (WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
+        (WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
+        * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
+        (WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
+        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
+        (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
+        (WebCore::CDMSessionAVContentKeySession::releaseKeys):
+        (WebCore::CDMSessionAVContentKeySession::update):
+        (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
+        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
+        (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
+        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
+        (WebCore::CDMSessionAVStreamSession::generateKeyRequest):
+        (WebCore::CDMSessionAVStreamSession::releaseKeys):
+        (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
+        * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
+        (WebCore::MediaSampleAVFObjC::getRGBAImageData const):
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::getImageData):
+        * platform/graphics/cg/ImageBufferDataCG.cpp:
+        (WebCore::ImageBufferData::getData const):
+        * platform/graphics/filters/FEGaussianBlur.cpp:
+        (WebCore::FEGaussianBlur::platformApplySoftware):
+        * platform/graphics/filters/FilterEffect.cpp:
+        (WebCore::FilterEffect::unmultipliedResult):
+        (WebCore::FilterEffect::premultipliedResult):
+        (WebCore::FilterEffect::copyUnmultipliedResult):
+        (WebCore::FilterEffect::copyPremultipliedResult):
+        (WebCore::FilterEffect::createUnmultipliedImageResult):
+        (WebCore::FilterEffect::createPremultipliedImageResult):
+        * platform/graphics/win/ImageBufferDataDirect2D.cpp:
+        (WebCore::ImageBufferData::getData const):
+        * platform/mac/SerializedPlatformRepresentationMac.mm:
+        (WebCore::jsValueWithDictionaryInContext):
+        * platform/mock/mediasource/MockBox.cpp:
+        (WebCore::MockBox::peekType):
+        (WebCore::MockBox::peekLength):
+        (WebCore::MockTrackBox::MockTrackBox):
+        (WebCore::MockInitializationBox::MockInitializationBox):
+        (WebCore::MockSampleBox::MockSampleBox):
+        * rendering/shapes/Shape.cpp:
+        (WebCore::Shape::createRasterShape):
+        * testing/LegacyMockCDM.cpp:
+        (WebCore::initDataPrefix):
+        (WebCore::keyPrefix):
+        (WebCore::keyRequest):
+
</ins><span class="cx"> 2018-10-10  Daniel Bates  <dabates@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [iOS] Compare input string to UIKeyInput constants using string comparison instead of pointer comparison
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyLegacyCDMSessionClearKeycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     auto keyData = m_cachedKeys.get(keyId);
</span><del>-    RefPtr<Uint8Array> keyDataArray = Uint8Array::create(keyData.data(), keyData.size());
</del><ins>+    auto keyDataArray = Uint8Array::create(keyData.data(), keyData.size());
</ins><span class="cx">     return keyDataArray->unsharedBuffer();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm       2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm  2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx">         if (!value)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        auto name = OpaqueJSString::create(key);
</del><ins>+        auto name = OpaqueJSString::tryCreate(key);
</ins><span class="cx">         JSObjectSetProperty([context JSGlobalContextRef], resultObject, name.get(), [value JSValueRef], 0, &exception);
</span><span class="cx">         if (exception)
</span><span class="cx">             continue;
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioBuffer.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioBuffer.cpp    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/Modules/webaudio/AudioBuffer.cpp       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">     m_channels.reserveCapacity(numberOfChannels);
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i < numberOfChannels; ++i) {
</span><del>-        auto channelDataArray = Float32Array::create(m_length);
</del><ins>+        auto channelDataArray = Float32Array::tryCreate(m_length);
</ins><span class="cx">         if (!channelDataArray) {
</span><span class="cx">             invalidate();
</span><span class="cx">             break;
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">     unsigned numberOfChannels = bus.numberOfChannels();
</span><span class="cx">     m_channels.reserveCapacity(numberOfChannels);
</span><span class="cx">     for (unsigned i = 0; i < numberOfChannels; ++i) {
</span><del>-        auto channelDataArray = Float32Array::create(m_length);
</del><ins>+        auto channelDataArray = Float32Array::tryCreate(m_length);
</ins><span class="cx">         if (!channelDataArray) {
</span><span class="cx">             invalidate();
</span><span class="cx">             break;
</span><span class="lines">@@ -115,9 +115,7 @@
</span><span class="cx">     if (channelIndex >= m_channels.size())
</span><span class="cx">         return Exception { SyntaxError };
</span><span class="cx">     auto& channelData = *m_channels[channelIndex];
</span><del>-    auto array = Float32Array::create(channelData.unsharedBuffer(), channelData.byteOffset(), channelData.length());
-    RELEASE_ASSERT(array);
-    return array.releaseNonNull();
</del><ins>+    return Float32Array::create(channelData.unsharedBuffer(), channelData.byteOffset(), channelData.length());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Float32Array* AudioBuffer::channelData(unsigned channelIndex)
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebvrVREyeParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webvr/VREyeParameters.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webvr/VREyeParameters.cpp   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/Modules/webvr/VREyeParameters.cpp      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -39,12 +39,11 @@
</span><span class="cx"> Ref<Float32Array> VREyeParameters::offset() const
</span><span class="cx"> {
</span><span class="cx">     auto offset = Float32Array::create(3);
</span><del>-    RELEASE_ASSERT(offset);
</del><span class="cx">     float* offsetData = offset->data();
</span><span class="cx">     offsetData[0] = m_offset.x();
</span><span class="cx">     offsetData[1] = m_offset.y();
</span><span class="cx">     offsetData[2] = m_offset.z();
</span><del>-    return offset.releaseNonNull();
</del><ins>+    return offset;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const VRFieldOfView& VREyeParameters::fieldOfView() const
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebvrVRFrameDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webvr/VRFrameData.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webvr/VRFrameData.cpp       2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/Modules/webvr/VRFrameData.cpp  2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> static Ref<Float32Array> matrixToArray(const TransformationMatrix& matrix)
</span><span class="cx"> {
</span><span class="cx">     auto columnMajorMatrix = matrix.toColumnMajorFloatArray();
</span><del>-    return Float32Array::create(columnMajorMatrix.data(), 16).releaseNonNull();
</del><ins>+    return Float32Array::create(columnMajorMatrix.data(), 16);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref<Float32Array> VRFrameData::leftProjectionMatrix() const
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebvrVRPosecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webvr/VRPose.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webvr/VRPose.cpp    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/Modules/webvr/VRPose.cpp       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">     if (!data)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    return Float32Array::create(data->data, 3).releaseNonNull();
</del><ins>+    return Float32Array::create(data->data, 3);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<Float32Array> VRPose::position() const
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto& position = *m_trackingInfo.position;
</span><span class="cx">     float positionData[3] = { position.x(), position.y(), position.z() };
</span><del>-    return Float32Array::create(positionData, 3).releaseNonNull();
</del><ins>+    return Float32Array::create(positionData, 3);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<Float32Array> VRPose::linearVelocity() const
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto& orientation = *m_trackingInfo.orientation;
</span><span class="cx">     float orientationData[4] = { orientation.x, orientation.y, orientation.z, orientation.w };
</span><del>-    return Float32Array::create(orientationData, 4).releaseNonNull();
</del><ins>+    return Float32Array::create(orientationData, 4);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<Float32Array> VRPose::angularVelocity() const
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebvrVRStageParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webvr/VRStageParameters.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webvr/VRStageParameters.cpp 2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/Modules/webvr/VRStageParameters.cpp    2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> Ref<Float32Array> VRStageParameters::sittingToStandingTransform() const
</span><span class="cx"> {
</span><span class="cx">     auto columnMajorMatrix = m_sittingToStandingTransform.toColumnMajorFloatArray();
</span><del>-    return Float32Array::create(columnMajorMatrix.data(), 16).releaseNonNull();
</del><ins>+    return Float32Array::create(columnMajorMatrix.data(), 16);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> float VRStageParameters::sizeX() const
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsReadableStreamDefaultControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.h       2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.h  2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -99,8 +99,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto length = buffer->byteLength();
</span><span class="cx">     auto chunk = JSC::Uint8Array::create(WTFMove(buffer), 0, length);
</span><del>-    ASSERT(chunk);
-    enqueue(state, toJS(&state, &globalObject, chunk.get()));
</del><ins>+    enqueue(state, toJS(&state, &globalObject, chunk.ptr()));
</ins><span class="cx">     scope.assertNoException();
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsSerializedScriptValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp       2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp  2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -2096,31 +2096,31 @@
</span><span class="cx">             arrayBufferView = getJSValue(DataView::create(WTFMove(arrayBuffer), byteOffset, length).get());
</span><span class="cx">             return true;
</span><span class="cx">         case Int8ArrayTag:
</span><del>-            arrayBufferView = toJS(m_exec, m_globalObject, Int8Array::create(WTFMove(arrayBuffer), byteOffset, length).get());
</del><ins>+            arrayBufferView = toJS(m_exec, m_globalObject, Int8Array::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get());
</ins><span class="cx">             return true;
</span><span class="cx">         case Uint8ArrayTag:
</span><del>-            arrayBufferView = toJS(m_exec, m_globalObject, Uint8Array::create(WTFMove(arrayBuffer), byteOffset, length).get());
</del><ins>+            arrayBufferView = toJS(m_exec, m_globalObject, Uint8Array::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get());
</ins><span class="cx">             return true;
</span><span class="cx">         case Uint8ClampedArrayTag:
</span><del>-            arrayBufferView = toJS(m_exec, m_globalObject, Uint8ClampedArray::create(WTFMove(arrayBuffer), byteOffset, length).get());
</del><ins>+            arrayBufferView = toJS(m_exec, m_globalObject, Uint8ClampedArray::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get());
</ins><span class="cx">             return true;
</span><span class="cx">         case Int16ArrayTag:
</span><del>-            arrayBufferView = toJS(m_exec, m_globalObject, Int16Array::create(WTFMove(arrayBuffer), byteOffset, length).get());
</del><ins>+            arrayBufferView = toJS(m_exec, m_globalObject, Int16Array::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get());
</ins><span class="cx">             return true;
</span><span class="cx">         case Uint16ArrayTag:
</span><del>-            arrayBufferView = toJS(m_exec, m_globalObject, Uint16Array::create(WTFMove(arrayBuffer), byteOffset, length).get());
</del><ins>+            arrayBufferView = toJS(m_exec, m_globalObject, Uint16Array::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get());
</ins><span class="cx">             return true;
</span><span class="cx">         case Int32ArrayTag:
</span><del>-            arrayBufferView = toJS(m_exec, m_globalObject, Int32Array::create(WTFMove(arrayBuffer), byteOffset, length).get());
</del><ins>+            arrayBufferView = toJS(m_exec, m_globalObject, Int32Array::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get());
</ins><span class="cx">             return true;
</span><span class="cx">         case Uint32ArrayTag:
</span><del>-            arrayBufferView = toJS(m_exec, m_globalObject, Uint32Array::create(WTFMove(arrayBuffer), byteOffset, length).get());
</del><ins>+            arrayBufferView = toJS(m_exec, m_globalObject, Uint32Array::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get());
</ins><span class="cx">             return true;
</span><span class="cx">         case Float32ArrayTag:
</span><del>-            arrayBufferView = toJS(m_exec, m_globalObject, Float32Array::create(WTFMove(arrayBuffer), byteOffset, length).get());
</del><ins>+            arrayBufferView = toJS(m_exec, m_globalObject, Float32Array::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get());
</ins><span class="cx">             return true;
</span><span class="cx">         case Float64ArrayTag:
</span><del>-            arrayBufferView = toJS(m_exec, m_globalObject, Float64Array::create(WTFMove(arrayBuffer), byteOffset, length).get());
</del><ins>+            arrayBufferView = toJS(m_exec, m_globalObject, Float64Array::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get());
</ins><span class="cx">             return true;
</span><span class="cx">         default:
</span><span class="cx">             return false;
</span></span></pre></div>
<a id="trunkSourceWebCorecryptogcryptCryptoKeyRSAGCryptcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -629,7 +629,7 @@
</span><span class="cx">         CryptoRsaHashedKeyAlgorithm result;
</span><span class="cx">         result.name = CryptoAlgorithmRegistry::singleton().name(algorithmIdentifier());
</span><span class="cx">         result.modulusLength = modulusLength;
</span><del>-        result.publicExponent = Uint8Array::create(publicExponent.data(), publicExponent.size());
</del><ins>+        result.publicExponent = Uint8Array::tryCreate(publicExponent.data(), publicExponent.size());
</ins><span class="cx">         result.hash.name = CryptoAlgorithmRegistry::singleton().name(m_hash);
</span><span class="cx">         return result;
</span><span class="cx">     }
</span><span class="lines">@@ -637,7 +637,7 @@
</span><span class="cx">     CryptoRsaKeyAlgorithm result;
</span><span class="cx">     result.name = CryptoAlgorithmRegistry::singleton().name(algorithmIdentifier());
</span><span class="cx">     result.modulusLength = modulusLength;
</span><del>-    result.publicExponent = Uint8Array::create(publicExponent.data(), publicExponent.size());
</del><ins>+    result.publicExponent = Uint8Array::tryCreate(publicExponent.data(), publicExponent.size());
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecryptomacCryptoKeyRSAMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp      2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp 2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx">         CryptoRsaKeyAlgorithm result;
</span><span class="cx">         result.name = CryptoAlgorithmRegistry::singleton().name(algorithmIdentifier());
</span><span class="cx">         result.modulusLength = 0;
</span><del>-        result.publicExponent = Uint8Array::create(0);
</del><ins>+        result.publicExponent = Uint8Array::tryCreate(0);
</ins><span class="cx">         return result;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -232,7 +232,7 @@
</span><span class="cx">         CryptoRsaHashedKeyAlgorithm result;
</span><span class="cx">         result.name = CryptoAlgorithmRegistry::singleton().name(algorithmIdentifier());
</span><span class="cx">         result.modulusLength = modulusLength;
</span><del>-        result.publicExponent = Uint8Array::create(publicExponent.data(), publicExponent.size());
</del><ins>+        result.publicExponent = Uint8Array::tryCreate(publicExponent.data(), publicExponent.size());
</ins><span class="cx">         result.hash.name = CryptoAlgorithmRegistry::singleton().name(m_hash);
</span><span class="cx">         return result;
</span><span class="cx">     }
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx">     CryptoRsaKeyAlgorithm result;
</span><span class="cx">     result.name = CryptoAlgorithmRegistry::singleton().name(algorithmIdentifier());
</span><span class="cx">     result.modulusLength = modulusLength;
</span><del>-    result.publicExponent = Uint8Array::create(publicExponent.data(), publicExponent.size());
</del><ins>+    result.publicExponent = Uint8Array::tryCreate(publicExponent.data(), publicExponent.size());
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssDOMMatrixReadOnlycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DOMMatrixReadOnly.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DOMMatrixReadOnly.cpp   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/css/DOMMatrixReadOnly.cpp      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -345,7 +345,7 @@
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr<Ref<Float32Array>> DOMMatrixReadOnly::toFloat32Array() const
</span><span class="cx"> {
</span><del>-    auto array32 = Float32Array::createUninitialized(16);
</del><ins>+    auto array32 = Float32Array::tryCreateUninitialized(16);
</ins><span class="cx">     if (!array32)
</span><span class="cx">         return Exception { UnknownError, "Out of memory"_s };
</span><span class="cx"> 
</span><span class="lines">@@ -371,7 +371,7 @@
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr<Ref<Float64Array>> DOMMatrixReadOnly::toFloat64Array() const
</span><span class="cx"> {
</span><del>-    auto array64 = Float64Array::createUninitialized(16);
</del><ins>+    auto array64 = Float64Array::tryCreateUninitialized(16);
</ins><span class="cx">     if (!array64)
</span><span class="cx">         return Exception { UnknownError, "Out of memory"_s };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFace.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFace.cpp    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/css/FontFace.cpp       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">         [&] (RefPtr<ArrayBuffer>& arrayBuffer) -> ExceptionOr<void> {
</span><span class="cx">             unsigned byteLength = arrayBuffer->byteLength();
</span><span class="cx">             auto arrayBufferView = JSC::Uint8Array::create(WTFMove(arrayBuffer), 0, byteLength);
</span><del>-            dataRequiresAsynchronousLoading = populateFontFaceWithArrayBuffer(result->backing(), arrayBufferView.releaseNonNull());
</del><ins>+            dataRequiresAsynchronousLoading = populateFontFaceWithArrayBuffer(result->backing(), WTFMove(arrayBufferView));
</ins><span class="cx">             return { };
</span><span class="cx">         }
</span><span class="cx">     );
</span></span></pre></div>
<a id="trunkSourceWebCoredomTextEncodercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TextEncoder.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TextEncoder.cpp 2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/dom/TextEncoder.cpp    2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME: We should not need to allocate a CString to encode into a Uint8Array.
</span><span class="cx">     CString utf8 = input.utf8();
</span><del>-    return Uint8Array::create(reinterpret_cast<const uint8_t*>(utf8.data()), utf8.length());
</del><ins>+    return Uint8Array::tryCreate(reinterpret_cast<const uint8_t*>(utf8.data()), utf8.length());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageData.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageData.cpp  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/html/ImageData.cpp     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -99,7 +99,6 @@
</span><span class="cx">     : m_size(size)
</span><span class="cx">     , m_data(Uint8ClampedArray::createUninitialized((size.area() * 4).unsafeGet()))
</span><span class="cx"> {
</span><del>-    ASSERT(m_data);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ImageData::ImageData(const IntSize& size, Ref<Uint8ClampedArray>&& byteArray)
</span><span class="lines">@@ -106,8 +105,7 @@
</span><span class="cx">     : m_size(size)
</span><span class="cx">     , m_data(WTFMove(byteArray))
</span><span class="cx"> {
</span><del>-    ASSERT(m_data);
-    ASSERT_WITH_SECURITY_IMPLICATION(!m_data || (size.area() * 4).unsafeGet() <= m_data->length());
</del><ins>+    RELEASE_ASSERT_WITH_SECURITY_IMPLICATION((size.area() * 4).unsafeGet() <= m_data->length());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlImageDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/ImageData.h (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/ImageData.h    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/html/ImageData.h       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -34,18 +34,18 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class WEBCORE_EXPORT ImageData : public RefCounted<ImageData> {
</del><ins>+class ImageData : public RefCounted<ImageData> {
</ins><span class="cx"> public:
</span><del>-    static ExceptionOr<Ref<ImageData>> create(unsigned sw, unsigned sh);
-    static RefPtr<ImageData> create(const IntSize&);
-    static RefPtr<ImageData> create(const IntSize&, Ref<Uint8ClampedArray>&&);
-    static ExceptionOr<RefPtr<ImageData>> create(Ref<Uint8ClampedArray>&&, unsigned sw, std::optional<unsigned> sh);
</del><ins>+    WEBCORE_EXPORT static ExceptionOr<Ref<ImageData>> create(unsigned sw, unsigned sh);
+    WEBCORE_EXPORT static RefPtr<ImageData> create(const IntSize&);
+    WEBCORE_EXPORT static RefPtr<ImageData> create(const IntSize&, Ref<Uint8ClampedArray>&&);
+    WEBCORE_EXPORT static ExceptionOr<RefPtr<ImageData>> create(Ref<Uint8ClampedArray>&&, unsigned sw, std::optional<unsigned> sh);
</ins><span class="cx"> 
</span><span class="cx">     IntSize size() const { return m_size; }
</span><span class="cx">     int width() const { return m_size.width(); }
</span><span class="cx">     int height() const { return m_size.height(); }
</span><span class="cx"> 
</span><del>-    Uint8ClampedArray* data() const { return m_data.get(); }
</del><ins>+    Uint8ClampedArray* data() const { return m_data.ptr(); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit ImageData(const IntSize&);
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">     ImageData(const IntSize&, Ref<Uint8ClampedArray>&&);
</span><span class="cx"> 
</span><span class="cx">     IntSize m_size;
</span><del>-    RefPtr<Uint8ClampedArray> m_data;
</del><ins>+    Ref<Uint8ClampedArray> m_data;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp      2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp 2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -156,7 +156,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto slice = Uint8Array::create(data.possiblySharedBuffer(), data.byteOffset() + checkedByteSrcOffset.unsafeGet(), checkedByteLength.unsafeGet());
</del><ins>+    auto slice = Uint8Array::tryCreate(data.possiblySharedBuffer(), data.byteOffset() + checkedByteSrcOffset.unsafeGet(), checkedByteLength.unsafeGet());
</ins><span class="cx">     if (!slice) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::OUT_OF_MEMORY, "bufferData", "Could not create intermediate ArrayBufferView");
</span><span class="cx">         return;
</span><span class="lines">@@ -187,7 +187,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto slice = Uint8Array::create(data.possiblySharedBuffer(), data.byteOffset() + checkedByteSrcOffset.unsafeGet(), checkedByteLength.unsafeGet());
</del><ins>+    auto slice = Uint8Array::tryCreate(data.possiblySharedBuffer(), data.byteOffset() + checkedByteSrcOffset.unsafeGet(), checkedByteLength.unsafeGet());
</ins><span class="cx">     if (!slice) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::OUT_OF_MEMORY, "bufferSubData", "Could not create intermediate ArrayBufferView");
</span><span class="cx">         return;
</span><span class="lines">@@ -412,7 +412,7 @@
</span><span class="cx">         params[i] = samples[i];
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    return Int32Array::create(params, numValues);
</del><ins>+    return Int32Array::tryCreate(params, numValues);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGL2RenderingContext::invalidateFramebuffer(GC3Denum, const Vector<GC3Denum>&)
</span><span class="lines">@@ -1794,7 +1794,7 @@
</span><span class="cx">     case GraphicsContext3D::COLOR_WRITEMASK:
</span><span class="cx">         return getBooleanArrayParameter(pname);
</span><span class="cx">     case GraphicsContext3D::COMPRESSED_TEXTURE_FORMATS:
</span><del>-        return Uint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size());
</del><ins>+        return Uint32Array::tryCreate(m_compressedTextureFormats.data(), m_compressedTextureFormats.size());
</ins><span class="cx">     case GraphicsContext3D::CULL_FACE:
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::CULL_FACE_MODE:
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp       2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp  2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx">     case GraphicsContext3D::COLOR_WRITEMASK:
</span><span class="cx">         return getBooleanArrayParameter(pname);
</span><span class="cx">     case GraphicsContext3D::COMPRESSED_TEXTURE_FORMATS:
</span><del>-        return Uint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size());
</del><ins>+        return Uint32Array::tryCreate(m_compressedTextureFormats.data(), m_compressedTextureFormats.size());
</ins><span class="cx">     case GraphicsContext3D::CULL_FACE:
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::CULL_FACE_MODE:
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -2922,7 +2922,7 @@
</span><span class="cx">             m_context->getUniformfv(objectOrZero(program), location, value);
</span><span class="cx">         if (length == 1)
</span><span class="cx">             return value[0];
</span><del>-        return Float32Array::create(value, length);
</del><ins>+        return Float32Array::tryCreate(value, length);
</ins><span class="cx">     }
</span><span class="cx">     case GraphicsContext3D::INT: {
</span><span class="cx">         GC3Dint value[4] = {0};
</span><span class="lines">@@ -2932,7 +2932,7 @@
</span><span class="cx">             m_context->getUniformiv(objectOrZero(program), location, value);
</span><span class="cx">         if (length == 1)
</span><span class="cx">             return value[0];
</span><del>-        return Int32Array::create(value, length);
</del><ins>+        return Int32Array::tryCreate(value, length);
</ins><span class="cx">     }
</span><span class="cx">     case GraphicsContext3D::BOOL: {
</span><span class="cx">         GC3Dint value[4] = {0};
</span><span class="lines">@@ -3028,7 +3028,7 @@
</span><span class="cx">     case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_TYPE:
</span><span class="cx">         return state.type;
</span><span class="cx">     case GraphicsContext3D::CURRENT_VERTEX_ATTRIB:
</span><del>-        return Float32Array::create(m_vertexAttribValue[index].value, 4);
</del><ins>+        return Float32Array::tryCreate(m_vertexAttribValue[index].value, 4);
</ins><span class="cx">     default:
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getVertexAttrib", "invalid parameter name");
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -5235,7 +5235,7 @@
</span><span class="cx">     default:
</span><span class="cx">         notImplemented();
</span><span class="cx">     }
</span><del>-    return Float32Array::create(value, length);
</del><ins>+    return Float32Array::tryCreate(value, length);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<Int32Array> WebGLRenderingContextBase::getWebGLIntArrayParameter(GC3Denum pname)
</span><span class="lines">@@ -5254,7 +5254,7 @@
</span><span class="cx">     default:
</span><span class="cx">         notImplemented();
</span><span class="cx">     }
</span><del>-    return Int32Array::create(value, length);
</del><ins>+    return Int32Array::tryCreate(value, length);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebGLRenderingContextBase::checkTextureCompleteness(const char* functionName, bool prepareToDraw)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -1014,7 +1014,7 @@
</span><span class="cx">     RefPtr<ArrayBuffer> initDataBuffer = initData->unsharedBuffer();
</span><span class="cx"> 
</span><span class="cx">     // Use a DataView to read uint32 values from the buffer, as Uint32Array requires the reads be aligned on 4-byte boundaries. 
</span><del>-    RefPtr<JSC::DataView> initDataView = JSC::DataView::create(initDataBuffer.copyRef(), 0, initDataBuffer->byteLength());
</del><ins>+    auto initDataView = JSC::DataView::create(initDataBuffer.copyRef(), 0, initDataBuffer->byteLength());
</ins><span class="cx">     uint32_t offset = 0;
</span><span class="cx">     bool status = true;
</span><span class="cx"> 
</span><span class="lines">@@ -1023,7 +1023,7 @@
</span><span class="cx">     if (!status || offset + keyURILength > initData->length())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    RefPtr<Uint16Array> keyURIArray = Uint16Array::create(initDataBuffer.copyRef(), offset, keyURILength);
</del><ins>+    auto keyURIArray = Uint16Array::tryCreate(initDataBuffer.copyRef(), offset, keyURILength);
</ins><span class="cx">     if (!keyURIArray)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -1035,7 +1035,7 @@
</span><span class="cx">     if (!status || offset + keyIDLength > initData->length())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    RefPtr<Uint8Array> keyIDArray = Uint8Array::create(initDataBuffer.copyRef(), offset, keyIDLength);
</del><ins>+    auto keyIDArray = Uint8Array::tryCreate(initDataBuffer.copyRef(), offset, keyIDLength);
</ins><span class="cx">     if (!keyIDArray)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -1047,7 +1047,7 @@
</span><span class="cx">     if (!status || offset + certificateLength > initData->length())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    certificate = Uint8Array::create(WTFMove(initDataBuffer), offset, certificateLength);
</del><ins>+    certificate = Uint8Array::tryCreate(WTFMove(initDataBuffer), offset, certificateLength);
</ins><span class="cx">     if (!certificate)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfCDMSessionAVFoundationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp      2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp 2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">     destinationURL = String();
</span><span class="cx"> 
</span><span class="cx">     auto keyRequestBuffer = ArrayBuffer::create(CFDataGetBytePtr(keyRequest.get()), CFDataGetLength(keyRequest.get()));
</span><del>-    return Uint8Array::create(WTFMove(keyRequestBuffer), 0, keyRequestBuffer->byteLength());
</del><ins>+    return Uint8Array::tryCreate(WTFMove(keyRequestBuffer), 0, keyRequestBuffer->byteLength());
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp      2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> #include <dispatch/dispatch.h>
</span><span class="cx"> #if HAVE(AVFOUNDATION_LOADER_DELEGATE) && ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx"> #include <JavaScriptCore/DataView.h>
</span><ins>+#include <JavaScriptCore/TypedArrayInlines.h>
</ins><span class="cx"> #include <JavaScriptCore/Uint16Array.h>
</span><span class="cx"> #endif
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="lines">@@ -1893,12 +1894,12 @@
</span><span class="cx">         RefPtr<JSC::DataView> initDataView = JSC::DataView::create(initDataBuffer.copyRef(), 0, initDataBuffer->byteLength());
</span><span class="cx">         initDataView->set<uint32_t>(0, keyURISize, true);
</span><span class="cx"> 
</span><del>-        RefPtr<Uint16Array> keyURIArray = Uint16Array::create(initDataBuffer.copyRef(), 4, keyURI.length());
</del><ins>+        auto keyURIArray = Uint16Array::create(initDataBuffer.copyRef(), 4, keyURI.length());
</ins><span class="cx">         keyURIArray->setRange(reinterpret_cast<const uint16_t*>(StringView(keyURI).upconvertedCharacters().get()), keyURI.length() / sizeof(unsigned char), 0);
</span><span class="cx"> 
</span><span class="cx">         unsigned byteLength = initDataBuffer->byteLength();
</span><del>-        RefPtr<Uint8Array> initData = Uint8Array::create(WTFMove(initDataBuffer), 0, byteLength);
-        if (!m_owner->player()->keyNeeded(initData.get()))
</del><ins>+        auto initData = Uint8Array::create(WTFMove(initDataBuffer), 0, byteLength);
+        if (!m_owner->player()->keyNeeded(initData.ptr()))
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         setRequestForKey(keyURI, avRequest);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVContentKeySessionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -165,10 +165,10 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_certificate) {
</span><span class="cx">         String certificateString("certificate"_s);
</span><del>-        RefPtr<Uint8Array> array = Uint8Array::create(certificateString.length());
</del><ins>+        auto array = Uint8Array::create(certificateString.length());
</ins><span class="cx">         for (unsigned i = 0, length = certificateString.length(); i < length; ++i)
</span><span class="cx">             array->set(i, certificateString[i]);
</span><del>-        return array;
</del><ins>+        return WTFMove(array);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!m_keyRequest) {
</span><span class="lines">@@ -210,7 +210,7 @@
</span><span class="cx">             if (m_sessionId == String(playbackSessionIdValue)) {
</span><span class="cx">                 LOG(Media, "CDMSessionAVContentKeySession::releaseKeys(%p) - found session, sending expiration message");
</span><span class="cx">                 m_expiredSession = expiredSessionData;
</span><del>-                m_client->sendMessage(Uint8Array::create(static_cast<const uint8_t*>([m_expiredSession bytes]), [m_expiredSession length]).get(), emptyString());
</del><ins>+                m_client->sendMessage(Uint8Array::create(static_cast<const uint8_t*>([m_expiredSession bytes]), [m_expiredSession length]).ptr(), emptyString());
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -300,7 +300,7 @@
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        nextMessage = Uint8Array::create(static_cast<const uint8_t*>([requestData bytes]), [requestData length]);
</del><ins>+        nextMessage = Uint8Array::tryCreate(static_cast<const uint8_t*>([requestData bytes]), [requestData length]);
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -350,7 +350,7 @@
</span><span class="cx">     errorCode = 0;
</span><span class="cx">     systemCode = 0;
</span><span class="cx">     m_expiredSession = [expiredSessions firstObject];
</span><del>-    return Uint8Array::create(static_cast<const uint8_t*>([m_expiredSession bytes]), [m_expiredSession length]);
</del><ins>+    return Uint8Array::tryCreate(static_cast<const uint8_t*>([m_expiredSession bytes]), [m_expiredSession length]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CDMSessionAVContentKeySession::didProvideContentKeyRequest(AVContentKeyRequest *keyRequest)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -99,9 +99,9 @@
</span><span class="cx">     systemCode = 0;
</span><span class="cx">     destinationURL = String();
</span><span class="cx"> 
</span><del>-    RefPtr<ArrayBuffer> keyRequestBuffer = ArrayBuffer::create([keyRequest.get() bytes], [keyRequest.get() length]);
</del><ins>+    auto keyRequestBuffer = ArrayBuffer::create([keyRequest.get() bytes], [keyRequest.get() length]);
</ins><span class="cx">     unsigned byteLength = keyRequestBuffer->byteLength();
</span><del>-    return Uint8Array::create(WTFMove(keyRequestBuffer), 0, byteLength);
</del><ins>+    return Uint8Array::tryCreate(WTFMove(keyRequestBuffer), 0, byteLength);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CDMSessionAVFoundationObjC::releaseKeys()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcCDMSessionAVStreamSessionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -122,10 +122,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String certificateString("certificate"_s);
</span><del>-    RefPtr<Uint8Array> array = Uint8Array::create(certificateString.length());
</del><ins>+    auto array = Uint8Array::create(certificateString.length());
</ins><span class="cx">     for (unsigned i = 0, length = certificateString.length(); i < length; ++i)
</span><span class="cx">         array->set(i, certificateString[i]);
</span><del>-    return array;
</del><ins>+    return WTFMove(array);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CDMSessionAVStreamSession::releaseKeys()
</span><span class="lines">@@ -156,7 +156,7 @@
</span><span class="cx">             if (m_sessionId == String(playbackSessionIdValue)) {
</span><span class="cx">                 LOG(Media, "CDMSessionAVStreamSession::releaseKeys(%p) - found session, sending expiration message");
</span><span class="cx">                 m_expiredSession = expiredSessionData;
</span><del>-                m_client->sendMessage(Uint8Array::create(static_cast<const uint8_t*>([m_expiredSession bytes]), [m_expiredSession length]).get(), emptyString());
</del><ins>+                m_client->sendMessage(Uint8Array::create(static_cast<const uint8_t*>([m_expiredSession bytes]), [m_expiredSession length]).ptr(), emptyString());
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -335,7 +335,7 @@
</span><span class="cx">     errorCode = 0;
</span><span class="cx">     systemCode = 0;
</span><span class="cx">     m_expiredSession = [expiredSessions firstObject];
</span><del>-    return Uint8Array::create(static_cast<const uint8_t*>([m_expiredSession bytes]), [m_expiredSession length]);
</del><ins>+    return Uint8Array::tryCreate(static_cast<const uint8_t*>([m_expiredSession bytes]), [m_expiredSession length]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -1764,16 +1764,16 @@
</span><span class="cx">         // Create an initData with the following layout:
</span><span class="cx">         // [4 bytes: keyURI size], [keyURI size bytes: keyURI]
</span><span class="cx">         unsigned keyURISize = keyURI.length() * sizeof(UChar);
</span><del>-        RefPtr<ArrayBuffer> initDataBuffer = ArrayBuffer::create(4 + keyURISize, 1);
</del><ins>+        auto initDataBuffer = ArrayBuffer::create(4 + keyURISize, 1);
</ins><span class="cx">         unsigned byteLength = initDataBuffer->byteLength();
</span><del>-        RefPtr<JSC::DataView> initDataView = JSC::DataView::create(initDataBuffer.copyRef(), 0, byteLength);
</del><ins>+        auto initDataView = JSC::DataView::create(initDataBuffer.copyRef(), 0, byteLength);
</ins><span class="cx">         initDataView->set<uint32_t>(0, keyURISize, true);
</span><span class="cx"> 
</span><del>-        RefPtr<Uint16Array> keyURIArray = Uint16Array::create(initDataBuffer.copyRef(), 4, keyURI.length());
</del><ins>+        auto keyURIArray = Uint16Array::create(initDataBuffer.copyRef(), 4, keyURI.length());
</ins><span class="cx">         keyURIArray->setRange(StringView(keyURI).upconvertedCharacters(), keyURI.length() / sizeof(unsigned char), 0);
</span><span class="cx"> 
</span><del>-        RefPtr<Uint8Array> initData = Uint8Array::create(WTFMove(initDataBuffer), 0, byteLength);
-        if (!player()->keyNeeded(initData.get()))
</del><ins>+        auto initData = Uint8Array::create(WTFMove(initDataBuffer), 0, byteLength);
+        if (!player()->keyNeeded(initData.ptr()))
</ins><span class="cx">             return false;
</span><span class="cx"> #endif
</span><span class="cx">         m_keyURIToRequestMap.set(keyURI, avRequest);
</span><span class="lines">@@ -1803,7 +1803,7 @@
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!player()->keyNeeded(initData.get()))
</del><ins>+        if (!player()->keyNeeded(initData.ptr()))
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         m_keyURIToRequestMap.set(keyID, avRequest);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaSampleAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx"> 
</span><span class="cx">     void* data = CVPixelBufferGetBaseAddressOfPlane(rgbaPixelBuffer.get(), 0);
</span><span class="cx">     size_t byteLength = CVPixelBufferGetHeight(pixelBuffer) * CVPixelBufferGetWidth(pixelBuffer) * 4;
</span><del>-    auto result = JSC::Uint8ClampedArray::create(JSC::ArrayBuffer::create(data, byteLength), 0, byteLength);
</del><ins>+    auto result = JSC::Uint8ClampedArray::tryCreate(JSC::ArrayBuffer::create(data, byteLength), 0, byteLength);
</ins><span class="cx"> 
</span><span class="cx">     status = CVPixelBufferUnlockBaseAddress(rgbaPixelBuffer.get(), kCVPixelBufferLock_ReadOnly);
</span><span class="cx">     ASSERT(status == noErr);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -650,9 +650,9 @@
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx">     LOG(MediaSource, "SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID(%p) - track:%d", this, trackID);
</span><span class="cx">     m_protectedTrackID = trackID;
</span><del>-    RefPtr<Uint8Array> initDataArray = Uint8Array::create([initData length]);
</del><ins>+    auto initDataArray = Uint8Array::create([initData length]);
</ins><span class="cx">     [initData getBytes:initDataArray->data() length:initDataArray->length()];
</span><del>-    m_mediaSource->sourceBufferKeyNeeded(this, initDataArray.get());
</del><ins>+    m_mediaSource->sourceBufferKeyNeeded(this, initDataArray.ptr());
</ins><span class="cx">     if (auto session = m_mediaSource->player()->cdmSession()) {
</span><span class="cx">         session->addParser(m_parser.get());
</span><span class="cx">         hasSessionSemaphore->signal();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoImageBufferCairocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -412,7 +412,7 @@
</span><span class="cx">     if (area.hasOverflowed())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto result = Uint8ClampedArray::createUninitialized(area.unsafeGet());
</del><ins>+    auto result = Uint8ClampedArray::tryCreateUninitialized(area.unsafeGet());
</ins><span class="cx">     if (!result)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageBufferDataCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">     if (area.hasOverflowed())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto result = Uint8ClampedArray::createUninitialized(area.unsafeGet());
</del><ins>+    auto result = Uint8ClampedArray::tryCreateUninitialized(area.unsafeGet());
</ins><span class="cx">     uint8_t* resultData = result ? result->data() : nullptr;
</span><span class="cx">     if (!resultData)
</span><span class="cx">         return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFEGaussianBlurcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp        2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp   2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -531,7 +531,7 @@
</span><span class="cx"> 
</span><span class="cx">     IntSize paintSize = absolutePaintRect().size();
</span><span class="cx">     paintSize.scale(filter().filterScale());
</span><del>-    auto tmpImageData = Uint8ClampedArray::createUninitialized((paintSize.area() * 4).unsafeGet());
</del><ins>+    auto tmpImageData = Uint8ClampedArray::tryCreateUninitialized((paintSize.area() * 4).unsafeGet());
</ins><span class="cx">     if (!tmpImageData)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFilterEffectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -290,7 +290,7 @@
</span><span class="cx">     IntSize scaledSize(rect.size());
</span><span class="cx">     ASSERT(!ImageBuffer::sizeNeedsClamping(scaledSize));
</span><span class="cx">     scaledSize.scale(m_filter.filterScale());
</span><del>-    auto imageData = Uint8ClampedArray::createUninitialized((scaledSize.area() * 4).unsafeGet());
</del><ins>+    auto imageData = Uint8ClampedArray::tryCreateUninitialized((scaledSize.area() * 4).unsafeGet());
</ins><span class="cx">     if (!imageData)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -303,7 +303,7 @@
</span><span class="cx">     IntSize scaledSize(rect.size());
</span><span class="cx">     ASSERT(!ImageBuffer::sizeNeedsClamping(scaledSize));
</span><span class="cx">     scaledSize.scale(m_filter.filterScale());
</span><del>-    auto imageData = Uint8ClampedArray::createUninitialized((scaledSize.area() * 4).unsafeGet());
</del><ins>+    auto imageData = Uint8ClampedArray::tryCreateUninitialized((scaledSize.area() * 4).unsafeGet());
</ins><span class="cx">     if (!imageData)
</span><span class="cx">         return nullptr;
</span><span class="cx">     copyPremultipliedResult(*imageData, rect);
</span><span class="lines">@@ -450,7 +450,7 @@
</span><span class="cx">             IntSize inputSize(m_absolutePaintRect.size());
</span><span class="cx">             ASSERT(!ImageBuffer::sizeNeedsClamping(inputSize));
</span><span class="cx">             inputSize.scale(m_filter.filterScale());
</span><del>-            m_unmultipliedImageResult = Uint8ClampedArray::createUninitialized((inputSize.area() * 4).unsafeGet());
</del><ins>+            m_unmultipliedImageResult = Uint8ClampedArray::tryCreateUninitialized((inputSize.area() * 4).unsafeGet());
</ins><span class="cx">             if (!m_unmultipliedImageResult)
</span><span class="cx">                 return;
</span><span class="cx">             
</span><span class="lines">@@ -476,7 +476,7 @@
</span><span class="cx">             IntSize inputSize(m_absolutePaintRect.size());
</span><span class="cx">             ASSERT(!ImageBuffer::sizeNeedsClamping(inputSize));
</span><span class="cx">             inputSize.scale(m_filter.filterScale());
</span><del>-            m_premultipliedImageResult = Uint8ClampedArray::createUninitialized((inputSize.area() * 4).unsafeGet());
</del><ins>+            m_premultipliedImageResult = Uint8ClampedArray::tryCreateUninitialized((inputSize.area() * 4).unsafeGet());
</ins><span class="cx">             if (!m_premultipliedImageResult)
</span><span class="cx">                 return;
</span><span class="cx">             
</span><span class="lines">@@ -515,7 +515,7 @@
</span><span class="cx">     IntSize resultSize(m_absolutePaintRect.size());
</span><span class="cx">     ASSERT(!ImageBuffer::sizeNeedsClamping(resultSize));
</span><span class="cx">     resultSize.scale(m_filter.filterScale());
</span><del>-    m_unmultipliedImageResult = Uint8ClampedArray::createUninitialized((resultSize.area() * 4).unsafeGet());
</del><ins>+    m_unmultipliedImageResult = Uint8ClampedArray::tryCreateUninitialized((resultSize.area() * 4).unsafeGet());
</ins><span class="cx">     return m_unmultipliedImageResult.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -531,7 +531,7 @@
</span><span class="cx">     IntSize resultSize(m_absolutePaintRect.size());
</span><span class="cx">     ASSERT(!ImageBuffer::sizeNeedsClamping(resultSize));
</span><span class="cx">     resultSize.scale(m_filter.filterScale());
</span><del>-    m_premultipliedImageResult = Uint8ClampedArray::createUninitialized((resultSize.area() * 4).unsafeGet());
</del><ins>+    m_premultipliedImageResult = Uint8ClampedArray::tryCreateUninitialized((resultSize.area() * 4).unsafeGet());
</ins><span class="cx">     return m_premultipliedImageResult.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinImageBufferDataDirect2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/ImageBufferDataDirect2D.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/ImageBufferDataDirect2D.cpp   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/graphics/win/ImageBufferDataDirect2D.cpp      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">     if (numBytes.hasOverflowed())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto result = Uint8ClampedArray::createUninitialized(numBytes.unsafeGet());
</del><ins>+    auto result = Uint8ClampedArray::tryCreateUninitialized(numBytes.unsafeGet());
</ins><span class="cx">     unsigned char* resultData = result ? result->data() : nullptr;
</span><span class="cx">     if (!resultData)
</span><span class="cx">         return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacSerializedPlatformRepresentationMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm 2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/mac/SerializedPlatformRepresentationMac.mm    2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx">         if (!value)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        auto name = OpaqueJSString::create(key);
</del><ins>+        auto name = OpaqueJSString::tryCreate(key);
</ins><span class="cx">         JSObjectSetProperty([context JSGlobalContextRef], resultObject, name.get(), [value JSValueRef], 0, &exception);
</span><span class="cx">         if (exception)
</span><span class="cx">             continue;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockBox.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockBox.cpp       2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockBox.cpp  2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> String MockBox::peekType(ArrayBuffer* data)
</span><span class="cx"> {
</span><span class="cx">     StringBuilder builder;
</span><del>-    RefPtr<Int8Array> array = JSC::Int8Array::create(data, 0, 4);
</del><ins>+    auto array = JSC::Int8Array::create(data, 0, 4);
</ins><span class="cx">     for (int i = 0; i < 4; ++i)
</span><span class="cx">         builder.append(array->item(i));
</span><span class="cx">     return builder.toString();
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx"> size_t MockBox::peekLength(ArrayBuffer* data)
</span><span class="cx"> {
</span><del>-    RefPtr<JSC::DataView> view = JSC::DataView::create(data, 0, data->byteLength());
</del><ins>+    auto view = JSC::DataView::create(data, 0, data->byteLength());
</ins><span class="cx">     return view->get<uint32_t>(4, true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -66,11 +66,11 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_length == 17);
</span><span class="cx"> 
</span><del>-    RefPtr<JSC::DataView> view = JSC::DataView::create(data, 0, data->byteLength());
</del><ins>+    auto view = JSC::DataView::create(data, 0, data->byteLength());
</ins><span class="cx">     m_trackID = view->get<int32_t>(8, true);
</span><span class="cx"> 
</span><span class="cx">     StringBuilder builder;
</span><del>-    RefPtr<Int8Array> array = JSC::Int8Array::create(data, 12, 4);
</del><ins>+    auto array = JSC::Int8Array::create(data, 12, 4);
</ins><span class="cx">     for (int i = 0; i < 4; ++i)
</span><span class="cx">         builder.append(array->item(i));
</span><span class="cx">     m_codec = builder.toString();
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_length >= 13);
</span><span class="cx"> 
</span><del>-    RefPtr<JSC::DataView> view = JSC::DataView::create(data, 0, data->byteLength());
</del><ins>+    auto view = JSC::DataView::create(data, 0, data->byteLength());
</ins><span class="cx">     int32_t timeValue = view->get<int32_t>(8, true);
</span><span class="cx">     int32_t timeScale = view->get<int32_t>(12, true);
</span><span class="cx">     m_duration = MediaTime(timeValue, timeScale);
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_length == 30);
</span><span class="cx"> 
</span><del>-    RefPtr<JSC::DataView> view = JSC::DataView::create(data, 0, data->byteLength());
</del><ins>+    auto view = JSC::DataView::create(data, 0, data->byteLength());
</ins><span class="cx">     int32_t timeScale = view->get<int32_t>(8, true);
</span><span class="cx"> 
</span><span class="cx">     int32_t timeValue = view->get<int32_t>(12, true);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesShapecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/Shape.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/Shape.cpp  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/rendering/shapes/Shape.cpp     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -189,6 +189,7 @@
</span><span class="cx">             graphicsContext.drawImage(*image, IntRect(IntPoint(), imageRect.size()));
</span><span class="cx"> 
</span><span class="cx">         RefPtr<Uint8ClampedArray> pixelArray = imageBuffer->getUnmultipliedImageData(IntRect(IntPoint(), imageRect.size()));
</span><ins>+        RELEASE_ASSERT(pixelArray);
</ins><span class="cx">         unsigned pixelArrayLength = pixelArray->length();
</span><span class="cx">         unsigned pixelArrayOffset = 3; // Each pixel is four bytes: RGBA.
</span><span class="cx">         uint8_t alphaPixelThreshold = threshold * 255;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingLegacyMockCDMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/LegacyMockCDM.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/LegacyMockCDM.cpp   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebCore/testing/LegacyMockCDM.cpp      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -79,25 +79,25 @@
</span><span class="cx"> static Uint8Array* initDataPrefix()
</span><span class="cx"> {
</span><span class="cx">     const unsigned char prefixData[] = { 'm', 'o', 'c', 'k' };
</span><del>-    static Uint8Array* prefix = Uint8Array::create(prefixData, WTF_ARRAY_LENGTH(prefixData)).leakRef();
</del><ins>+    static Uint8Array& prefix { Uint8Array::create(prefixData, WTF_ARRAY_LENGTH(prefixData)).leakRef() };
</ins><span class="cx"> 
</span><del>-    return prefix;
</del><ins>+    return &prefix;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static Uint8Array* keyPrefix()
</span><span class="cx"> {
</span><span class="cx">     static const unsigned char prefixData[] = {'k', 'e', 'y'};
</span><del>-    static Uint8Array* prefix = Uint8Array::create(prefixData, WTF_ARRAY_LENGTH(prefixData)).leakRef();
</del><ins>+    static Uint8Array& prefix { Uint8Array::create(prefixData, WTF_ARRAY_LENGTH(prefixData)).leakRef() };
</ins><span class="cx"> 
</span><del>-    return prefix;
</del><ins>+    return &prefix;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static Uint8Array* keyRequest()
</span><span class="cx"> {
</span><span class="cx">     static const unsigned char requestData[] = {'r', 'e', 'q', 'u', 'e', 's', 't'};
</span><del>-    static Uint8Array* request = Uint8Array::create(requestData, WTF_ARRAY_LENGTH(requestData)).leakRef();
</del><ins>+    static Uint8Array& request { Uint8Array::create(requestData, WTF_ARRAY_LENGTH(requestData)).leakRef() };
</ins><span class="cx"> 
</span><del>-    return request;
</del><ins>+    return &request;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static String generateSessionId()
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebKit/ChangeLog       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
+
+        [JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
+        https://bugs.webkit.org/show_bug.cgi?id=190429
+
+        Reviewed by Saam Barati.
+
+        Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.
+
+        * Shared/API/c/WKString.cpp:
+        (WKStringCopyJSString):
+        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
+        (WebKit::toJSValue):
+        (WebKit::callPropertyFunction):
+        (WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
+        (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::runScriptsInPDFDocument):
+
</ins><span class="cx"> 2018-10-10  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Regression(PSON): Assertion hit under WebPageProxy::didNavigateWithNavigationData()
</span></span></pre></div>
<a id="trunkSourceWebKitSharedAPIcWKStringcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/API/c/WKString.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/API/c/WKString.cpp    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebKit/Shared/API/c/WKString.cpp       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -136,5 +136,5 @@
</span><span class="cx"> JSStringRef WKStringCopyJSString(WKStringRef stringRef)
</span><span class="cx"> {
</span><span class="cx">     JSC::initializeThreading();
</span><del>-    return OpaqueJSString::create(toImpl(stringRef)->string()).leakRef();
</del><ins>+    return OpaqueJSString::tryCreate(toImpl(stringRef)->string()).leakRef();
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessAutomationWebAutomationSessionProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> 
</span><span class="cx"> static inline JSValueRef toJSValue(JSContextRef context, const String& string)
</span><span class="cx"> {
</span><del>-    return JSValueMakeString(context, OpaqueJSString::create(string).get());
</del><ins>+    return JSValueMakeString(context, OpaqueJSString::tryCreate(string).get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline JSValueRef callPropertyFunction(JSContextRef context, JSObjectRef object, const String& propertyName, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx">     ASSERT_ARG(object, object);
</span><span class="cx">     ASSERT_ARG(object, JSValueIsObject(context, object));
</span><span class="cx"> 
</span><del>-    JSObjectRef function = const_cast<JSObjectRef>(JSObjectGetProperty(context, object, OpaqueJSString::create(propertyName).get(), exception));
</del><ins>+    JSObjectRef function = const_cast<JSObjectRef>(JSObjectGetProperty(context, object, OpaqueJSString::tryCreate(propertyName).get(), exception));
</ins><span class="cx">     ASSERT(JSObjectIsFunction(context, function));
</span><span class="cx"> 
</span><span class="cx">     return JSObjectCallAsFunction(context, function, object, argumentCount, arguments, exception);
</span><span class="lines">@@ -177,7 +177,7 @@
</span><span class="cx"> 
</span><span class="cx">     String script = StringImpl::createWithoutCopying(WebAutomationSessionProxyScriptSource, sizeof(WebAutomationSessionProxyScriptSource));
</span><span class="cx"> 
</span><del>-    JSObjectRef scriptObjectFunction = const_cast<JSObjectRef>(JSEvaluateScript(context, OpaqueJSString::create(script).get(), nullptr, nullptr, 0, &exception));
</del><ins>+    JSObjectRef scriptObjectFunction = const_cast<JSObjectRef>(JSEvaluateScript(context, OpaqueJSString::tryCreate(script).get(), nullptr, nullptr, 0, &exception));
</ins><span class="cx">     ASSERT(JSValueIsObject(context, scriptObjectFunction));
</span><span class="cx"> 
</span><span class="cx">     JSValueRef arguments[] = { sessionIdentifier, evaluateFunction, createUUIDFunction };
</span><span class="lines">@@ -280,7 +280,7 @@
</span><span class="cx"> 
</span><span class="cx">     String exceptionMessage;
</span><span class="cx">     if (JSValueIsObject(context, exception)) {
</span><del>-        JSValueRef nameValue = JSObjectGetProperty(context, const_cast<JSObjectRef>(exception), OpaqueJSString::create("name"_s).get(), nullptr);
</del><ins>+        JSValueRef nameValue = JSObjectGetProperty(context, const_cast<JSObjectRef>(exception), OpaqueJSString::tryCreate("name"_s).get(), nullptr);
</ins><span class="cx">         auto exceptionName = adoptRef(JSValueToStringCopy(context, nameValue, nullptr))->string();
</span><span class="cx">         if (exceptionName == "NodeNotFound")
</span><span class="cx">             errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::NodeNotFound);
</span><span class="lines">@@ -291,7 +291,7 @@
</span><span class="cx">         else if (exceptionName == "InvalidSelector")
</span><span class="cx">             errorType = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::InvalidSelector);
</span><span class="cx"> 
</span><del>-        JSValueRef messageValue = JSObjectGetProperty(context, const_cast<JSObjectRef>(exception), OpaqueJSString::create("message"_s).get(), nullptr);
</del><ins>+        JSValueRef messageValue = JSObjectGetProperty(context, const_cast<JSObjectRef>(exception), OpaqueJSString::tryCreate("message"_s).get(), nullptr);
</ins><span class="cx">         exceptionMessage = adoptRef(JSValueToStringCopy(context, messageValue, nullptr))->string();
</span><span class="cx">     } else
</span><span class="cx">         exceptionMessage = adoptRef(JSValueToStringCopy(context, exception, nullptr))->string();
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessPluginsPDFPDFPluginmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -1118,7 +1118,7 @@
</span><span class="cx">     JSGlobalContextRef ctx = JSGlobalContextCreate(0);
</span><span class="cx">     JSObjectRef jsPDFDoc = makeJSPDFDoc(ctx);
</span><span class="cx">     for (auto& script : scripts)
</span><del>-        JSEvaluateScript(ctx, OpaqueJSString::create(script.get()).get(), jsPDFDoc, nullptr, 0, nullptr);
</del><ins>+        JSEvaluateScript(ctx, OpaqueJSString::tryCreate(script.get()).get(), jsPDFDoc, nullptr, 0, nullptr);
</ins><span class="cx">     JSGlobalContextRelease(ctx);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitLegacyiosChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/ios/ChangeLog (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/ios/ChangeLog  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebKitLegacy/ios/ChangeLog     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
+
+        [JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
+        https://bugs.webkit.org/show_bug.cgi?id=190429
+
+        Reviewed by Saam Barati.
+
+        Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.
+
+        * WebView/WebPDFViewIOS.mm:
+        (-[WebPDFView finishedLoadingWithDataSource:]):
+        * WebView/WebPDFViewPlaceholder.mm:
+        (-[WebPDFViewPlaceholder _evaluateJSForDocument:]):
+
</ins><span class="cx"> 2018-10-02  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Remove unused linked-on-or-before-iOS5 check
</span></span></pre></div>
<a id="trunkSourceWebKitLegacyiosWebViewWebPDFViewIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/ios/WebView/WebPDFViewIOS.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/ios/WebView/WebPDFViewIOS.mm   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebKitLegacy/ios/WebView/WebPDFViewIOS.mm      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -326,7 +326,7 @@
</span><span class="cx">     JSGlobalContextRef ctx = JSGlobalContextCreate(0);
</span><span class="cx">     JSObjectRef jsPDFDoc = makeJSPDFDoc(ctx, dataSource);
</span><span class="cx">     for (NSString *script in scripts)
</span><del>-        JSEvaluateScript(ctx, OpaqueJSString::create(script).get(), jsPDFDoc, nullptr, 0, nullptr);
</del><ins>+        JSEvaluateScript(ctx, OpaqueJSString::tryCreate(script).get(), jsPDFDoc, nullptr, 0, nullptr);
</ins><span class="cx">     JSGlobalContextRelease(ctx);
</span><span class="cx"> 
</span><span class="cx">     [self setNeedsDisplay:YES];
</span></span></pre></div>
<a id="trunkSourceWebKitLegacyiosWebViewWebPDFViewPlaceholdermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm   2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebKitLegacy/ios/WebView/WebPDFViewPlaceholder.mm      2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -307,7 +307,7 @@
</span><span class="cx">         JSGlobalContextRef ctx = JSGlobalContextCreate(0);
</span><span class="cx">         JSObjectRef jsPDFDoc = makeJSPDFDoc(ctx, _dataSource);
</span><span class="cx">         for (NSString *script in scripts)
</span><del>-            JSEvaluateScript(ctx, OpaqueJSString::create(script).get(), jsPDFDoc, nullptr, 0, nullptr);
</del><ins>+            JSEvaluateScript(ctx, OpaqueJSString::tryCreate(script).get(), jsPDFDoc, nullptr, 0, nullptr);
</ins><span class="cx">         JSGlobalContextRelease(ctx);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/ChangeLog  2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog     2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
+
+        [JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
+        https://bugs.webkit.org/show_bug.cgi?id=190429
+
+        Reviewed by Saam Barati.
+
+        Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.
+
+        * WebView/WebPDFRepresentation.mm:
+        (-[WebPDFRepresentation finishedLoadingWithDataSource:]):
+
</ins><span class="cx"> 2018-10-08  Justin Fan  <justin_fan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         WebGPU: Rename old WebGPU prototype to WebMetal
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebViewWebPDFRepresentationmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPDFRepresentation.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebView/WebPDFRepresentation.mm    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPDFRepresentation.mm       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx">     JSGlobalContextRef ctx = JSGlobalContextCreate(0);
</span><span class="cx">     JSObjectRef jsPDFDoc = makeJSPDFDoc(ctx, dataSource);
</span><span class="cx">     for (NSString *script in scripts)
</span><del>-        JSEvaluateScript(ctx, OpaqueJSString::create(script).get(), jsPDFDoc, nullptr, 0, nullptr);
</del><ins>+        JSEvaluateScript(ctx, OpaqueJSString::tryCreate(script).get(), jsPDFDoc, nullptr, 0, nullptr);
</ins><span class="cx">     JSGlobalContextRelease(ctx);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Tools/ChangeLog       2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2018-10-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
+
+        [JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
+        https://bugs.webkit.org/show_bug.cgi?id=190429
+
+        Reviewed by Saam Barati.
+
+        * TestWebKitAPI/Tests/WebCore/mac/GPUBuffer.mm:
+        (TestWebKitAPI::TEST_F):
+
</ins><span class="cx"> 2018-10-10  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Regression(PSON): Assertion hit under WebPageProxy::didNavigateWithNavigationData()
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoremacGPUBuffermm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/mac/GPUBuffer.mm (237008 => 237009)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/mac/GPUBuffer.mm 2018-10-10 18:21:11 UTC (rev 237008)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/mac/GPUBuffer.mm    2018-10-10 18:29:44 UTC (rev 237009)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     auto data = bufferView->data();
</span><span class="cx">     memset(data, 1, bufferView->byteLength());
</span><span class="cx"> 
</span><del>-    GPUBuffer buffer { device, *bufferView };
</del><ins>+    GPUBuffer buffer { device, bufferView.get() };
</ins><span class="cx">     EXPECT_EQ(1024U, buffer.length());
</span><span class="cx"> 
</span><span class="cx">     auto contents = buffer.contents();
</span></span></pre>
</div>
</div>

</body>
</html>