<!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>[200291] 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/200291">200291</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-04-30 12:16:00 -0700 (Sat, 30 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Next batch of conversions to use C++ enum class instead of strings for enumerations
https://bugs.webkit.org/show_bug.cgi?id=157232
Reviewed by Chris Dumez.
Source/WebCore:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::error): Use ResponseType.
(WebCore::FetchResponse::redirect): Ditto.
(WebCore::FetchResponse::FetchResponse): Ditto.
(WebCore::FetchResponse::clone): Ditto.
(WebCore::FetchResponse::type): Return ResponseType.
(WebCore::FetchResponse::startFetching): Use auto.
* Modules/fetch/FetchResponse.h: Added ResponseType and used it for the return value
of the type function, and also to replace FetchResponse::Type.
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::externalDeviceType): Return DeviceType.
* Modules/mediacontrols/MediaControlsHost.h: Added DeviceType and use it for the
return value for the externalDeviceType function.
* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::parseKind): Deleted.
(WebCore::MediaSession::MediaSession): Use MediaSessionKind.
(WebCore::MediaSession::kind): Deleted.
* Modules/mediasession/MediaSession.h: Added MediaSessionKind and use it as the
argument to MediaSession::create and the return type for the kind function.
Probably didn't get this 100% right because this code does not seem to be compiled.
* Modules/mediasession/MediaSession.idl: Added default value for kind, as specified
in the current version of the specification for this class.
* Modules/mediasession/MediaSessionManager.cpp:
(WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification):
Tried to update for changes above.
(WebCore::MediaSessionManager::didReceiveEndOfInterruptionNotification): Ditto.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::endOfStream): Changed to take Optional<EndOfStreamError>
instead of overloading and taking const AtomicString&.
(WebCore::MediaSource::streamEndedWithError): Ditto. Also removed exception code.
(WebCore::MediaSource::addSourceBuffer): Updated to use EndOfStreamError. Also
used an if statement.
(WebCore::MediaSource::sourceBufferDidChangeActiveState): Updated to take a reference
instead of a pointer.
* Modules/mediasource/MediaSource.h: Added EndOfStreamError and changed as above.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::segmentsKeyword): Deleted.
(WebCore::SourceBuffer::sequenceKeyword): Deleted.
(WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Initialize booleans where they are
defined rather than in this constructor.
(WebCore::SourceBuffer::create): Use Ref instead of RefPtr.
(WebCore::SourceBuffer::SourceBuffer): Initialize many data members where they are
defined rather than in this constructor.
(WebCore::SourceBuffer::setTimestampOffset): Use AppendMode.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Ditto.
(WebCore::SourceBuffer::decodeError): Deleted.
(WebCore::SourceBuffer::networkError): Deleted.
(WebCore::SourceBuffer::setActive): Pass reference instead of pointer.
(WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Deleted. No callers.
(WebCore::SourceBuffer::appendError): Use AppendMode.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
(WebCore::SourceBuffer::setMode): Take AppendMode.
* Modules/mediasource/SourceBuffer.h: Added AppendMode, removed various string
constant functions, initialize more data emebers in this header. Removed unused
sourceBufferPrivateDidEndStream function.
* Modules/mediastream/MediaDeviceInfo.cpp:
(WebCore::MediaDeviceInfo::MediaDeviceInfo): Take MediaDeviceKind instead of string.
(WebCore::MediaDeviceInfo::create): Ditto.
(WebCore::MediaDeviceInfo::audioInputType): Deleted.
(WebCore::MediaDeviceInfo::audioOutputType): Deleted.
(WebCore::MediaDeviceInfo::videoInputType): Deleted.
* Modules/mediastream/MediaDeviceInfo.h: Aedded MediaDeviceKind and used it.
* Modules/mediastream/MediaDeviceInfo.idl: Changed type of the kind attribute
to be MediaDeviceKind as in the specification.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Fix loop to not
churn the reference countds. Also updated to use String instead of AtomicString for
label, and MediaDeviceKind instead of string for kind.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::readyState): Return MediaStreamTrackState.
* Modules/mediastream/MediaStreamTrack.h: Added MediaStreamTrackState and used it
for the return value from the readyState function.
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::state): Return AudioContextState.
* Modules/webaudio/AudioContext.h: Added AudioContextState and used it.
* Modules/webaudio/WaveShaperNode.cpp:
(WebCore::processorType): Added.
(WebCore::WaveShaperNode::setOversample): Take OverSampletype instead of a string.
(WebCore::WaveShaperNode::oversample): Return OverSampleType.
* Modules/webaudio/WaveShaperNode.h: Added OverSampleType and used it.
* Modules/webaudio/WaveShaperNode.idl: Removed unneeded [SetterRaisesException].
* bindings/scripts/CodeGenerator.pm: Removed special cases for 18 enumerations that
either don't exist or were converted to no longer pass strings in to the C++ DOM.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeaderContentHeader): Use #pragma once instead of header guards.
(GetEnumerationValueName): Added logic to handle names with "-" and starting with
a numeric digit.
(GetEnumerationImplementationContent): Changed functions so they do more of the
binding work. Added JSValueTraits specialization so we can generate bindings for
a vector of any enumeration. Added special cases for null string. Removed special
case to keep the style checker happy.
(GenerateHeader): Removed the #endif that matched the header guards in
GenerateHeaderContentHeader.
(GenerateImplementation): Use the $type local variable rather than writing out
$attribute->signature->type or $attributeType. Fixed code path that checks for
valid enumeration values to work for non-string-based enumerations.
(CanUseWTFOptionalForParameter): Turn this function off for the new enumerations.
For now, leave it on for the old string-based enumerations.
(GenerateParametersCheck): Added appropriate parameter checking for the new
enumerations.
(GenerateCallbackHeader): Removed the #endif that matched the header guards in
GenerateHeaderContentHeader.
(GetNativeType): Use "auto" instead of the enumeration name in generated code.
(JSValueToNative): Updated since the name of enumerationValueMyEnum was changed
to parseMyEnum.
(NativeToJSValue): Took out call to stringValue, since we now overload the
jsStringWithCache function instead.
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCallback.h:
* bindings/scripts/test/JS/JSTestCallbackFunction.h:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNode.h:
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.h:
* bindings/scripts/test/JS/JSreadonly.h:
Regenerated.
* crypto/CryptoKey.cpp:
(WebCore::CryptoKey::type): Use CryptoKeyType.
(WebCore::CryptoKey::usages): Use KeyUsage.
* crypto/CryptoKey.h: Added KeyUsage and use CryptoKeyType.
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::status): Use FontFaceSetLoadStatus.
* css/FontFaceSet.h: Added FontFaceSetLoadStatus and used it.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal): Use kind instead of kindEnum.
* html/HTMLVideoElement.cpp:
(WebCore::presentationModeFullscreen): Deleted.
(WebCore::presentationModePictureInPicture): Deleted.
(WebCore::presentationModeInline): Deleted.
(WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Use VideoPresentationMode.
(WebCore::toFullscreenMode): Ditto.
(WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
(WebCore::toPresentationMode): Ditto.
(WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.
* html/HTMLVideoElement.h: Added VideoPresentationMode and used it.
* html/canvas/CanvasRenderingContext2D.cpp: Tweaked formatting. Changed
DefaultSmoothingQuality macro to a constant.
(WebCore::toWindRule): Replaces parseWinding.
(WebCore::CanvasRenderingContext2D::fill): Use CanvasWindingRule instead of string.
(WebCore::CanvasRenderingContext2D::clip): Ditto.
(WebCore::CanvasRenderingContext2D::fillInternal): Ditto.
(WebCore::CanvasRenderingContext2D::clipInternal): Ditto.
(WebCore::CanvasRenderingContext2D::isPointInPath): Ditto.
(WebCore::CanvasRenderingContext2D::isPointInStroke): Ditto.
(WebCore::CanvasRenderingContext2D::isPointInPathInternal): Ditto.
(WebCore::smoothingToInterpolationQuality): Ditto.
(WebCore::CanvasRenderingContext2D::imageSmoothingQuality): Ditto.
(WebCore::CanvasRenderingContext2D::setImageSmoothingQuality): Ditto.
* html/canvas/CanvasRenderingContext2D.h: Added CanvasWindingRule and
ImageSmoothingQuality, and use them throughout the class.
* platform/graphics/SourceBufferPrivateClient.h: Removed unused
sourceBufferPrivateDidEndStream function.
Tools:
* Scripts/webkitpy/style/checker.py: Skip the bindings script tests when doing style
checking. We don't want to waste time trying to make our generated code match our style.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchResponsecpp">trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchResponseh">trunk/Source/WebCore/Modules/fetch/FetchResponse.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsMediaControlsHostcpp">trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediacontrolsMediaControlsHosth">trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasessionMediaSessioncpp">trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasessionMediaSessionh">trunk/Source/WebCore/Modules/mediasession/MediaSession.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasessionMediaSessionidl">trunk/Source/WebCore/Modules/mediasession/MediaSession.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasessionMediaSessionManagercpp">trunk/Source/WebCore/Modules/mediasession/MediaSessionManager.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourcecpp">trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourceh">trunk/Source/WebCore/Modules/mediasource/MediaSource.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBuffercpp">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceSourceBufferh">trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDeviceInfocpp">trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDeviceInfoh">trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDeviceInfoidl">trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaDevicesRequestcpp">trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaStreamTrackcpp">trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaStreamTrackh">trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioContextcpp">trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioContexth">trunk/Source/WebCore/Modules/webaudio/AudioContext.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioWaveShaperNodecpp">trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioWaveShaperNodeh">trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioWaveShaperNodeidl">trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorpm">trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjecth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestClassWithJSBuiltinConstructorh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjecth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGetterh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargeth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestExceptionh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGenerateIsReachableh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjecth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfaceh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestJSBuiltinConstructorh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestMediaQueryListListenerh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNodeh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministich">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinsh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfaceh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefsh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSattributeh">trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSreadonlyh">trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h</a></li>
<li><a href="#trunkSourceWebCorecryptoCryptoKeycpp">trunk/Source/WebCore/crypto/CryptoKey.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoCryptoKeyh">trunk/Source/WebCore/crypto/CryptoKey.h</a></li>
<li><a href="#trunkSourceWebCorecssFontFaceSetcpp">trunk/Source/WebCore/css/FontFaceSet.cpp</a></li>
<li><a href="#trunkSourceWebCorecssFontFaceSeth">trunk/Source/WebCore/css/FontFaceSet.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLVideoElementcpp">trunk/Source/WebCore/html/HTMLVideoElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLVideoElementh">trunk/Source/WebCore/html/HTMLVideoElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dh">trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaWebPlaybackSessionModelMediaElementmm">trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSourceBufferPrivateClienth">trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptswebkitpystylecheckerpy">trunk/Tools/Scripts/webkitpy/style/checker.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/ChangeLog        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -1,3 +1,198 @@
</span><ins>+2016-04-30 Darin Adler <darin@apple.com>
+
+ Next batch of conversions to use C++ enum class instead of strings for enumerations
+ https://bugs.webkit.org/show_bug.cgi?id=157232
+
+ Reviewed by Chris Dumez.
+
+ * Modules/fetch/FetchResponse.cpp:
+ (WebCore::FetchResponse::error): Use ResponseType.
+ (WebCore::FetchResponse::redirect): Ditto.
+ (WebCore::FetchResponse::FetchResponse): Ditto.
+ (WebCore::FetchResponse::clone): Ditto.
+ (WebCore::FetchResponse::type): Return ResponseType.
+ (WebCore::FetchResponse::startFetching): Use auto.
+ * Modules/fetch/FetchResponse.h: Added ResponseType and used it for the return value
+ of the type function, and also to replace FetchResponse::Type.
+
+ * Modules/mediacontrols/MediaControlsHost.cpp:
+ (WebCore::MediaControlsHost::externalDeviceType): Return DeviceType.
+ * Modules/mediacontrols/MediaControlsHost.h: Added DeviceType and use it for the
+ return value for the externalDeviceType function.
+
+ * Modules/mediasession/MediaSession.cpp:
+ (WebCore::MediaSession::parseKind): Deleted.
+ (WebCore::MediaSession::MediaSession): Use MediaSessionKind.
+ (WebCore::MediaSession::kind): Deleted.
+ * Modules/mediasession/MediaSession.h: Added MediaSessionKind and use it as the
+ argument to MediaSession::create and the return type for the kind function.
+ Probably didn't get this 100% right because this code does not seem to be compiled.
+ * Modules/mediasession/MediaSession.idl: Added default value for kind, as specified
+ in the current version of the specification for this class.
+ * Modules/mediasession/MediaSessionManager.cpp:
+ (WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification):
+ Tried to update for changes above.
+ (WebCore::MediaSessionManager::didReceiveEndOfInterruptionNotification): Ditto.
+
+ * Modules/mediasource/MediaSource.cpp:
+ (WebCore::MediaSource::endOfStream): Changed to take Optional<EndOfStreamError>
+ instead of overloading and taking const AtomicString&.
+ (WebCore::MediaSource::streamEndedWithError): Ditto. Also removed exception code.
+ (WebCore::MediaSource::addSourceBuffer): Updated to use EndOfStreamError. Also
+ used an if statement.
+ (WebCore::MediaSource::sourceBufferDidChangeActiveState): Updated to take a reference
+ instead of a pointer.
+ * Modules/mediasource/MediaSource.h: Added EndOfStreamError and changed as above.
+
+ * Modules/mediasource/SourceBuffer.cpp:
+ (WebCore::SourceBuffer::segmentsKeyword): Deleted.
+ (WebCore::SourceBuffer::sequenceKeyword): Deleted.
+ (WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Initialize booleans where they are
+ defined rather than in this constructor.
+ (WebCore::SourceBuffer::create): Use Ref instead of RefPtr.
+ (WebCore::SourceBuffer::SourceBuffer): Initialize many data members where they are
+ defined rather than in this constructor.
+ (WebCore::SourceBuffer::setTimestampOffset): Use AppendMode.
+ (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Ditto.
+ (WebCore::SourceBuffer::decodeError): Deleted.
+ (WebCore::SourceBuffer::networkError): Deleted.
+ (WebCore::SourceBuffer::setActive): Pass reference instead of pointer.
+ (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Deleted. No callers.
+ (WebCore::SourceBuffer::appendError): Use AppendMode.
+ (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
+ (WebCore::SourceBuffer::setMode): Take AppendMode.
+ * Modules/mediasource/SourceBuffer.h: Added AppendMode, removed various string
+ constant functions, initialize more data emebers in this header. Removed unused
+ sourceBufferPrivateDidEndStream function.
+
+ * Modules/mediastream/MediaDeviceInfo.cpp:
+ (WebCore::MediaDeviceInfo::MediaDeviceInfo): Take MediaDeviceKind instead of string.
+ (WebCore::MediaDeviceInfo::create): Ditto.
+ (WebCore::MediaDeviceInfo::audioInputType): Deleted.
+ (WebCore::MediaDeviceInfo::audioOutputType): Deleted.
+ (WebCore::MediaDeviceInfo::videoInputType): Deleted.
+ * Modules/mediastream/MediaDeviceInfo.h: Aedded MediaDeviceKind and used it.
+ * Modules/mediastream/MediaDeviceInfo.idl: Changed type of the kind attribute
+ to be MediaDeviceKind as in the specification.
+
+ * Modules/mediastream/MediaDevicesRequest.cpp:
+ (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Fix loop to not
+ churn the reference countds. Also updated to use String instead of AtomicString for
+ label, and MediaDeviceKind instead of string for kind.
+
+ * Modules/mediastream/MediaStreamTrack.cpp:
+ (WebCore::MediaStreamTrack::readyState): Return MediaStreamTrackState.
+ * Modules/mediastream/MediaStreamTrack.h: Added MediaStreamTrackState and used it
+ for the return value from the readyState function.
+
+ * Modules/webaudio/AudioContext.cpp:
+ (WebCore::AudioContext::state): Return AudioContextState.
+ * Modules/webaudio/AudioContext.h: Added AudioContextState and used it.
+
+ * Modules/webaudio/WaveShaperNode.cpp:
+ (WebCore::processorType): Added.
+ (WebCore::WaveShaperNode::setOversample): Take OverSampletype instead of a string.
+ (WebCore::WaveShaperNode::oversample): Return OverSampleType.
+ * Modules/webaudio/WaveShaperNode.h: Added OverSampleType and used it.
+ * Modules/webaudio/WaveShaperNode.idl: Removed unneeded [SetterRaisesException].
+
+ * bindings/scripts/CodeGenerator.pm: Removed special cases for 18 enumerations that
+ either don't exist or were converted to no longer pass strings in to the C++ DOM.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateHeaderContentHeader): Use #pragma once instead of header guards.
+ (GetEnumerationValueName): Added logic to handle names with "-" and starting with
+ a numeric digit.
+ (GetEnumerationImplementationContent): Changed functions so they do more of the
+ binding work. Added JSValueTraits specialization so we can generate bindings for
+ a vector of any enumeration. Added special cases for null string. Removed special
+ case to keep the style checker happy.
+ (GenerateHeader): Removed the #endif that matched the header guards in
+ GenerateHeaderContentHeader.
+ (GenerateImplementation): Use the $type local variable rather than writing out
+ $attribute->signature->type or $attributeType. Fixed code path that checks for
+ valid enumeration values to work for non-string-based enumerations.
+ (CanUseWTFOptionalForParameter): Turn this function off for the new enumerations.
+ For now, leave it on for the old string-based enumerations.
+ (GenerateParametersCheck): Added appropriate parameter checking for the new
+ enumerations.
+ (GenerateCallbackHeader): Removed the #endif that matched the header guards in
+ GenerateHeaderContentHeader.
+ (GetNativeType): Use "auto" instead of the enumeration name in generated code.
+ (JSValueToNative): Updated since the name of enumerationValueMyEnum was changed
+ to parseMyEnum.
+ (NativeToJSValue): Took out call to stringValue, since we now overload the
+ jsStringWithCache function instead.
+
+ * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
+ * bindings/scripts/test/JS/JSTestCallback.h:
+ * bindings/scripts/test/JS/JSTestCallbackFunction.h:
+ * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
+ * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
+ * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
+ * bindings/scripts/test/JS/JSTestEventConstructor.h:
+ * bindings/scripts/test/JS/JSTestEventTarget.h:
+ * bindings/scripts/test/JS/JSTestException.h:
+ * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
+ * bindings/scripts/test/JS/JSTestGlobalObject.h:
+ * bindings/scripts/test/JS/JSTestInterface.h:
+ * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
+ * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
+ * bindings/scripts/test/JS/JSTestNamedConstructor.h:
+ * bindings/scripts/test/JS/JSTestNode.h:
+ * bindings/scripts/test/JS/JSTestNondeterministic.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/JS/JSTestObj.h:
+ * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
+ * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
+ * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
+ * bindings/scripts/test/JS/JSTestTypedefs.h:
+ * bindings/scripts/test/JS/JSattribute.h:
+ * bindings/scripts/test/JS/JSreadonly.h:
+ Regenerated.
+
+ * crypto/CryptoKey.cpp:
+ (WebCore::CryptoKey::type): Use CryptoKeyType.
+ (WebCore::CryptoKey::usages): Use KeyUsage.
+ * crypto/CryptoKey.h: Added KeyUsage and use CryptoKeyType.
+
+ * css/FontFaceSet.cpp:
+ (WebCore::FontFaceSet::status): Use FontFaceSetLoadStatus.
+ * css/FontFaceSet.h: Added FontFaceSetLoadStatus and used it.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::playInternal): Use kind instead of kindEnum.
+
+ * html/HTMLVideoElement.cpp:
+ (WebCore::presentationModeFullscreen): Deleted.
+ (WebCore::presentationModePictureInPicture): Deleted.
+ (WebCore::presentationModeInline): Deleted.
+ (WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Use VideoPresentationMode.
+ (WebCore::toFullscreenMode): Ditto.
+ (WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
+ (WebCore::toPresentationMode): Ditto.
+ (WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.
+ * html/HTMLVideoElement.h: Added VideoPresentationMode and used it.
+
+ * html/canvas/CanvasRenderingContext2D.cpp: Tweaked formatting. Changed
+ DefaultSmoothingQuality macro to a constant.
+ (WebCore::toWindRule): Replaces parseWinding.
+ (WebCore::CanvasRenderingContext2D::fill): Use CanvasWindingRule instead of string.
+ (WebCore::CanvasRenderingContext2D::clip): Ditto.
+ (WebCore::CanvasRenderingContext2D::fillInternal): Ditto.
+ (WebCore::CanvasRenderingContext2D::clipInternal): Ditto.
+ (WebCore::CanvasRenderingContext2D::isPointInPath): Ditto.
+ (WebCore::CanvasRenderingContext2D::isPointInStroke): Ditto.
+ (WebCore::CanvasRenderingContext2D::isPointInPathInternal): Ditto.
+ (WebCore::smoothingToInterpolationQuality): Ditto.
+ (WebCore::CanvasRenderingContext2D::imageSmoothingQuality): Ditto.
+ (WebCore::CanvasRenderingContext2D::setImageSmoothingQuality): Ditto.
+ * html/canvas/CanvasRenderingContext2D.h: Added CanvasWindingRule and
+ ImageSmoothingQuality, and use them throughout the class.
+
+ * platform/graphics/SourceBufferPrivateClient.h: Removed unused
+ sourceBufferPrivateDidEndStream function.
+
</ins><span class="cx"> 2016-04-30 Nan Wang <n_wang@apple.com>
</span><span class="cx">
</span><span class="cx"> AX: @aria-label attribute should work on <label> element
</span><span class="lines">@@ -15,6 +210,10 @@
</span><span class="cx"> * accessibility/AccessibilityRenderObject.cpp:
</span><span class="cx"> (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
</span><span class="cx">
</span><ins>+ * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
+ (WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):
+ Use DeviceType instead of String for externalDeviceType.
+
</ins><span class="cx"> 2016-04-29 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> [Web IDL] Specify default parameter values for callback parameters
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchResponsecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">
</span><span class="cx"> Ref<FetchResponse> FetchResponse::error(ScriptExecutionContext& context)
</span><span class="cx"> {
</span><del>- return adoptRef(*new FetchResponse(context, Type::Error, { }, FetchHeaders::create(FetchHeaders::Guard::Immutable), ResourceResponse()));
</del><ins>+ return adoptRef(*new FetchResponse(context, ResponseType::Error, { }, FetchHeaders::create(FetchHeaders::Guard::Immutable), { }));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<FetchResponse> FetchResponse::redirect(ScriptExecutionContext& context, const String& url, int status, ExceptionCode& ec)
</span><span class="lines">@@ -66,10 +66,10 @@
</span><span class="cx"> ec = TypeError;
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><del>- RefPtr<FetchResponse> redirectResponse = adoptRef(*new FetchResponse(context, Type::Default, { }, FetchHeaders::create(FetchHeaders::Guard::Immutable), ResourceResponse()));
</del><ins>+ auto redirectResponse = adoptRef(*new FetchResponse(context, ResponseType::Default, { }, FetchHeaders::create(FetchHeaders::Guard::Immutable), { }));
</ins><span class="cx"> redirectResponse->m_response.setHTTPStatusCode(status);
</span><span class="cx"> redirectResponse->m_headers->fastSet(HTTPHeaderName::Location, requestURL.string());
</span><del>- return redirectResponse;
</del><ins>+ return WTFMove(redirectResponse);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void FetchResponse::initializeWith(const Dictionary& init, ExceptionCode& ec)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-FetchResponse::FetchResponse(ScriptExecutionContext& context, Type type, FetchBody&& body, Ref<FetchHeaders>&& headers, ResourceResponse&& response)
</del><ins>+FetchResponse::FetchResponse(ScriptExecutionContext& context, ResponseType type, FetchBody&& body, Ref<FetchHeaders>&& headers, ResourceResponse&& response)
</ins><span class="cx"> : FetchBodyOwner(context, WTFMove(body))
</span><span class="cx"> , m_type(type)
</span><span class="cx"> , m_response(WTFMove(response))
</span><span class="lines">@@ -123,34 +123,14 @@
</span><span class="cx"> ec = TypeError;
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><del>- RefPtr<FetchResponse> cloned = adoptRef(*new FetchResponse(context, m_type, FetchBody(m_body), FetchHeaders::create(headers()), ResourceResponse(m_response)));
</del><ins>+ auto cloned = adoptRef(*new FetchResponse(context, m_type, FetchBody(m_body), FetchHeaders::create(headers()), ResourceResponse(m_response)));
</ins><span class="cx"> cloned->m_isRedirected = m_isRedirected;
</span><del>- return cloned;
</del><ins>+ return WTFMove(cloned);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-String FetchResponse::type() const
-{
- switch (m_type) {
- case Type::Basic:
- return ASCIILiteral("basic");
- case Type::Cors:
- return ASCIILiteral("cors");
- case Type::Default:
- return ASCIILiteral("default");
- case Type::Error:
- return ASCIILiteral("error");
- case Type::Opaque:
- return ASCIILiteral("opaque");
- case Type::OpaqueRedirect:
- return ASCIILiteral("opaqueredirect");
- };
- ASSERT_NOT_REACHED();
- return String();
-}
-
</del><span class="cx"> void FetchResponse::startFetching(ScriptExecutionContext& context, const FetchRequest& request, FetchPromise&& promise)
</span><span class="cx"> {
</span><del>- Ref<FetchResponse> response = adoptRef(*new FetchResponse(context, Type::Basic, FetchBody::loadingBody(), FetchHeaders::create(FetchHeaders::Guard::Immutable), ResourceResponse()));
</del><ins>+ auto response = adoptRef(*new FetchResponse(context, ResponseType::Basic, FetchBody::loadingBody(), FetchHeaders::create(FetchHeaders::Guard::Immutable), ResourceResponse()));
</ins><span class="cx">
</span><span class="cx"> // Setting pending activity until BodyLoader didFail or didSucceed callback is called.
</span><span class="cx"> response->setPendingActivity(response.ptr());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchResponseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchResponse.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchResponse.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -26,8 +26,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef FetchResponse_h
-#define FetchResponse_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(FETCH_API)
</span><span class="cx">
</span><span class="lines">@@ -47,9 +46,11 @@
</span><span class="cx">
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="cx">
</span><ins>+enum class ResponseType { Basic, Cors, Default, Error, Opaque, Opaqueredirect };
+
</ins><span class="cx"> class FetchResponse final : public FetchBodyOwner {
</span><span class="cx"> public:
</span><del>- static Ref<FetchResponse> create(ScriptExecutionContext& context) { return adoptRef(*new FetchResponse(context, Type::Default, { }, FetchHeaders::create(FetchHeaders::Guard::Response), ResourceResponse())); }
</del><ins>+ static Ref<FetchResponse> create(ScriptExecutionContext& context) { return adoptRef(*new FetchResponse(context, ResponseType::Default, { }, FetchHeaders::create(FetchHeaders::Guard::Response), ResourceResponse())); }
</ins><span class="cx"> static Ref<FetchResponse> error(ScriptExecutionContext&);
</span><span class="cx"> static RefPtr<FetchResponse> redirect(ScriptExecutionContext&, const String&, int, ExceptionCode&);
</span><span class="cx">
</span><span class="lines">@@ -59,7 +60,7 @@
</span><span class="cx">
</span><span class="cx"> void initializeWith(const Dictionary&, ExceptionCode&);
</span><span class="cx">
</span><del>- String type() const;
</del><ins>+ ResponseType type() const;
</ins><span class="cx"> const String& url() const { return m_response.url().string(); }
</span><span class="cx"> bool redirected() const { return m_isRedirected; }
</span><span class="cx"> int status() const { return m_response.httpStatusCode(); }
</span><span class="lines">@@ -75,10 +76,8 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- enum class Type { Basic, Cors, Default, Error, Opaque, OpaqueRedirect };
</del><ins>+ FetchResponse(ScriptExecutionContext&, ResponseType, FetchBody&&, Ref<FetchHeaders>&&, ResourceResponse&&);
</ins><span class="cx">
</span><del>- FetchResponse(ScriptExecutionContext&, Type, FetchBody&&, Ref<FetchHeaders>&&, ResourceResponse&&);
-
</del><span class="cx"> static void startFetching(ScriptExecutionContext&, const FetchRequest&, FetchPromise&&);
</span><span class="cx">
</span><span class="cx"> // ActiveDOMObject API
</span><span class="lines">@@ -110,15 +109,18 @@
</span><span class="cx"> std::unique_ptr<FetchLoader> m_loader;
</span><span class="cx"> };
</span><span class="cx">
</span><del>- Type m_type;
</del><ins>+ ResponseType m_type;
</ins><span class="cx"> ResourceResponse m_response;
</span><span class="cx"> Ref<FetchHeaders> m_headers;
</span><span class="cx"> bool m_isRedirected = false;
</span><span class="cx"> Optional<BodyLoader> m_bodyLoader;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+inline ResponseType FetchResponse::type() const
+{
+ return m_type;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(FETCH_API)
</span><del>-
-#endif // FetchResponse_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsMediaControlsHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -233,37 +233,29 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String MediaControlsHost::externalDeviceType() const
</del><ins>+DeviceType MediaControlsHost::externalDeviceType() const
</ins><span class="cx"> {
</span><del>- static NeverDestroyed<String> none(ASCIILiteral("none"));
- String type = none;
-
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
- static NeverDestroyed<String> airplay(ASCIILiteral("airplay"));
- static NeverDestroyed<String> tvout(ASCIILiteral("tvout"));
-
</del><ins>+#if !ENABLE(WIRELESS_PLAYBACK_TARGET)
+ return DeviceType::None;
+#else
</ins><span class="cx"> MediaPlayer* player = m_mediaElement->player();
</span><span class="cx"> if (!player) {
</span><span class="cx"> LOG(Media, "MediaControlsHost::externalDeviceType - returning \"none\" because player is NULL");
</span><del>- return none;
</del><ins>+ return DeviceType::None;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (player->wirelessPlaybackTargetType()) {
</span><span class="cx"> case MediaPlayer::TargetTypeNone:
</span><del>- type = none;
- break;
</del><ins>+ return DeviceType::None;
</ins><span class="cx"> case MediaPlayer::TargetTypeAirPlay:
</span><del>- type = airplay;
- break;
</del><ins>+ return DeviceType::Airplay;
</ins><span class="cx"> case MediaPlayer::TargetTypeTVOut:
</span><del>- type = tvout;
- break;
</del><ins>+ return DeviceType::Tvout;
</ins><span class="cx"> }
</span><ins>+
+ ASSERT_NOT_REACHED();
+ return DeviceType::None;
</ins><span class="cx"> #endif
</span><del>-
- LOG(Media, "MediaControlsHost::externalDeviceType - returning \"%s\"", type.utf8().data());
-
- return type;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MediaControlsHost::controlsDependOnPageScaleFactor() const
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediacontrolsMediaControlsHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -42,6 +42,8 @@
</span><span class="cx"> class TextTrack;
</span><span class="cx"> class TextTrackList;
</span><span class="cx">
</span><ins>+enum class DeviceType { None, Airplay, Tvout };
+
</ins><span class="cx"> class MediaControlsHost : public RefCounted<MediaControlsHost> {
</span><span class="cx"> public:
</span><span class="cx"> static Ref<MediaControlsHost> create(HTMLMediaElement*);
</span><span class="lines">@@ -71,7 +73,7 @@
</span><span class="cx"> void exitedFullscreen();
</span><span class="cx">
</span><span class="cx"> String externalDeviceDisplayName() const;
</span><del>- String externalDeviceType() const;
</del><ins>+ DeviceType externalDeviceType() const;
</ins><span class="cx">
</span><span class="cx"> bool controlsDependOnPageScaleFactor() const;
</span><span class="cx"> void setControlsDependOnPageScaleFactor(bool v);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasessionMediaSessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -37,33 +37,9 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-static const char* defaultKind = "";
-static const char* ambientKind = "ambient";
-static const char* transientKind = "transient";
-static const char* transientSoloKind = "transient-solo";
-static const char* contentKind = "content";
-
-MediaSession::Kind MediaSession::parseKind(const String& kind)
-{
- // 4. Media Session
- // 2. Set media session's current media session type to the corresponding media session type of media session category.
-
- if (kind.isNull() || kind == contentKind)
- return MediaSession::Kind::Content;
- if (kind == ambientKind)
- return MediaSession::Kind::Ambient;
- if (kind == transientKind)
- return MediaSession::Kind::Transient;
- if (kind == transientSoloKind)
- return MediaSession::Kind::TransientSolo;
-
- ASSERT_NOT_REACHED();
- return MediaSession::Kind::Content;
-}
-
-MediaSession::MediaSession(ScriptExecutionContext& context, const String& kind)
</del><ins>+MediaSession::MediaSession(ScriptExecutionContext& context, MediaSessionKind kind)
</ins><span class="cx"> : m_document(downcast<Document>(context))
</span><del>- , m_kind(parseKind(kind))
</del><ins>+ , m_kind(kind)
</ins><span class="cx"> {
</span><span class="cx"> // 4. Media Sessions
</span><span class="cx"> // 3. If media session's current media session type is "content", then create a new media remote controller for media
</span><span class="lines">@@ -82,22 +58,6 @@
</span><span class="cx"> m_controls->clearSession();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String MediaSession::kind() const
-{
- switch (m_kind) {
- case MediaSession::Kind::Default:
- return defaultKind;
- case MediaSession::Kind::Ambient:
- return ambientKind;
- case MediaSession::Kind::Transient:
- return transientKind;
- case MediaSession::Kind::TransientSolo:
- return transientSoloKind;
- case MediaSession::Kind::Content:
- return contentKind;
- }
-}
-
</del><span class="cx"> MediaRemoteControls* MediaSession::controls()
</span><span class="cx"> {
</span><span class="cx"> return m_controls.get();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasessionMediaSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasession/MediaSession.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasession/MediaSession.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSession.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef MediaSession_h
-#define MediaSession_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><span class="cx">
</span><span class="lines">@@ -37,31 +36,20 @@
</span><span class="cx"> class Document;
</span><span class="cx"> class HTMLMediaElement;
</span><span class="cx">
</span><ins>+enum class MediaSessionKind { Content, Transient, TransientSolo, Ambient };
+
</ins><span class="cx"> class MediaSession final : public RefCounted<MediaSession> {
</span><span class="cx"> public:
</span><del>- enum class State {
- Idle,
- Active,
- Interrupted
- };
</del><ins>+ enum class State { Idle, Active, Interrupted };
</ins><span class="cx">
</span><del>- enum class Kind {
- Default,
- Content,
- Transient,
- TransientSolo,
- Ambient
- };
-
- static Ref<MediaSession> create(ScriptExecutionContext& context, const String& kind = String())
</del><ins>+ static Ref<MediaSession> create(ScriptExecutionContext& context, MediaSessionKind kind)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(*new MediaSession(context, kind));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ~MediaSession();
</span><span class="cx">
</span><del>- String kind() const;
- Kind kindEnum() const { return m_kind; }
</del><ins>+ MediaSessionKind kind() const { return m_kind; }
</ins><span class="cx"> MediaRemoteControls* controls();
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT State currentState() const { return m_currentState; }
</span><span class="lines">@@ -91,8 +79,6 @@
</span><span class="cx">
</span><span class="cx"> MediaSession(ScriptExecutionContext&, const String&);
</span><span class="cx">
</span><del>- static Kind parseKind(const String&);
-
</del><span class="cx"> void addMediaElement(HTMLMediaElement&);
</span><span class="cx"> void removeMediaElement(HTMLMediaElement&);
</span><span class="cx">
</span><span class="lines">@@ -109,7 +95,7 @@
</span><span class="cx"> HashSet<HTMLMediaElement*>* m_iteratedActiveParticipatingElements { nullptr };
</span><span class="cx">
</span><span class="cx"> Document& m_document;
</span><del>- const Kind m_kind { Kind::Default };
</del><ins>+ const MediaSessionKind m_kind;
</ins><span class="cx"> RefPtr<MediaRemoteControls> m_controls;
</span><span class="cx"> MediaSessionMetadata m_metadata;
</span><span class="cx"> };
</span><span class="lines">@@ -117,5 +103,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif /* ENABLE(MEDIA_SESSION) */
</span><del>-
-#endif /* MediaSession_h */
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasessionMediaSessionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasession/MediaSession.idl (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasession/MediaSession.idl        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSession.idl        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx">
</span><span class="cx"> [
</span><span class="cx"> Conditional=MEDIA_SESSION,
</span><del>- CustomConstructor(optional MediaSessionKind kind),
</del><ins>+ CustomConstructor(optional MediaSessionKind kind = "content"),
</ins><span class="cx"> ConstructorCallWith=ScriptExecutionContext,
</span><span class="cx"> ImplementationLacksVTable,
</span><span class="cx"> ExportMacro=WEBCORE_EXPORT,
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasessionMediaSessionManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasession/MediaSessionManager.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasession/MediaSessionManager.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSessionManager.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -118,19 +118,19 @@
</span><span class="cx"> // - If interrupting media session category is Content:
</span><span class="cx"> // If media session's current media session type is Default or Content then indefinitely pause all of media
</span><span class="cx"> // session's active audio-producing participants and set media session's current state to idle.
</span><del>- if (session->kindEnum() == MediaSession::Kind::Default || session->kindEnum() == MediaSession::Kind::Content)
</del><ins>+ if (session->kind() == MediaSessionKind::Default || session->kind() == MediaSessionKind::Content)
</ins><span class="cx"> session->handleIndefinitePauseInterruption();
</span><span class="cx"> } else if (interruptingCategory == MediaSessionInterruptingCategory::Transient) {
</span><span class="cx"> // - If interrupting media session category is Transient:
</span><span class="cx"> // If media session's current media session type is Default or Content then duck all of media session's active
</span><span class="cx"> // audio-producing participants and set media session's current state to interrupted.
</span><del>- if (session->kindEnum() == MediaSession::Kind::Default || session->kindEnum() == MediaSession::Kind::Content)
</del><ins>+ if (session->kind() == MediaSessionKind::Default || session->kind() == MediaSessionKind::Content)
</ins><span class="cx"> session->handleDuckInterruption();
</span><span class="cx"> } else if (interruptingCategory == MediaSessionInterruptingCategory::TransientSolo) {
</span><span class="cx"> // - If interrupting media session category is Transient Solo:
</span><span class="cx"> // If media session's current media session type is Default, Content, Transient or Transient Solo then pause
</span><span class="cx"> // all of media session's active audio-producing participants and set current media session's current state to interrupted.
</span><del>- if (session->kindEnum() != MediaSession::Kind::Ambient)
</del><ins>+ if (session->kind() != MediaSessionKind::Ambient)
</ins><span class="cx"> session->handlePauseInterruption();
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -154,13 +154,13 @@
</span><span class="cx"> // - If interrupting media session category is Transient:
</span><span class="cx"> // If media session's current media session type is Default or Content, then unduck all of media session's
</span><span class="cx"> // active audio-producing participants and set media session's current state to active.
</span><del>- if (session->kindEnum() == MediaSession::Kind::Default || session->kindEnum() == MediaSession::Kind::Content)
</del><ins>+ if (session->kind() == MediaSessionKind::Default || session->kind() == MediaSessionKind::Content)
</ins><span class="cx"> session->handleUnduckInterruption();
</span><span class="cx"> } else if (interruptingCategory == MediaSessionInterruptingCategory::TransientSolo) {
</span><span class="cx"> // - If interrupting media session category is Transient Solo:
</span><span class="cx"> // If media session's current media session type is Default, Content, Transient, or Transient Solo, then
</span><span class="cx"> // unpause the media session's active audio-producing participants and set media session's current state to active.
</span><del>- if (session->kindEnum() != MediaSession::Kind::Ambient)
</del><ins>+ if (session->kind() != MediaSessionKind::Ambient)
</ins><span class="cx"> session->handleUnpauseInterruption();
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -414,13 +414,8 @@
</span><span class="cx"> onReadyStateChange(oldState, state);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSource::endOfStream(ExceptionCode& ec)
</del><ins>+void MediaSource::endOfStream(Optional<EndOfStreamError> error, ExceptionCode& ec)
</ins><span class="cx"> {
</span><del>- endOfStream(emptyAtom, ec);
-}
-
-void MediaSource::endOfStream(const AtomicString& error, ExceptionCode& ec)
-{
</del><span class="cx"> // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#widl-MediaSource-endOfStream-void-EndOfStreamError-error
</span><span class="cx"> // 1. If the readyState attribute is not in the "open" state then throw an
</span><span class="cx"> // INVALID_STATE_ERR exception and abort these steps.
</span><span class="lines">@@ -437,16 +432,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 3. Run the end of stream algorithm with the error parameter set to error.
</span><del>- streamEndedWithError(error, ec);
</del><ins>+ streamEndedWithError(error);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSource::streamEndedWithError(const AtomicString& error, ExceptionCode& ec)
</del><ins>+void MediaSource::streamEndedWithError(Optional<EndOfStreamError> error)
</ins><span class="cx"> {
</span><del>- static NeverDestroyed<const AtomicString> network("network", AtomicString::ConstructFromLiteral);
- static NeverDestroyed<const AtomicString> decode("decode", AtomicString::ConstructFromLiteral);
</del><ins>+ LOG(MediaSource, "MediaSource::streamEndedWithError(%p)", this);
</ins><span class="cx">
</span><del>- LOG(MediaSource, "MediaSource::streamEndedWithError(%p) : %s", this, error.string().ascii().data());
-
</del><span class="cx"> // 2.4.7 https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#end-of-stream-algorithm
</span><span class="cx">
</span><span class="cx"> // 1. Change the readyState attribute value to "ended".
</span><span class="lines">@@ -454,7 +446,7 @@
</span><span class="cx"> setReadyState(endedKeyword());
</span><span class="cx">
</span><span class="cx"> // 3.
</span><del>- if (error.isEmpty()) {
</del><ins>+ if (!error) {
</ins><span class="cx"> // ↳ If error is not set, is null, or is an empty string
</span><span class="cx"> // 1. Run the duration change algorithm with new duration set to the highest end time reported by
</span><span class="cx"> // the buffered attribute across all SourceBuffer objects in sourceBuffers.
</span><span class="lines">@@ -467,9 +459,7 @@
</span><span class="cx">
</span><span class="cx"> // 2. Notify the media element that it now has all of the media data.
</span><span class="cx"> m_private->markEndOfStream(MediaSourcePrivate::EosNoError);
</span><del>- }
-
- if (error == network) {
</del><ins>+ } else if (error == EndOfStreamError::Network) {
</ins><span class="cx"> // ↳ If error is set to "network"
</span><span class="cx"> ASSERT(m_mediaElement);
</span><span class="cx"> if (m_mediaElement->readyState() == HTMLMediaElement::HAVE_NOTHING) {
</span><span class="lines">@@ -485,8 +475,9 @@
</span><span class="cx"> // NOTE: This step is handled by HTMLMediaElement::mediaLoadingFailedFatally().
</span><span class="cx"> m_mediaElement->mediaLoadingFailedFatally(MediaPlayer::NetworkError);
</span><span class="cx"> }
</span><del>- } else if (error == decode) {
</del><ins>+ } else {
</ins><span class="cx"> // ↳ If error is set to "decode"
</span><ins>+ ASSERT(error == EndOfStreamError::Decode);
</ins><span class="cx"> ASSERT(m_mediaElement);
</span><span class="cx"> if (m_mediaElement->readyState() == HTMLMediaElement::HAVE_NOTHING) {
</span><span class="cx"> // ↳ If the HTMLMediaElement.readyState attribute equals HAVE_NOTHING
</span><span class="lines">@@ -500,10 +491,6 @@
</span><span class="cx"> // NOTE: This step is handled by HTMLMediaElement::mediaLoadingFailedFatally().
</span><span class="cx"> m_mediaElement->mediaLoadingFailedFatally(MediaPlayer::DecodeError);
</span><span class="cx"> }
</span><del>- } else if (!error.isEmpty()) {
- // ↳ Otherwise
- // Throw an INVALID_ACCESS_ERR exception.
- ec = INVALID_ACCESS_ERR;
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -558,7 +545,7 @@
</span><span class="cx"> // ↳ Set the mode attribute on the new object to "sequence".
</span><span class="cx"> // Otherwise:
</span><span class="cx"> // ↳ Set the mode attribute on the new object to "segments".
</span><del>- buffer->setMode(shouldGenerateTimestamps ? SourceBuffer::sequenceKeyword() : SourceBuffer::segmentsKeyword(), IGNORE_EXCEPTION);
</del><ins>+ buffer->setMode(shouldGenerateTimestamps ? AppendMode::Sequence : AppendMode::Segments, IGNORE_EXCEPTION);
</ins><span class="cx">
</span><span class="cx"> SourceBuffer* result = buffer.ptr();
</span><span class="cx">
</span><span class="lines">@@ -771,7 +758,7 @@
</span><span class="cx"> setReadyState(closedKeyword());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaSource::sourceBufferDidChangeAcitveState(SourceBuffer*, bool)
</del><ins>+void MediaSource::sourceBufferDidChangeActiveState(SourceBuffer&, bool)
</ins><span class="cx"> {
</span><span class="cx"> regenerateActiveSourceBuffers();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -28,8 +28,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef MediaSource_h
-#define MediaSource_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx">
</span><span class="lines">@@ -49,6 +48,8 @@
</span><span class="cx">
</span><span class="cx"> class GenericEventQueue;
</span><span class="cx">
</span><ins>+enum class EndOfStreamError { Network, Decode };
+
</ins><span class="cx"> class MediaSource : public MediaSourcePrivateClient, public ActiveDOMObject, public EventTargetWithInlineData, public URLRegistrable {
</span><span class="cx"> public:
</span><span class="cx"> static void setRegistry(URLRegistry*);
</span><span class="lines">@@ -67,8 +68,8 @@
</span><span class="cx"> bool isOpen() const;
</span><span class="cx"> bool isClosed() const;
</span><span class="cx"> bool isEnded() const;
</span><del>- void sourceBufferDidChangeAcitveState(SourceBuffer*, bool);
- void streamEndedWithError(const AtomicString& error, ExceptionCode&);
</del><ins>+ void sourceBufferDidChangeActiveState(SourceBuffer&, bool);
+ void streamEndedWithError(Optional<EndOfStreamError>);
</ins><span class="cx">
</span><span class="cx"> // MediaSourcePrivateClient
</span><span class="cx"> void setPrivateAndOpen(Ref<MediaSourcePrivate>&&) override;
</span><span class="lines">@@ -87,8 +88,7 @@
</span><span class="cx"> MediaTime currentTime() const;
</span><span class="cx"> const AtomicString& readyState() const { return m_readyState; }
</span><span class="cx"> void setReadyState(const AtomicString&);
</span><del>- void endOfStream(ExceptionCode&);
- void endOfStream(const AtomicString& error, ExceptionCode&);
</del><ins>+ void endOfStream(Optional<EndOfStreamError>, ExceptionCode&);
</ins><span class="cx">
</span><span class="cx"> HTMLMediaElement* mediaElement() const { return m_mediaElement; }
</span><span class="cx">
</span><span class="lines">@@ -147,5 +147,3 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -71,27 +71,15 @@
</span><span class="cx"> return fudgeFactor;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const AtomicString& SourceBuffer::segmentsKeyword()
-{
- static NeverDestroyed<AtomicString> segments("segments");
- return segments.get();
-}
-
-const AtomicString& SourceBuffer::sequenceKeyword()
-{
- static NeverDestroyed<AtomicString> segments("sequence");
- return segments.get();
-}
-
</del><span class="cx"> struct SourceBuffer::TrackBuffer {
</span><span class="cx"> MediaTime lastDecodeTimestamp;
</span><span class="cx"> MediaTime lastFrameDuration;
</span><span class="cx"> MediaTime highestPresentationTimestamp;
</span><span class="cx"> MediaTime lastEnqueuedPresentationTime;
</span><span class="cx"> MediaTime lastEnqueuedDecodeEndTime;
</span><del>- bool needRandomAccessFlag;
- bool enabled;
- bool needsReenqueueing;
</del><ins>+ bool needRandomAccessFlag { true };
+ bool enabled { false };
+ bool needsReenqueueing { false };
</ins><span class="cx"> SampleMap samples;
</span><span class="cx"> DecodeOrderSampleMap::MapType decodeQueue;
</span><span class="cx"> RefPtr<MediaDescription> description;
</span><span class="lines">@@ -102,18 +90,15 @@
</span><span class="cx"> , highestPresentationTimestamp(MediaTime::invalidTime())
</span><span class="cx"> , lastEnqueuedPresentationTime(MediaTime::invalidTime())
</span><span class="cx"> , lastEnqueuedDecodeEndTime(MediaTime::invalidTime())
</span><del>- , needRandomAccessFlag(true)
- , enabled(false)
- , needsReenqueueing(false)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> Ref<SourceBuffer> SourceBuffer::create(Ref<SourceBufferPrivate>&& sourceBufferPrivate, MediaSource* source)
</span><span class="cx"> {
</span><del>- RefPtr<SourceBuffer> sourceBuffer(adoptRef(new SourceBuffer(WTFMove(sourceBufferPrivate), source)));
</del><ins>+ auto sourceBuffer = adoptRef(*new SourceBuffer(WTFMove(sourceBufferPrivate), source));
</ins><span class="cx"> sourceBuffer->suspendIfNeeded();
</span><del>- return sourceBuffer.releaseNonNull();
</del><ins>+ return sourceBuffer;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SourceBuffer::SourceBuffer(Ref<SourceBufferPrivate>&& sourceBufferPrivate, MediaSource* source)
</span><span class="lines">@@ -121,7 +106,6 @@
</span><span class="cx"> , m_private(WTFMove(sourceBufferPrivate))
</span><span class="cx"> , m_source(source)
</span><span class="cx"> , m_asyncEventQueue(*this)
</span><del>- , m_mode(segmentsKeyword())
</del><span class="cx"> , m_appendBufferTimer(*this, &SourceBuffer::appendBufferTimerFired)
</span><span class="cx"> , m_appendWindowStart(MediaTime::zeroTime())
</span><span class="cx"> , m_appendWindowEnd(MediaTime::positiveInfiniteTime())
</span><span class="lines">@@ -130,17 +114,9 @@
</span><span class="cx"> , m_buffered(TimeRanges::create())
</span><span class="cx"> , m_appendState(WaitingForSegment)
</span><span class="cx"> , m_timeOfBufferingMonitor(monotonicallyIncreasingTime())
</span><del>- , m_bufferedSinceLastMonitor(0)
- , m_averageBufferRate(0)
- , m_reportedExtraMemoryCost(0)
</del><span class="cx"> , m_pendingRemoveStart(MediaTime::invalidTime())
</span><span class="cx"> , m_pendingRemoveEnd(MediaTime::invalidTime())
</span><span class="cx"> , m_removeTimer(*this, &SourceBuffer::removeTimerFired)
</span><del>- , m_updating(false)
- , m_receivedFirstInitializationSegment(false)
- , m_active(false)
- , m_bufferFull(false)
- , m_shouldGenerateTimestamps(false)
</del><span class="cx"> {
</span><span class="cx"> ASSERT(m_source);
</span><span class="cx">
</span><span class="lines">@@ -206,7 +182,7 @@
</span><span class="cx"> MediaTime newTimestampOffset = MediaTime::createWithDouble(offset);
</span><span class="cx">
</span><span class="cx"> // 6. If the mode attribute equals "sequence", then set the group start timestamp to new timestamp offset.
</span><del>- if (m_mode == sequenceKeyword())
</del><ins>+ if (m_mode == AppendMode::Sequence)
</ins><span class="cx"> m_groupStartTimestamp = newTimestampOffset;
</span><span class="cx">
</span><span class="cx"> // 7. Update the attribute to the new value.
</span><span class="lines">@@ -672,7 +648,7 @@
</span><span class="cx"> LOG(MediaSource, "SourceBuffer::sourceBufferPrivateDidReceiveRenderingError(%p) - result = %i", this, error);
</span><span class="cx">
</span><span class="cx"> if (!isRemoved())
</span><del>- m_source->streamEndedWithError(decodeError(), IgnorableExceptionCode());
</del><ins>+ m_source->streamEndedWithError(EndOfStreamError::Decode);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static bool decodeTimeComparator(const PresentationOrderSampleMap::MapType::value_type& a, const PresentationOrderSampleMap::MapType::value_type& b)
</span><span class="lines">@@ -926,18 +902,6 @@
</span><span class="cx"> return element->maximumSourceBufferSize(*this);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const AtomicString& SourceBuffer::decodeError()
-{
- static NeverDestroyed<AtomicString> decode("decode", AtomicString::ConstructFromLiteral);
- return decode;
-}
-
-const AtomicString& SourceBuffer::networkError()
-{
- static NeverDestroyed<AtomicString> network("network", AtomicString::ConstructFromLiteral);
- return network;
-}
-
</del><span class="cx"> VideoTrackList* SourceBuffer::videoTracks()
</span><span class="cx"> {
</span><span class="cx"> if (!m_source || !m_source->mediaElement())
</span><span class="lines">@@ -979,17 +943,9 @@
</span><span class="cx"> m_active = active;
</span><span class="cx"> m_private->setActive(active);
</span><span class="cx"> if (!isRemoved())
</span><del>- m_source->sourceBufferDidChangeAcitveState(this, active);
</del><ins>+ m_source->sourceBufferDidChangeActiveState(*this, active);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void SourceBuffer::sourceBufferPrivateDidEndStream(SourceBufferPrivate*, const WTF::AtomicString& error)
-{
- LOG(MediaSource, "SourceBuffer::sourceBufferPrivateDidEndStream(%p) - result = %s", this, String(error).utf8().data());
-
- if (!isRemoved())
- m_source->streamEndedWithError(error, IgnorableExceptionCode());
-}
-
</del><span class="cx"> void SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment(SourceBufferPrivate*, const InitializationSegment& segment)
</span><span class="cx"> {
</span><span class="cx"> if (isRemoved())
</span><span class="lines">@@ -1319,7 +1275,7 @@
</span><span class="cx">
</span><span class="cx"> // 5. If decode error is true, then run the end of stream algorithm with the error parameter set to "decode".
</span><span class="cx"> if (decodeErrorParam)
</span><del>- m_source->streamEndedWithError(decodeError(), IgnorableExceptionCode());
</del><ins>+ m_source->streamEndedWithError(EndOfStreamError::Decode);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, PassRefPtr<MediaSample> prpSample)
</span><span class="lines">@@ -1374,7 +1330,7 @@
</span><span class="cx"> MediaTime frameDuration = sample->duration();
</span><span class="cx">
</span><span class="cx"> // 1.3 If mode equals "sequence" and group start timestamp is set, then run the following steps:
</span><del>- if (m_mode == sequenceKeyword() && m_groupStartTimestamp.isValid()) {
</del><ins>+ if (m_mode == AppendMode::Sequence && m_groupStartTimestamp.isValid()) {
</ins><span class="cx"> // 1.3.1 Set timestampOffset equal to group start timestamp - presentation timestamp.
</span><span class="cx"> m_timestampOffset = m_groupStartTimestamp;
</span><span class="cx">
</span><span class="lines">@@ -1414,11 +1370,11 @@
</span><span class="cx"> || abs(decodeTimestamp - trackBuffer.lastDecodeTimestamp) > (trackBuffer.lastFrameDuration * 2))) {
</span><span class="cx">
</span><span class="cx"> // 1.6.1:
</span><del>- if (m_mode == segmentsKeyword()) {
</del><ins>+ if (m_mode == AppendMode::Segments) {
</ins><span class="cx"> // ↳ If mode equals "segments":
</span><span class="cx"> // Set group end timestamp to presentation timestamp.
</span><span class="cx"> m_groupEndTimestamp = presentationTimestamp;
</span><del>- } else if (m_mode == sequenceKeyword()) {
</del><ins>+ } else {
</ins><span class="cx"> // ↳ If mode equals "sequence":
</span><span class="cx"> // Set group start timestamp equal to the group end timestamp.
</span><span class="cx"> m_groupStartTimestamp = m_groupEndTimestamp;
</span><span class="lines">@@ -1439,7 +1395,7 @@
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (m_mode == sequenceKeyword()) {
</del><ins>+ if (m_mode == AppendMode::Sequence) {
</ins><span class="cx"> // Use the generated timestamps instead of the sample's timestamps.
</span><span class="cx"> sample->setTimestamps(presentationTimestamp, decodeTimestamp);
</span><span class="cx"> } else if (m_timestampOffset) {
</span><span class="lines">@@ -1470,7 +1426,7 @@
</span><span class="cx"> MediaTime presentationStartTime = MediaTime::zeroTime();
</span><span class="cx"> if (presentationTimestamp < presentationStartTime) {
</span><span class="cx"> LOG(MediaSource, "SourceBuffer::sourceBufferPrivateDidReceiveSample(%p) - failing because presentationTimestamp < presentationStartTime", this);
</span><del>- m_source->streamEndedWithError(decodeError(), IgnorableExceptionCode());
</del><ins>+ m_source->streamEndedWithError(EndOfStreamError::Decode);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2022,7 +1978,7 @@
</span><span class="cx"> return downcast<Document>(*scriptExecutionContext());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SourceBuffer::setMode(const AtomicString& newMode, ExceptionCode& ec)
</del><ins>+void SourceBuffer::setMode(AppendMode newMode, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> // 3.1 Attributes - mode
</span><span class="cx"> // http://www.w3.org/TR/media-source/#widl-SourceBuffer-mode
</span><span class="lines">@@ -2031,7 +1987,7 @@
</span><span class="cx">
</span><span class="cx"> // 1. Let new mode equal the new value being assigned to this attribute.
</span><span class="cx"> // 2. If generate timestamps flag equals true and new mode equals "segments", then throw an INVALID_ACCESS_ERR exception and abort these steps.
</span><del>- if (m_shouldGenerateTimestamps && newMode == segmentsKeyword()) {
</del><ins>+ if (m_shouldGenerateTimestamps && newMode == AppendMode::Segments) {
</ins><span class="cx"> ec = INVALID_ACCESS_ERR;
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -2057,7 +2013,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 7. If the new mode equals "sequence", then set the group start timestamp to the group end timestamp.
</span><del>- if (newMode == sequenceKeyword())
</del><ins>+ if (newMode == AppendMode::Sequence)
</ins><span class="cx"> m_groupStartTimestamp = m_groupEndTimestamp;
</span><span class="cx">
</span><span class="cx"> // 8. Update the attribute to new mode.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -29,8 +29,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SourceBuffer_h
-#define SourceBuffer_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx">
</span><span class="lines">@@ -59,13 +58,14 @@
</span><span class="cx"> class TimeRanges;
</span><span class="cx"> class VideoTrackList;
</span><span class="cx">
</span><ins>+enum class EndOfStreamError;
+
+enum class AppendMode { Segments, Sequence };
+
</ins><span class="cx"> class SourceBuffer final : public RefCounted<SourceBuffer>, public ActiveDOMObject, public EventTargetWithInlineData, public SourceBufferPrivateClient, public AudioTrackClient, public VideoTrackClient, public TextTrackClient {
</span><span class="cx"> public:
</span><span class="cx"> static Ref<SourceBuffer> create(Ref<SourceBufferPrivate>&&, MediaSource*);
</span><span class="cx">
</span><del>- static const AtomicString& segmentsKeyword();
- static const AtomicString& sequenceKeyword();
-
</del><span class="cx"> virtual ~SourceBuffer();
</span><span class="cx">
</span><span class="cx"> // SourceBuffer.idl methods
</span><span class="lines">@@ -117,8 +117,8 @@
</span><span class="cx">
</span><span class="cx"> Document& document() const;
</span><span class="cx">
</span><del>- const AtomicString& mode() const { return m_mode; }
- void setMode(const AtomicString&, ExceptionCode&);
</del><ins>+ AppendMode mode() const { return m_mode; }
+ void setMode(AppendMode, ExceptionCode&);
</ins><span class="cx">
</span><span class="cx"> bool shouldGenerateTimestamps() const { return m_shouldGenerateTimestamps; }
</span><span class="cx"> void setShouldGenerateTimestamps(bool flag) { m_shouldGenerateTimestamps = flag; }
</span><span class="lines">@@ -145,7 +145,6 @@
</span><span class="cx"> bool canSuspendForDocumentSuspension() const override;
</span><span class="cx">
</span><span class="cx"> // SourceBufferPrivateClient
</span><del>- void sourceBufferPrivateDidEndStream(SourceBufferPrivate*, const WTF::AtomicString&) override;
</del><span class="cx"> void sourceBufferPrivateDidReceiveInitializationSegment(SourceBufferPrivate*, const InitializationSegment&) override;
</span><span class="cx"> void sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, PassRefPtr<MediaSample>) override;
</span><span class="cx"> bool sourceBufferPrivateHasAudio(const SourceBufferPrivate*) const override;
</span><span class="lines">@@ -169,9 +168,6 @@
</span><span class="cx"> void textTrackAddCue(TextTrack*, PassRefPtr<TextTrackCue>) override;
</span><span class="cx"> void textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue>) override;
</span><span class="cx">
</span><del>- static const WTF::AtomicString& decodeError();
- static const WTF::AtomicString& networkError();
-
</del><span class="cx"> bool isRemoved() const;
</span><span class="cx"> void scheduleEvent(const AtomicString& eventName);
</span><span class="cx">
</span><span class="lines">@@ -206,7 +202,7 @@
</span><span class="cx"> Ref<SourceBufferPrivate> m_private;
</span><span class="cx"> MediaSource* m_source;
</span><span class="cx"> GenericEventQueue m_asyncEventQueue;
</span><del>- AtomicString m_mode;
</del><ins>+ AppendMode m_mode { AppendMode::Segments };
</ins><span class="cx">
</span><span class="cx"> Vector<unsigned char> m_pendingAppendData;
</span><span class="cx"> Timer m_appendBufferTimer;
</span><span class="lines">@@ -234,24 +230,22 @@
</span><span class="cx"> AppendStateType m_appendState;
</span><span class="cx">
</span><span class="cx"> double m_timeOfBufferingMonitor;
</span><del>- double m_bufferedSinceLastMonitor;
- double m_averageBufferRate;
</del><ins>+ double m_bufferedSinceLastMonitor { 0 };
+ double m_averageBufferRate { 0 };
</ins><span class="cx">
</span><del>- size_t m_reportedExtraMemoryCost;
</del><ins>+ size_t m_reportedExtraMemoryCost { 0 };
</ins><span class="cx">
</span><span class="cx"> MediaTime m_pendingRemoveStart;
</span><span class="cx"> MediaTime m_pendingRemoveEnd;
</span><span class="cx"> Timer m_removeTimer;
</span><span class="cx">
</span><del>- bool m_updating;
- bool m_receivedFirstInitializationSegment;
- bool m_active;
- bool m_bufferFull;
- bool m_shouldGenerateTimestamps;
</del><ins>+ bool m_updating { false };
+ bool m_receivedFirstInitializationSegment { false };
+ bool m_active { false };
+ bool m_bufferFull { false };
+ bool m_shouldGenerateTimestamps { false };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDeviceInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -28,18 +28,9 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx">
</span><del>-#include "ContextDestructionObserver.h"
-#include "ScriptWrappable.h"
-#include <wtf/NeverDestroyed.h>
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-Ref<MediaDeviceInfo> MediaDeviceInfo::create(ScriptExecutionContext* context, const String& label, const String& deviceId, const String& groupId, const String& kind)
-{
- return adoptRef(*new MediaDeviceInfo(context, label, deviceId, groupId, kind));
-}
-
-MediaDeviceInfo::MediaDeviceInfo(ScriptExecutionContext* context, const String& label, const String& deviceId, const String& groupId, const String& kind)
</del><ins>+inline MediaDeviceInfo::MediaDeviceInfo(ScriptExecutionContext* context, const String& label, const String& deviceId, const String& groupId, MediaDeviceKind kind)
</ins><span class="cx"> : ContextDestructionObserver(context)
</span><span class="cx"> , m_label(label)
</span><span class="cx"> , m_deviceId(deviceId)
</span><span class="lines">@@ -48,24 +39,11 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const AtomicString& MediaDeviceInfo::audioInputType()
</del><ins>+Ref<MediaDeviceInfo> MediaDeviceInfo::create(ScriptExecutionContext* context, const String& label, const String& deviceId, const String& groupId, MediaDeviceKind kind)
</ins><span class="cx"> {
</span><del>- static NeverDestroyed<AtomicString> audioinput("audioinput");
- return audioinput;
</del><ins>+ return adoptRef(*new MediaDeviceInfo(context, label, deviceId, groupId, kind));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-const AtomicString& MediaDeviceInfo::audioOutputType()
-{
- static NeverDestroyed<AtomicString> audiooutput("audiooutput");
- return audiooutput;
-}
-
-const AtomicString& MediaDeviceInfo::videoInputType()
-{
- static NeverDestroyed<AtomicString> videoinput("videoinput");
- return videoinput;
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDeviceInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -23,40 +23,34 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef MediaDeviceInfo_h
-#define MediaDeviceInfo_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx">
</span><span class="cx"> #include "ContextDestructionObserver.h"
</span><span class="cx"> #include "ScriptWrappable.h"
</span><del>-#include <wtf/RefCounted.h>
</del><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class MediaDeviceInfo : public RefCounted<MediaDeviceInfo>, public ScriptWrappable, public ContextDestructionObserver {
</del><ins>+enum class MediaDeviceKind { Audioinput, Audiooutput, Videoinput };
+
+class MediaDeviceInfo : public RefCounted<MediaDeviceInfo>, public ScriptWrappable, private ContextDestructionObserver {
</ins><span class="cx"> public:
</span><del>- static Ref<MediaDeviceInfo> create(ScriptExecutionContext*, const String&, const String&, const String&, const String&);
</del><ins>+ static Ref<MediaDeviceInfo> create(ScriptExecutionContext*, const String&, const String&, const String&, MediaDeviceKind);
</ins><span class="cx">
</span><del>- virtual ~MediaDeviceInfo() { }
-
</del><span class="cx"> const String& label() const { return m_label; }
</span><span class="cx"> const String& deviceId() const { return m_deviceId; }
</span><span class="cx"> const String& groupId() const { return m_groupId; }
</span><del>- const String& kind() const { return m_kind; }
</del><ins>+ MediaDeviceKind kind() const { return m_kind; }
</ins><span class="cx">
</span><del>- static const AtomicString& audioInputType();
- static const AtomicString& audioOutputType();
- static const AtomicString& videoInputType();
-
</del><span class="cx"> private:
</span><del>- MediaDeviceInfo(ScriptExecutionContext*, const String&, const String&, const String&, const String&);
</del><ins>+ MediaDeviceInfo(ScriptExecutionContext*, const String&, const String&, const String&, MediaDeviceKind);
</ins><span class="cx">
</span><span class="cx"> const String m_label;
</span><span class="cx"> const String m_deviceId;
</span><span class="cx"> const String m_groupId;
</span><del>- const String m_kind;
</del><ins>+ const MediaDeviceKind m_kind;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> typedef Vector<RefPtr<MediaDeviceInfo>> MediaDeviceInfoVector;
</span><span class="lines">@@ -64,5 +58,3 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span><del>-
-#endif /* MediaDeviceInfo_h */
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDeviceInfoidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.idl (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.idl        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDeviceInfo.idl        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -24,19 +24,19 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> [
</span><del>-NoInterfaceObject,
-Conditional=MEDIA_STREAM,
-Constructor(DOMString deviceId, DOMString label, DOMString groupId, MediaDeviceKind kind),
-JSGenerateToJSObject,
</del><ins>+ Conditional=MEDIA_STREAM,
+ Constructor(DOMString deviceId, DOMString label, DOMString groupId, MediaDeviceKind kind),
+ JSGenerateToJSObject,
+ NoInterfaceObject,
</ins><span class="cx"> ] interface MediaDeviceInfo {
</span><del>- readonly attribute DOMString deviceId;
- readonly attribute DOMString groupId;
- readonly attribute DOMString kind;
- readonly attribute DOMString label;
</del><ins>+ readonly attribute DOMString deviceId;
+ readonly attribute DOMString groupId;
+ readonly attribute MediaDeviceKind kind;
+ readonly attribute DOMString label;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> enum MediaDeviceKind {
</span><span class="cx"> "audioinput",
</span><span class="cx"> "audiooutput",
</span><span class="cx"> "videoinput"
</span><del>-};
</del><span class="cx">\ No newline at end of file
</span><ins>+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaDevicesRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediastream/MediaDevicesRequest.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -144,9 +144,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Vector<RefPtr<MediaDeviceInfo>> devices;
</span><del>- for (auto deviceInfo : captureDevices) {
- String deviceType = deviceInfo->kind() == TrackSourceInfo::SourceKind::Audio ? MediaDeviceInfo::audioInputType() : MediaDeviceInfo::videoInputType();
- AtomicString label = emptyAtom;
</del><ins>+ for (auto& deviceInfo : captureDevices) {
+ String label = emptyString();
</ins><span class="cx"> if (m_havePersistentPermission || document.hasHadActiveMediaStreamTrack())
</span><span class="cx"> label = deviceInfo->label();
</span><span class="cx">
</span><span class="lines">@@ -156,6 +155,8 @@
</span><span class="cx">
</span><span class="cx"> String groupId = hashID(deviceInfo->groupId());
</span><span class="cx">
</span><ins>+ auto deviceType = deviceInfo->kind() == TrackSourceInfo::SourceKind::Audio ? MediaDeviceKind::Audioinput : MediaDeviceKind::Videoinput;
+
</ins><span class="cx"> devices.append(MediaDeviceInfo::create(scriptExecutionContext(), label, id, groupId, deviceType));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -164,7 +165,6 @@
</span><span class="cx"> protectedThis->m_promise.resolve(devices);
</span><span class="cx"> });
</span><span class="cx"> m_protector = nullptr;
</span><del>-
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const String& MediaDevicesRequest::requestOrigin() const
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaStreamTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -111,12 +111,9 @@
</span><span class="cx"> return m_private->remote();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const AtomicString& MediaStreamTrack::readyState() const
</del><ins>+MediaStreamTrackState MediaStreamTrack::readyState() const
</ins><span class="cx"> {
</span><del>- static NeverDestroyed<AtomicString> endedState("ended", AtomicString::ConstructFromLiteral);
- static NeverDestroyed<AtomicString> liveState("live", AtomicString::ConstructFromLiteral);
-
- return ended() ? endedState : liveState;
</del><ins>+ return ended() ? MediaStreamTrackState::Ended : MediaStreamTrackState::Live;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool MediaStreamTrack::ended() const
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaStreamTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -25,8 +25,7 @@
</span><span class="cx"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef MediaStreamTrack_h
-#define MediaStreamTrack_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx">
</span><span class="lines">@@ -35,7 +34,6 @@
</span><span class="cx"> #include "MediaStreamTrackPrivate.h"
</span><span class="cx"> #include "RealtimeMediaSource.h"
</span><span class="cx"> #include "ScriptWrappable.h"
</span><del>-#include <wtf/RefCounted.h>
</del><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="lines">@@ -48,7 +46,9 @@
</span><span class="cx"> class MediaSourceSettings;
</span><span class="cx"> class MediaTrackConstraints;
</span><span class="cx">
</span><del>-class MediaStreamTrack final : public RefCounted<MediaStreamTrack>, public ActiveDOMObject, public EventTargetWithInlineData, public MediaStreamTrackPrivate::Observer {
</del><ins>+enum class MediaStreamTrackState { New, Live, Ended };
+
+class MediaStreamTrack final : public RefCounted<MediaStreamTrack>, public ActiveDOMObject, public EventTargetWithInlineData, private MediaStreamTrackPrivate::Observer {
</ins><span class="cx"> public:
</span><span class="cx"> class Observer {
</span><span class="cx"> public:
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> bool readonly() const;
</span><span class="cx"> bool remote() const;
</span><span class="cx">
</span><del>- const AtomicString& readyState() const;
</del><ins>+ MediaStreamTrackState readyState() const;
</ins><span class="cx">
</span><span class="cx"> bool ended() const;
</span><span class="cx">
</span><span class="lines">@@ -132,5 +132,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(MEDIA_STREAM)
</span><del>-
-#endif // MediaStreamTrack_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -309,28 +309,6 @@
</span><span class="cx"> promise.resolve(nullptr);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const AtomicString& AudioContext::state() const
-{
- static NeverDestroyed<AtomicString> suspended("suspended");
- static NeverDestroyed<AtomicString> running("running");
- static NeverDestroyed<AtomicString> interrupted("interrupted");
- static NeverDestroyed<AtomicString> closed("closed");
-
- switch (m_state) {
- case State::Suspended:
- return suspended;
- case State::Running:
- return running;
- case State::Interrupted:
- return interrupted;
- case State::Closed:
- return closed;
- }
-
- ASSERT_NOT_REACHED();
- return suspended;
-}
-
</del><span class="cx"> void AudioContext::stop()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioContext.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef AudioContext_h
-#define AudioContext_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "ActiveDOMObject.h"
</span><span class="cx"> #include "AsyncAudioDecoder.h"
</span><span class="lines">@@ -39,7 +38,6 @@
</span><span class="cx"> #include <atomic>
</span><span class="cx"> #include <wtf/HashSet.h>
</span><span class="cx"> #include <wtf/MainThread.h>
</span><del>-#include <wtf/RefCounted.h>
</del><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="cx"> #include <wtf/ThreadSafeRefCounted.h>
</span><span class="cx"> #include <wtf/Threading.h>
</span><span class="lines">@@ -48,32 +46,33 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class AnalyserNode;
</ins><span class="cx"> class AudioBuffer;
</span><span class="cx"> class AudioBufferCallback;
</span><span class="cx"> class AudioBufferSourceNode;
</span><del>-class MediaElementAudioSourceNode;
-class MediaStreamAudioDestinationNode;
-class MediaStreamAudioSourceNode;
-class HRTFDatabaseLoader;
-class HTMLMediaElement;
-class ChannelMergerNode;
-class ChannelSplitterNode;
-class GainNode;
-class GenericEventQueue;
-class PannerNode;
</del><span class="cx"> class AudioListener;
</span><span class="cx"> class AudioSummingJunction;
</span><span class="cx"> class BiquadFilterNode;
</span><ins>+class ChannelMergerNode;
+class ChannelSplitterNode;
+class ConvolverNode;
</ins><span class="cx"> class DelayNode;
</span><span class="cx"> class Document;
</span><del>-class ConvolverNode;
</del><span class="cx"> class DynamicsCompressorNode;
</span><del>-class AnalyserNode;
-class WaveShaperNode;
-class ScriptProcessorNode;
</del><ins>+class GainNode;
+class GenericEventQueue;
+class HTMLMediaElement;
+class MediaElementAudioSourceNode;
+class MediaStreamAudioDestinationNode;
+class MediaStreamAudioSourceNode;
</ins><span class="cx"> class OscillatorNode;
</span><ins>+class PannerNode;
</ins><span class="cx"> class PeriodicWave;
</span><ins>+class ScriptProcessorNode;
+class WaveShaperNode;
</ins><span class="cx">
</span><ins>+enum class AudioContextState { Suspended, Running, Interrupted, Closed };
+
</ins><span class="cx"> // AudioContext is the cornerstone of the web audio API and all AudioNodes are created from it.
</span><span class="cx"> // For thread safety between the audio thread and the main thread, it has a rendering graph locking mechanism.
</span><span class="cx">
</span><span class="lines">@@ -118,7 +117,8 @@
</span><span class="cx"> void resume(Promise&&);
</span><span class="cx"> void close(Promise&&);
</span><span class="cx">
</span><del>- const AtomicString& state() const;
</del><ins>+ using State = AudioContextState;
+ State state() const;
</ins><span class="cx">
</span><span class="cx"> // The AudioNode create methods are called on the main thread (from JavaScript).
</span><span class="cx"> Ref<AudioBufferSourceNode> createBufferSource();
</span><span class="lines">@@ -239,8 +239,8 @@
</span><span class="cx"> ScriptExecutionContext* scriptExecutionContext() const final;
</span><span class="cx">
</span><span class="cx"> // Reconcile ref/deref which are defined both in ThreadSafeRefCounted and EventTarget.
</span><del>- using ThreadSafeRefCounted<AudioContext>::ref;
- using ThreadSafeRefCounted<AudioContext>::deref;
</del><ins>+ using ThreadSafeRefCounted::ref;
+ using ThreadSafeRefCounted::deref;
</ins><span class="cx">
</span><span class="cx"> void startRendering();
</span><span class="cx"> void fireCompletionEvent();
</span><span class="lines">@@ -281,7 +281,6 @@
</span><span class="cx"> bool userGestureRequiredForAudioStart() const { return m_restrictions & RequireUserGestureForAudioStartRestriction; }
</span><span class="cx"> bool pageConsentRequiredForAudioStart() const { return m_restrictions & RequirePageConsentForAudioStartRestriction; }
</span><span class="cx">
</span><del>- enum class State { Suspended, Running, Interrupted, Closed };
</del><span class="cx"> void setState(State);
</span><span class="cx">
</span><span class="cx"> void clear();
</span><span class="lines">@@ -394,14 +393,21 @@
</span><span class="cx"> State m_state { State::Suspended };
</span><span class="cx"> };
</span><span class="cx">
</span><del>-inline bool operator==(const AudioContext& lhs, const AudioContext& rhs) {
</del><ins>+// FIXME: Find out why these ==/!= functions are needed and remove them if possible.
+
+inline bool operator==(const AudioContext& lhs, const AudioContext& rhs)
+{
</ins><span class="cx"> return &lhs == &rhs;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline bool operator!=(const AudioContext& lhs, const AudioContext& rhs) {
</del><ins>+inline bool operator!=(const AudioContext& lhs, const AudioContext& rhs)
+{
</ins><span class="cx"> return &lhs != &rhs;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+inline AudioContextState AudioContext::state() const
+{
+ return m_state;
+}
+
</ins><span class="cx"> } // WebCore
</span><del>-
-#endif // AudioContext_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioWaveShaperNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "WaveShaperNode.h"
</span><span class="cx">
</span><ins>+#include "AudioContext.h"
</ins><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include <wtf/MainThread.h>
</span><span class="cx">
</span><span class="lines">@@ -53,36 +54,41 @@
</span><span class="cx"> return waveShaperProcessor()->curve();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WaveShaperNode::setOversample(const String& type, ExceptionCode& ec)
</del><ins>+static inline WaveShaperProcessor::OverSampleType processorType(OverSampleType type)
</ins><span class="cx"> {
</span><ins>+ switch (type) {
+ case OverSampleType::None:
+ return WaveShaperProcessor::OverSampleNone;
+ case OverSampleType::_2x:
+ return WaveShaperProcessor::OverSample2x;
+ case OverSampleType::_4x:
+ return WaveShaperProcessor::OverSample4x;
+ }
+ ASSERT_NOT_REACHED();
+ return WaveShaperProcessor::OverSampleNone;
+}
+
+void WaveShaperNode::setOversample(OverSampleType type)
+{
</ins><span class="cx"> ASSERT(isMainThread());
</span><span class="cx">
</span><span class="cx"> // Synchronize with any graph changes or changes to channel configuration.
</span><span class="cx"> AudioContext::AutoLocker contextLocker(context());
</span><del>-
- if (type == "none")
- waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSampleNone);
- else if (type == "2x")
- waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample2x);
- else if (type == "4x")
- waveShaperProcessor()->setOversample(WaveShaperProcessor::OverSample4x);
- else
- ec = INVALID_STATE_ERR;
</del><ins>+ waveShaperProcessor()->setOversample(processorType(type));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-String WaveShaperNode::oversample() const
</del><ins>+OverSampleType WaveShaperNode::oversample() const
</ins><span class="cx"> {
</span><span class="cx"> switch (const_cast<WaveShaperNode*>(this)->waveShaperProcessor()->oversample()) {
</span><span class="cx"> case WaveShaperProcessor::OverSampleNone:
</span><del>- return "none";
</del><ins>+ return OverSampleType::None;
</ins><span class="cx"> case WaveShaperProcessor::OverSample2x:
</span><del>- return "2x";
</del><ins>+ return OverSampleType::_2x;
</ins><span class="cx"> case WaveShaperProcessor::OverSample4x:
</span><del>- return "4x";
- default:
- ASSERT_NOT_REACHED();
- return "none";
</del><ins>+ return OverSampleType::_4x;
</ins><span class="cx"> }
</span><ins>+ ASSERT_NOT_REACHED();
+ return OverSampleType::None;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioWaveShaperNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -22,17 +22,17 @@
</span><span class="cx"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef WaveShaperNode_h
-#define WaveShaperNode_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "AudioBasicProcessorNode.h"
</span><del>-#include "BiquadProcessor.h"
</del><span class="cx"> #include "WaveShaperProcessor.h"
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><del>-
-class WaveShaperNode : public AudioBasicProcessorNode {
</del><ins>+
+enum class OverSampleType { None, _2x, _4x };
+
+class WaveShaperNode final : public AudioBasicProcessorNode {
</ins><span class="cx"> public:
</span><span class="cx"> static Ref<WaveShaperNode> create(AudioContext& context)
</span><span class="cx"> {
</span><span class="lines">@@ -43,8 +43,8 @@
</span><span class="cx"> void setCurve(Float32Array*);
</span><span class="cx"> Float32Array* curve();
</span><span class="cx">
</span><del>- void setOversample(const String& , ExceptionCode&);
- String oversample() const;
</del><ins>+ void setOversample(OverSampleType);
+ OverSampleType oversample() const;
</ins><span class="cx">
</span><span class="cx"> double latency() const { return latencyTime(); }
</span><span class="cx">
</span><span class="lines">@@ -55,5 +55,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // WaveShaperNode_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioWaveShaperNodeidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/Modules/webaudio/WaveShaperNode.idl        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -33,5 +33,5 @@
</span><span class="cx"> JSGenerateToJSObject
</span><span class="cx"> ] interface WaveShaperNode : AudioNode {
</span><span class="cx"> attribute Float32Array curve;
</span><del>- [SetterRaisesException] attribute OverSampleType oversample;
</del><ins>+ attribute OverSampleType oversample;
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -120,26 +120,10 @@
</span><span class="cx"> # enumeration to using an actual enum class in the C++. Once that is done, we should
</span><span class="cx"> # remove this hash and the function that calls it.
</span><span class="cx"> my %stringBasedEnumerationHash = (
</span><del>- "AppendMode" => 1,
- "AudioContextState" => 1,
</del><span class="cx"> "AutoFillButtonType" => 1,
</span><span class="cx"> "CachePolicy" => 1,
</span><del>- "CanvasWindingRule" => 1,
- "DeviceType" => 1,
- "EndOfStreamError" => 1,
- "FontFaceSetLoadStatus" => 1,
- "IDBCursorDirection" => 1,
- "IDBRequestReadyState" => 1,
- "IDBTransactionMode" => 1,
- "ImageSmoothingQuality" => 1,
- "KeyType" => 1,
- "KeyUsage" => 1,
</del><span class="cx"> "MediaControlEvent" => 1,
</span><del>- "MediaDeviceKind" => 1,
</del><span class="cx"> "MediaSessionInterruptingCategory" => 1,
</span><del>- "MediaSessionKind" => 1,
- "MediaStreamTrackState" => 1,
- "OverSampleType" => 1,
</del><span class="cx"> "PageOverlayType" => 1,
</span><span class="cx"> "RTCBundlePolicyEnum" => 1,
</span><span class="cx"> "RTCIceTransportPolicyEnum" => 1,
</span><span class="lines">@@ -151,10 +135,8 @@
</span><span class="cx"> "RequestRedirect" => 1,
</span><span class="cx"> "RequestType" => 1,
</span><span class="cx"> "ResourceLoadPriority" => 1,
</span><del>- "ResponseType" => 1,
</del><span class="cx"> "TextTrackKind" => 1,
</span><span class="cx"> "TextTrackMode" => 1,
</span><del>- "VideoPresentationMode" => 1,
</del><span class="cx"> "XMLHttpRequestResponseType" => 1,
</span><span class="cx"> );
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -442,9 +442,7 @@
</span><span class="cx"> @headerContentHeader = split("\r", $headerTemplate);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- # - Add header protection
- push(@headerContentHeader, "\n#ifndef $className" . "_h");
- push(@headerContentHeader, "\n#define $className" . "_h\n\n");
</del><ins>+ push(@headerContentHeader, "\n#pragma once\n\n");
</ins><span class="cx">
</span><span class="cx"> my $conditionalString = $codeGenerator->GenerateConditionalString($interface);
</span><span class="cx"> push(@headerContentHeader, "#if ${conditionalString}\n\n") if $conditionalString;
</span><span class="lines">@@ -839,13 +837,18 @@
</span><span class="cx"> sub GetEnumerationValueName {
</span><span class="cx"> my ($name) = @_;
</span><span class="cx"> return "EmptyString" if $name eq "";
</span><del>- return $codeGenerator->WK_ucfirst($name);
</del><ins>+ $name = join("", map { $codeGenerator->WK_ucfirst($_) } split("-", $name));
+ $name = "_$name" if $name =~ /^\d/;
+ return $name;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> sub GetEnumerationImplementationContent
</span><span class="cx"> {
</span><span class="cx"> my ($enumerations) = @_;
</span><span class="cx">
</span><ins>+ # FIXME: Could optimize this to only generate things that are used, which would require
+ # iterating over everything in the interface.
+
</ins><span class="cx"> my $result = "";
</span><span class="cx"> foreach my $enumeration (@$enumerations) {
</span><span class="cx"> my $name = $enumeration->name;
</span><span class="lines">@@ -853,12 +856,18 @@
</span><span class="cx">
</span><span class="cx"> my $className = GetEnumerationClassName($name);
</span><span class="cx">
</span><del>- # Declare these instead of using "static" because these functions may be unused
- # and we don't want to get warnings about unused static functions.
- $result .= "const String& stringValue($className);\n";
- $result .= "Optional<$className> enumerationValue$className(const String&);\n\n";
</del><ins>+ # FIXME: A little ugly to have this be a side effect instead of a return value.
+ AddToImplIncludes("<runtime/JSString.h>");
</ins><span class="cx">
</span><del>- $result .= "const String& stringValue($className enumerationValue)\n";
</del><ins>+ # Declare these instead of using "static" because these may be unused and we don't
+ # want to get warnings about them.
+ $result .= "JSString* jsStringWithCache(ExecState*, $className);\n";
+ $result .= "Optional<$className> parse$className(ExecState&, JSValue);\n";
+ $result .= "extern const char expectedEnumerationValues${className}[];\n\n";
+
+ # Take an ExecState* instead of an ExecState& to match the jsStringWithCache from JSString.h.
+ # FIXME: Change to take VM& instead of ExecState*.
+ $result .= "JSString* jsStringWithCache(ExecState* state, $className enumerationValue)\n";
</ins><span class="cx"> $result .= "{\n";
</span><span class="cx"> # FIXME: Might be nice to make this global be "const", but NeverDestroyed does not currently support that.
</span><span class="cx"> # FIXME: Might be nice to make the entire array be NeverDestroyed instead of each value, but not sure the syntax for that.
</span><span class="lines">@@ -870,27 +879,36 @@
</span><span class="cx"> my $index = 0;
</span><span class="cx"> foreach my $value (@{$enumeration->values}) {
</span><span class="cx"> my $enumerationValueName = GetEnumerationValueName($value);
</span><del>- if ($index) {
- $result .= " static_assert(static_cast<size_t>($className::$enumerationValueName) == $index, \"$className::$enumerationValueName is not $index as expected\");\n";
- } else {
- # Keep the style checker happy. Not sure I still love this style guideline.
- $result .= " static_assert(!static_cast<size_t>($className::$enumerationValueName), \"$className::$enumerationValueName is not $index as expected\");\n";
- }
</del><ins>+ $result .= " static_assert(static_cast<size_t>($className::$enumerationValueName) == $index, \"$className::$enumerationValueName is not $index as expected\");\n";
</ins><span class="cx"> $index++;
</span><span class="cx"> }
</span><span class="cx"> $result .= " ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));\n";
</span><del>- $result .= " return values[static_cast<size_t>(enumerationValue)];\n";
</del><ins>+ $result .= " return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);\n";
</ins><span class="cx"> $result .= "}\n\n";
</span><span class="cx">
</span><del>- $result .= "Optional<$className> enumerationValue$className(const String& stringValue)\n";
</del><ins>+ $result .= "template<> struct JSValueTraits<$className> {\n";
+ $result .= " static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, $className value) { return jsStringWithCache(state, value); }\n";
+ $result .= "};\n\n";
+
+ # FIXME: Change to take VM& instead of ExecState&.
+ # FIXME: Consider using toStringOrNull to make exception checking faster.
+ # FIXME: Consider finding a more efficient way to match against all the strings quickly.
+ $result .= "Optional<$className> parse$className(ExecState& state, JSValue value)\n";
</ins><span class="cx"> $result .= "{\n";
</span><ins>+ $result .= " auto stringValue = value.toWTFString(&state);\n";
</ins><span class="cx"> foreach my $value (@{$enumeration->values}) {
</span><span class="cx"> my $enumerationValueName = GetEnumerationValueName($value);
</span><del>- $result .= " if (stringValue == \"$value\")\n";
</del><ins>+ if ($value eq "") {
+ $result .= " if (stringValue.isEmpty())\n";
+ } else {
+ $result .= " if (stringValue == \"$value\")\n";
+ }
</ins><span class="cx"> $result .= " return $className::$enumerationValueName;\n";
</span><span class="cx"> }
</span><span class="cx"> $result .= " return Nullopt;\n";
</span><span class="cx"> $result .= "}\n\n";
</span><ins>+
+ $result .= "const char expectedEnumerationValues${className}[] = \"\\\"" . join ("\\\", \\\"", @{$enumeration->values}) . "\\\"\";\n\n";
</ins><span class="cx"> }
</span><span class="cx"> return $result;
</span><span class="cx"> }
</span><span class="lines">@@ -1399,11 +1417,11 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> my $conditionalString = $codeGenerator->GenerateConditionalString($interface);
</span><del>- push(@headerContent, "\n} // namespace WebCore\n\n");
- push(@headerContent, "#endif // ${conditionalString}\n\n") if $conditionalString;
- push(@headerContent, "#endif\n");
</del><ins>+ push(@headerContent, "\n} // namespace WebCore\n");
+ push(@headerContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
</ins><span class="cx">
</span><span class="cx"> if ($interface->extendedAttributes->{"AppleCopyright"}) {
</span><ins>+ push(@headerContent, "\n");
</ins><span class="cx"> push(@headerContent, split("\r", $endAppleCopyright));
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -2778,8 +2796,8 @@
</span><span class="cx"> push(@implContent, " $setter(*state, *castedThis, castedThis->wrapped(), $eventName, value);\n");
</span><span class="cx"> }
</span><span class="cx"> push(@implContent, " return true;\n");
</span><del>- } elsif ($attribute->signature->type =~ /Constructor$/) {
- my $constructorType = $attribute->signature->type;
</del><ins>+ } elsif ($type =~ /Constructor$/) {
+ my $constructorType = $type;
</ins><span class="cx"> $constructorType =~ s/Constructor$//;
</span><span class="cx"> # $constructorType ~= /Constructor$/ indicates that it is NamedConstructor.
</span><span class="cx"> # We do not generate the header file for NamedConstructor of class XXXX,
</span><span class="lines">@@ -2797,18 +2815,17 @@
</span><span class="cx"> my $putForwards = $attribute->signature->extendedAttributes->{"PutForwards"};
</span><span class="cx"> if ($putForwards) {
</span><span class="cx"> my $implGetterFunctionName = $codeGenerator->WK_lcfirst($attribute->signature->extendedAttributes->{"ImplementedAs"} || $name);
</span><del>- my $attributeType = $attribute->signature->type;
</del><span class="cx"> if ($attribute->signature->isNullable) {
</span><del>- push(@implContent, " RefPtr<${attributeType}> forwardedImpl = castedThis->wrapped().${implGetterFunctionName}();\n");
</del><ins>+ push(@implContent, " RefPtr<${type}> forwardedImpl = castedThis->wrapped().${implGetterFunctionName}();\n");
</ins><span class="cx"> push(@implContent, " if (!forwardedImpl)\n");
</span><span class="cx"> push(@implContent, " return false;\n");
</span><span class="cx"> push(@implContent, " auto& impl = *forwardedImpl;\n");
</span><span class="cx"> } else {
</span><span class="cx"> # Attribute is not nullable, the implementation is expected to return a reference.
</span><del>- push(@implContent, " Ref<${attributeType}> forwardedImpl = castedThis->wrapped().${implGetterFunctionName}();\n");
</del><ins>+ push(@implContent, " Ref<${type}> forwardedImpl = castedThis->wrapped().${implGetterFunctionName}();\n");
</ins><span class="cx"> push(@implContent, " auto& impl = forwardedImpl.get();\n");
</span><span class="cx"> }
</span><del>- $attribute = $codeGenerator->GetAttributeFromInterface($interface, $attribute->signature->type, $putForwards);
</del><ins>+ $attribute = $codeGenerator->GetAttributeFromInterface($interface, $type, $putForwards);
</ins><span class="cx"> } else {
</span><span class="cx"> push(@implContent, " auto& impl = castedThis->wrapped();\n");
</span><span class="cx"> }
</span><span class="lines">@@ -2827,10 +2844,9 @@
</span><span class="cx"> if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) {
</span><span class="cx"> $implIncludes{"<runtime/Error.h>"} = 1;
</span><span class="cx">
</span><del>- my $argType = $attribute->signature->type;
- if ($codeGenerator->IsWrapperType($argType)) {
- push(@implContent, " if (UNLIKELY(!value.isUndefinedOrNull() && !value.inherits(JS${argType}::info()))) {\n");
- push(@implContent, " throwAttributeTypeError(*state, \"$interfaceName\", \"$name\", \"$argType\");\n");
</del><ins>+ if ($codeGenerator->IsWrapperType($type)) {
+ push(@implContent, " if (UNLIKELY(!value.isUndefinedOrNull() && !value.inherits(JS${type}::info()))) {\n");
+ push(@implContent, " throwAttributeTypeError(*state, \"$interfaceName\", \"$name\", \"$type\");\n");
</ins><span class="cx"> push(@implContent, " return false;\n");
</span><span class="cx"> push(@implContent, " };\n");
</span><span class="cx"> }
</span><span class="lines">@@ -2840,7 +2856,7 @@
</span><span class="cx"> push(@implContent, " if (UNLIKELY(state->hadException()))\n");
</span><span class="cx"> push(@implContent, " return false;\n");
</span><span class="cx">
</span><del>- if ($codeGenerator->IsEnumType($type)) {
</del><ins>+ if ($codeGenerator->IsStringBasedEnumType($type)) {
</ins><span class="cx"> my @enumValues = $codeGenerator->ValidEnumValues($type);
</span><span class="cx"> my @enumChecks = ();
</span><span class="cx"> foreach my $enumValue (@enumValues) {
</span><span class="lines">@@ -2850,7 +2866,12 @@
</span><span class="cx"> push (@implContent, " return false;\n");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if ($attribute->signature->type eq "double" or $attribute->signature->type eq "float") {
</del><ins>+ if ($codeGenerator->IsEnumType($type)) {
+ push (@implContent, " if (UNLIKELY(!nativeValue))\n");
+ push (@implContent, " return false;\n");
+ }
+
+ if ($type eq "double" or $type eq "float") {
</ins><span class="cx"> push(@implContent, " if (UNLIKELY(!std::isfinite(nativeValue))) {\n");
</span><span class="cx"> push(@implContent, " throwVMTypeError(state);\n");
</span><span class="cx"> push(@implContent, " return false;\n");
</span><span class="lines">@@ -2888,8 +2909,10 @@
</span><span class="cx"> push(@implContent, " return true;\n");
</span><span class="cx"> } else {
</span><span class="cx"> my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute);
</span><del>- if ($codeGenerator->IsTypedArrayType($attribute->signature->type) and not $attribute->signature->type eq "ArrayBuffer") {
</del><ins>+ if ($codeGenerator->IsTypedArrayType($type) and not $type eq "ArrayBuffer") {
</ins><span class="cx"> push(@arguments, "nativeValue.get()");
</span><ins>+ } elsif ($codeGenerator->IsEnumType($type) and not $codeGenerator->IsStringBasedEnumType($type)) {
+ push(@arguments, "nativeValue.value()");
</ins><span class="cx"> } else {
</span><span class="cx"> push(@arguments, "nativeValue");
</span><span class="cx"> }
</span><span class="lines">@@ -3444,7 +3467,7 @@
</span><span class="cx"> # FIXME: We should progressively stop blacklisting each type below
</span><span class="cx"> # and eventually get rid of this function entirely.
</span><span class="cx"> return 0 if $parameter->isVariadic;
</span><del>- return 0 if $codeGenerator->IsEnumType($type);
</del><ins>+ return 0 if $codeGenerator->IsStringBasedEnumType($type);
</ins><span class="cx">
</span><span class="cx"> return 1;
</span><span class="cx"> }
</span><span class="lines">@@ -3638,7 +3661,7 @@
</span><span class="cx"> push(@$outputArray, " if (UNLIKELY(state->hadException()))\n");
</span><span class="cx"> push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
</span><span class="cx"> }
</span><del>- } elsif ($codeGenerator->IsEnumType($argType)) {
</del><ins>+ } elsif ($codeGenerator->IsStringBasedEnumType($argType)) {
</ins><span class="cx"> $implIncludes{"<runtime/Error.h>"} = 1;
</span><span class="cx">
</span><span class="cx"> my $exceptionCheck = sub {
</span><span class="lines">@@ -3681,6 +3704,42 @@
</span><span class="cx"> &$exceptionCheck("");
</span><span class="cx"> &$enumValueCheck("");
</span><span class="cx"> }
</span><ins>+ } elsif ($codeGenerator->IsEnumType($argType)) {
+ my $className = GetEnumerationClassName($argType);
+ $implIncludes{"<runtime/Error.h>"} = 1;
+
+ my $nativeType = $className;
+ my $optionalValue = "optionalValue";
+ my $defineOptionalValue = "auto optionalValue";
+ my $indent = "";
+
+ if ($parameter->isOptional && !defined($parameter->default)) {
+ $nativeType = "Optional<$className>";
+ $optionalValue = $name;
+ $defineOptionalValue = $name;
+ }
+
+ push(@$outputArray, " auto ${name}Value = state->argument($argsIndex);\n");
+ push(@$outputArray, " $nativeType $name;\n");
+
+ if ($parameter->isOptional) {
+ push(@$outputArray, " if (${name}Value.isUndefined()) {\n");
+ if (defined($parameter->default)) {
+ my $enumerationValueName = GetEnumerationValueName(substr($parameter->default, 1, -1));
+ push(@$outputArray, " $name = $className::$enumerationValueName;\n");
+ }
+ push(@$outputArray, " } else {\n");
+ $indent = " ";
+ }
+
+ push(@$outputArray, "$indent $defineOptionalValue = parse$className(*state, ${name}Value);\n");
+ push(@$outputArray, "$indent if (UNLIKELY(state->hadException()))\n");
+ push(@$outputArray, "$indent return JSValue::encode(jsUndefined());\n");
+ push(@$outputArray, "$indent if (UNLIKELY(!$optionalValue))\n");
+ push(@$outputArray, "$indent return throwArgumentMustBeEnumError(*state, $argsIndex, \"$name\", \"$interfaceName\", $quotedFunctionName, expectedEnumerationValues$className);\n");
+ push(@$outputArray, "$indent $name = optionalValue.value();\n") if $optionalValue ne $name;
+
+ push(@$outputArray, " }\n") if $indent ne "";
</ins><span class="cx"> } else {
</span><span class="cx"> # If the "StrictTypeChecking" extended attribute is present, and the argument's type is an
</span><span class="cx"> # interface type, then if the incoming value does not implement that interface, a TypeError
</span><span class="lines">@@ -3835,8 +3894,7 @@
</span><span class="cx"> push(@headerContent, "\n // Functions\n");
</span><span class="cx"> foreach my $function (@{$interface->functions}) {
</span><span class="cx"> my @params = @{$function->parameters};
</span><del>- if (!$function->signature->extendedAttributes->{"Custom"} &&
- !(GetNativeType($function->signature->type) eq "bool")) {
</del><ins>+ if (!$function->signature->extendedAttributes->{"Custom"} && GetNativeType($function->signature->type) ne "bool") {
</ins><span class="cx"> push(@headerContent, " COMPILE_ASSERT(false)");
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3865,10 +3923,10 @@
</span><span class="cx"> push(@headerContent, "JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $interfaceName*);\n");
</span><span class="cx"> push(@headerContent, "inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, $interfaceName& impl) { return toJS(state, globalObject, &impl); }\n\n");
</span><span class="cx">
</span><del>- push(@headerContent, "} // namespace WebCore\n\n");
</del><ins>+ push(@headerContent, "} // namespace WebCore\n");
+
</ins><span class="cx"> my $conditionalString = $codeGenerator->GenerateConditionalString($interface);
</span><del>- push(@headerContent, "#endif // ${conditionalString}\n\n") if $conditionalString;
- push(@headerContent, "#endif\n");
</del><ins>+ push(@headerContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GenerateCallbackImplementation
</span><span class="lines">@@ -3980,8 +4038,7 @@
</span><span class="cx"> push(@implContent, "\n// Functions\n");
</span><span class="cx"> foreach my $function (@{$interface->functions}) {
</span><span class="cx"> my @params = @{$function->parameters};
</span><del>- if ($function->signature->extendedAttributes->{"Custom"} ||
- !(GetNativeType($function->signature->type) eq "bool")) {
</del><ins>+ if ($function->signature->extendedAttributes->{"Custom"} || GetNativeType($function->signature->type) ne "bool") {
</ins><span class="cx"> next;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4237,6 +4294,8 @@
</span><span class="cx"> {
</span><span class="cx"> my $type = shift;
</span><span class="cx">
</span><ins>+ # FIXME: Maybe we can start using "auto" for most of these?
+
</ins><span class="cx"> my $svgNativeType = $codeGenerator->GetSVGTypeNeedingTearOff($type);
</span><span class="cx"> return "${svgNativeType}*" if $svgNativeType;
</span><span class="cx"> return "RefPtr<DOMStringList>" if $type eq "DOMStringList";
</span><span class="lines">@@ -4249,7 +4308,7 @@
</span><span class="cx">
</span><span class="cx"> return "Vector<" . GetNativeVectorInnerType($arrayOrSequenceType) . ">" if $arrayOrSequenceType;
</span><span class="cx"> return "String" if $codeGenerator->IsStringBasedEnumType($type);
</span><del>- return GetEnumerationClassName($type) if $codeGenerator->IsEnumType($type);
</del><ins>+ return "auto" if $codeGenerator->IsEnumType($type);
</ins><span class="cx">
</span><span class="cx"> # For all other types, the native type is a pointer with same type name as the IDL type.
</span><span class="cx"> return "${type}*";
</span><span class="lines">@@ -4416,7 +4475,7 @@
</span><span class="cx">
</span><span class="cx"> if ($codeGenerator->IsEnumType($type)) {
</span><span class="cx"> my $className = GetEnumerationClassName($type);
</span><del>- return "enumerationValue$className($value.toWTFString(state)).value()";
</del><ins>+ return "parse$className(*state, $value)";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # Default, assume autogenerated type conversion routines
</span><span class="lines">@@ -4467,7 +4526,6 @@
</span><span class="cx">
</span><span class="cx"> if ($codeGenerator->IsEnumType($type)) {
</span><span class="cx"> AddToImplIncludes("<runtime/JSString.h>", $conditional);
</span><del>- $value = "stringValue($value)" unless $codeGenerator->IsStringBasedEnumType($type);
</del><span class="cx"> return "jsStringWithCache(state, $value)";
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestActiveDOMObject_h
-#define JSTestActiveDOMObject_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestActiveDOMObject.h"
</span><span class="lines">@@ -89,5 +88,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestCallback_h
-#define JSTestCallback_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(SPEECH_SYNTHESIS)
</span><span class="cx">
</span><span class="lines">@@ -65,5 +64,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(SPEECH_SYNTHESIS)
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCallbackFunctionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestCallbackFunction_h
-#define JSTestCallbackFunction_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(SPEECH_SYNTHESIS)
</span><span class="cx">
</span><span class="lines">@@ -64,5 +63,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(SPEECH_SYNTHESIS)
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestClassWithJSBuiltinConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestClassWithJSBuiltinConstructor_h
-#define JSTestClassWithJSBuiltinConstructor_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestClassWithJSBuiltinConstructor.h"
</span><span class="lines">@@ -88,5 +87,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestCustomConstructorWithNoInterfaceObject_h
-#define JSTestCustomConstructorWithNoInterfaceObject_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestCustomConstructorWithNoInterfaceObject.h"
</span><span class="lines">@@ -88,5 +87,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGetterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestCustomNamedGetter_h
-#define JSTestCustomNamedGetter_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestCustomNamedGetter.h"
</span><span class="lines">@@ -92,5 +91,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestEventConstructor_h
-#define JSTestEventConstructor_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestEventConstructor.h"
</span><span class="lines">@@ -90,5 +89,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestEventTarget_h
-#define JSTestEventTarget_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSEventTarget.h"
</span><span class="cx"> #include "TestEventTarget.h"
</span><span class="lines">@@ -81,5 +80,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestExceptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestException_h
-#define JSTestException_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestException.h"
</span><span class="lines">@@ -90,5 +89,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGenerateIsReachableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestGenerateIsReachable_h
-#define JSTestGenerateIsReachable_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestGenerateIsReachable.h"
</span><span class="lines">@@ -86,5 +85,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestGlobalObject_h
-#define JSTestGlobalObject_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestGlobalObject.h"
</span><span class="lines">@@ -119,5 +118,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestInterface_h
-#define JSTestInterface_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(Condition1) || ENABLE(Condition2)
</span><span class="cx">
</span><span class="lines">@@ -115,5 +114,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(Condition1) || ENABLE(Condition2)
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestJSBuiltinConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestJSBuiltinConstructor_h
-#define JSTestJSBuiltinConstructor_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx">
</span><span class="lines">@@ -67,5 +66,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestMediaQueryListListenerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestMediaQueryListListener_h
-#define JSTestMediaQueryListListener_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestMediaQueryListListener.h"
</span><span class="lines">@@ -86,5 +85,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestNamedConstructor_h
-#define JSTestNamedConstructor_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestNamedConstructor.h"
</span><span class="lines">@@ -87,5 +86,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestNode_h
-#define JSTestNode_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSNode.h"
</span><span class="cx"> #include "TestNode.h"
</span><span class="lines">@@ -69,5 +68,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministich"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestNondeterministic_h
-#define JSTestNondeterministic_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestNondeterministic.h"
</span><span class="lines">@@ -86,5 +85,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -89,10 +89,11 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-const String& stringValue(TestEnumType);
-Optional<TestEnumType> enumerationValueTestEnumType(const String&);
</del><ins>+JSString* jsStringWithCache(ExecState*, TestEnumType);
+Optional<TestEnumType> parseTestEnumType(ExecState&, JSValue);
+extern const char* const expectedEnumerationValuesTestEnumType;
</ins><span class="cx">
</span><del>-const String& stringValue(TestEnumType enumerationValue)
</del><ins>+JSString* jsStringWithCache(ExecState* state, TestEnumType enumerationValue)
</ins><span class="cx"> {
</span><span class="cx"> static NeverDestroyed<const String> values[] = {
</span><span class="cx"> ASCIILiteral(""),
</span><span class="lines">@@ -100,17 +101,22 @@
</span><span class="cx"> ASCIILiteral("EnumValue2"),
</span><span class="cx"> ASCIILiteral("EnumValue3"),
</span><span class="cx"> };
</span><del>- static_assert(!static_cast<size_t>(TestEnumType::EmptyString), "TestEnumType::EmptyString is not 0 as expected");
</del><ins>+ static_assert(static_cast<size_t>(TestEnumType::EmptyString) == 0, "TestEnumType::EmptyString is not 0 as expected");
</ins><span class="cx"> static_assert(static_cast<size_t>(TestEnumType::EnumValue1) == 1, "TestEnumType::EnumValue1 is not 1 as expected");
</span><span class="cx"> static_assert(static_cast<size_t>(TestEnumType::EnumValue2) == 2, "TestEnumType::EnumValue2 is not 2 as expected");
</span><span class="cx"> static_assert(static_cast<size_t>(TestEnumType::EnumValue3) == 3, "TestEnumType::EnumValue3 is not 3 as expected");
</span><span class="cx"> ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));
</span><del>- return values[static_cast<size_t>(enumerationValue)];
</del><ins>+ return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-Optional<TestEnumType> enumerationValueTestEnumType(const String& stringValue)
</del><ins>+template<> struct JSValueTraits<TestEnumType> {
+ static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, TestEnumType value) { return jsStringWithCache(state, value); }
+};
+
+Optional<TestEnumType> parseTestEnumType(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><del>- if (stringValue == "")
</del><ins>+ auto stringValue = value.toWTFString(&state);
+ if (stringValue.isEmpty())
</ins><span class="cx"> return TestEnumType::EmptyString;
</span><span class="cx"> if (stringValue == "EnumValue1")
</span><span class="cx"> return TestEnumType::EnumValue1;
</span><span class="lines">@@ -121,10 +127,13 @@
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-const String& stringValue(Optional);
-Optional<Optional> enumerationValueOptional(const String&);
</del><ins>+const char* const expectedEnumerationValuesTestEnumType = "\"\", \"EnumValue1\", \"EnumValue2\", \"EnumValue3\"";
</ins><span class="cx">
</span><del>-const String& stringValue(Optional enumerationValue)
</del><ins>+JSString* jsStringWithCache(ExecState*, Optional);
+Optional<Optional> parseOptional(ExecState&, JSValue);
+extern const char* const expectedEnumerationValuesOptional;
+
+JSString* jsStringWithCache(ExecState* state, Optional enumerationValue)
</ins><span class="cx"> {
</span><span class="cx"> static NeverDestroyed<const String> values[] = {
</span><span class="cx"> ASCIILiteral(""),
</span><span class="lines">@@ -132,17 +141,22 @@
</span><span class="cx"> ASCIILiteral("OptionalValue2"),
</span><span class="cx"> ASCIILiteral("OptionalValue3"),
</span><span class="cx"> };
</span><del>- static_assert(!static_cast<size_t>(Optional::EmptyString), "Optional::EmptyString is not 0 as expected");
</del><ins>+ static_assert(static_cast<size_t>(Optional::EmptyString) == 0, "Optional::EmptyString is not 0 as expected");
</ins><span class="cx"> static_assert(static_cast<size_t>(Optional::OptionalValue1) == 1, "Optional::OptionalValue1 is not 1 as expected");
</span><span class="cx"> static_assert(static_cast<size_t>(Optional::OptionalValue2) == 2, "Optional::OptionalValue2 is not 2 as expected");
</span><span class="cx"> static_assert(static_cast<size_t>(Optional::OptionalValue3) == 3, "Optional::OptionalValue3 is not 3 as expected");
</span><span class="cx"> ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));
</span><del>- return values[static_cast<size_t>(enumerationValue)];
</del><ins>+ return jsStringWithCache(state, values[static_cast<size_t>(enumerationValue)]);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-Optional<Optional> enumerationValueOptional(const String& stringValue)
</del><ins>+template<> struct JSValueTraits<Optional> {
+ static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, Optional value) { return jsStringWithCache(state, value); }
+};
+
+Optional<Optional> parseOptional(ExecState& state, JSValue value)
</ins><span class="cx"> {
</span><del>- if (stringValue == "")
</del><ins>+ auto stringValue = value.toWTFString(&state);
+ if (stringValue.isEmpty())
</ins><span class="cx"> return Optional::EmptyString;
</span><span class="cx"> if (stringValue == "OptionalValue1")
</span><span class="cx"> return Optional::OptionalValue1;
</span><span class="lines">@@ -153,6 +167,8 @@
</span><span class="cx"> return Nullopt;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+const char* const expectedEnumerationValuesOptional = "\"\", \"OptionalValue1\", \"OptionalValue2\", \"OptionalValue3\"";
+
</ins><span class="cx"> // Functions
</span><span class="cx">
</span><span class="cx"> #if ENABLE(TEST_FEATURE)
</span><span class="lines">@@ -1054,7 +1070,7 @@
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "enumAttr");
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = jsStringWithCache(state, stringValue(impl.enumAttr()));
</del><ins>+ JSValue result = jsStringWithCache(state, impl.enumAttr());
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2211,7 +2227,7 @@
</span><span class="cx"> return throwGetterTypeError(*state, "TestObj", "attributeWithReservedEnumType");
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- JSValue result = jsStringWithCache(state, stringValue(impl.attributeWithReservedEnumType()));
</del><ins>+ JSValue result = jsStringWithCache(state, impl.attributeWithReservedEnumType());
</ins><span class="cx"> return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2299,12 +2315,12 @@
</span><span class="cx"> return throwSetterTypeError(*state, "TestObj", "enumAttr");
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- TestEnumType nativeValue = enumerationValueTestEnumType(value.toWTFString(state)).value();
</del><ins>+ auto nativeValue = parseTestEnumType(*state, value);
</ins><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return false;
</span><del>- if (nativeValue != "" && nativeValue != "EnumValue1" && nativeValue != "EnumValue2" && nativeValue != "EnumValue3")
</del><ins>+ if (UNLIKELY(!nativeValue))
</ins><span class="cx"> return false;
</span><del>- impl.setEnumAttr(nativeValue);
</del><ins>+ impl.setEnumAttr(nativeValue.value());
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3366,12 +3382,12 @@
</span><span class="cx"> return throwSetterTypeError(*state, "TestObj", "attributeWithReservedEnumType");
</span><span class="cx"> }
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- Optional nativeValue = enumerationValueOptional(value.toWTFString(state)).value();
</del><ins>+ auto nativeValue = parseOptional(*state, value);
</ins><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return false;
</span><del>- if (nativeValue != "" && nativeValue != "OptionalValue1" && nativeValue != "OptionalValue2" && nativeValue != "OptionalValue3")
</del><ins>+ if (UNLIKELY(!nativeValue))
</ins><span class="cx"> return false;
</span><del>- impl.setAttributeWithReservedEnumType(nativeValue);
</del><ins>+ impl.setAttributeWithReservedEnumType(nativeValue.value());
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3779,13 +3795,14 @@
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><span class="cx"> if (UNLIKELY(state->argumentCount() < 1))
</span><span class="cx"> return throwVMError(state, createNotEnoughArgumentsError(state));
</span><del>- // Keep pointer to the JSString in a local so we don't need to ref the String.
- auto* enumArgString = state->argument(0).toString(state);
- auto& enumArg = enumArgString->value(state);
</del><ins>+ auto enumArgValue = state->argument(0);
+ TestEnumType enumArg;
+ auto optionalValue = parseTestEnumType(*state, enumArgValue);
</ins><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- if (enumArg != "" && enumArg != "EnumValue1" && enumArg != "EnumValue2" && enumArg != "EnumValue3")
- return throwArgumentMustBeEnumError(*state, 0, "enumArg", "TestObj", "methodWithEnumArg", "\"\", \"EnumValue1\", \"EnumValue2\", \"EnumValue3\"");
</del><ins>+ if (!optionalValue)
+ return throwArgumentMustBeEnumError(*state, 0, "enumArg", "TestObj", "methodWithEnumArg", expectedEnumerationValuesTestEnumType);
+ enumArg = optionalValue.value();
</ins><span class="cx"> impl.methodWithEnumArg(enumArg);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="lines">@@ -3798,15 +3815,17 @@
</span><span class="cx"> return throwThisTypeError(*state, "TestObj", "methodWithOptionalEnumArgAndDefaultValue");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- String enumArg;
- if (state->argument(0).isUndefined())
- enumArg = ASCIILiteral("EnumValue1");
- else {
- enumArg = state->uncheckedArgument(0).toWTFString(state);
</del><ins>+ auto enumArgValue = state->argument(0);
+ TestEnumType enumArg;
+ if (enumArgValue.isUndefined()) {
+ enumArg = TestEnumType::EnumValue1;
+ } else {
+ auto optionalValue = parseTestEnumType(*state, enumArgValue);
</ins><span class="cx"> if (UNLIKELY(state->hadException()))
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- if (enumArg != "" && enumArg != "EnumValue1" && enumArg != "EnumValue2" && enumArg != "EnumValue3")
- return throwArgumentMustBeEnumError(*state, 0, "enumArg", "TestObj", "methodWithOptionalEnumArgAndDefaultValue", "\"\", \"EnumValue1\", \"EnumValue2\", \"EnumValue3\"");
</del><ins>+ if (!optionalValue)
+ return throwArgumentMustBeEnumError(*state, 0, "enumArg", "TestObj", "methodWithOptionalEnumArgAndDefaultValue", expectedEnumerationValuesTestEnumType);
+ enumArg = optionalValue.value();
</ins><span class="cx"> }
</span><span class="cx"> impl.methodWithOptionalEnumArgAndDefaultValue(enumArg);
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestObj_h
-#define JSTestObj_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestObj.h"
</span><span class="lines">@@ -104,5 +103,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestOverloadedConstructors_h
-#define JSTestOverloadedConstructors_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestOverloadedConstructors.h"
</span><span class="lines">@@ -86,5 +85,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestOverrideBuiltins_h
-#define JSTestOverrideBuiltins_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestOverrideBuiltins.h"
</span><span class="lines">@@ -93,5 +92,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestSerializedScriptValueInterface_h
-#define JSTestSerializedScriptValueInterface_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(Condition1) || ENABLE(Condition2)
</span><span class="cx">
</span><span class="lines">@@ -94,5 +93,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(Condition1) || ENABLE(Condition2)
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSTestTypedefs_h
-#define JSTestTypedefs_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "TestTypedefs.h"
</span><span class="lines">@@ -89,5 +88,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSattributeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSattribute_h
-#define JSattribute_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "attribute.h"
</span><span class="lines">@@ -90,5 +89,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSreadonlyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -18,8 +18,7 @@
</span><span class="cx"> Boston, MA 02110-1301, USA.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef JSreadonly_h
-#define JSreadonly_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "JSDOMWrapper.h"
</span><span class="cx"> #include "readonly.h"
</span><span class="lines">@@ -86,5 +85,3 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorecryptoCryptoKeycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/CryptoKey.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/CryptoKey.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/crypto/CryptoKey.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -47,47 +47,32 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String CryptoKey::type() const
-{
- switch (m_type) {
- case CryptoKeyType::Secret:
- return ASCIILiteral("secret");
- case CryptoKeyType::Public:
- return ASCIILiteral("public");
- case CryptoKeyType::Private:
- return ASCIILiteral("private");
- }
- RELEASE_ASSERT_NOT_REACHED();
- return emptyString();
-}
-
</del><span class="cx"> void CryptoKey::buildAlgorithmDescription(CryptoAlgorithmDescriptionBuilder& builder) const
</span><span class="cx"> {
</span><span class="cx"> builder.add("name", CryptoAlgorithmRegistry::singleton().nameForIdentifier(m_algorithm));
</span><span class="cx"> // Subclasses will add other keys.
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Vector<String> CryptoKey::usages() const
</del><ins>+Vector<KeyUsage> CryptoKey::usages() const
</ins><span class="cx"> {
</span><span class="cx"> // The result is ordered alphabetically.
</span><del>- Vector<String> result;
</del><ins>+ Vector<KeyUsage> result;
</ins><span class="cx"> if (m_usages & CryptoKeyUsageDecrypt)
</span><del>- result.append(ASCIILiteral("decrypt"));
</del><ins>+ result.append(KeyUsage::Decrypt);
</ins><span class="cx"> if (m_usages & CryptoKeyUsageDeriveBits)
</span><del>- result.append(ASCIILiteral("deriveBits"));
</del><ins>+ result.append(KeyUsage::DeriveBits);
</ins><span class="cx"> if (m_usages & CryptoKeyUsageDeriveKey)
</span><del>- result.append(ASCIILiteral("deriveKey"));
</del><ins>+ result.append(KeyUsage::DeriveKey);
</ins><span class="cx"> if (m_usages & CryptoKeyUsageEncrypt)
</span><del>- result.append(ASCIILiteral("encrypt"));
</del><ins>+ result.append(KeyUsage::Encrypt);
</ins><span class="cx"> if (m_usages & CryptoKeyUsageSign)
</span><del>- result.append(ASCIILiteral("sign"));
</del><ins>+ result.append(KeyUsage::Sign);
</ins><span class="cx"> if (m_usages & CryptoKeyUsageUnwrapKey)
</span><del>- result.append(ASCIILiteral("unwrapKey"));
</del><ins>+ result.append(KeyUsage::UnwrapKey);
</ins><span class="cx"> if (m_usages & CryptoKeyUsageVerify)
</span><del>- result.append(ASCIILiteral("verify"));
</del><ins>+ result.append(KeyUsage::Verify);
</ins><span class="cx"> if (m_usages & CryptoKeyUsageWrapKey)
</span><del>- result.append(ASCIILiteral("wrapKey"));
-
</del><ins>+ result.append(KeyUsage::WrapKey);
</ins><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecryptoCryptoKeyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/crypto/CryptoKey.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/CryptoKey.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/crypto/CryptoKey.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -47,6 +47,10 @@
</span><span class="cx"> RSA
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+enum class KeyUsage { Encrypt, Decrypt, Sign, Verify, DeriveKey, DeriveBits, WrapKey, UnwrapKey };
+
+using KeyType = CryptoKeyType;
+
</ins><span class="cx"> class CryptoKey : public RefCounted<CryptoKey> {
</span><span class="cx"> public:
</span><span class="cx"> CryptoKey(CryptoAlgorithmIdentifier, CryptoKeyType, bool extractable, CryptoKeyUsage);
</span><span class="lines">@@ -54,10 +58,10 @@
</span><span class="cx">
</span><span class="cx"> virtual CryptoKeyClass keyClass() const = 0;
</span><span class="cx">
</span><del>- String type() const;
</del><ins>+ CryptoKeyType type() const;
</ins><span class="cx"> bool extractable() const { return m_extractable; }
</span><span class="cx"> virtual void buildAlgorithmDescription(CryptoAlgorithmDescriptionBuilder&) const;
</span><del>- Vector<String> usages() const;
</del><ins>+ Vector<KeyUsage> usages() const;
</ins><span class="cx">
</span><span class="cx"> CryptoAlgorithmIdentifier algorithmIdentifier() const { return m_algorithm; }
</span><span class="cx"> CryptoKeyUsage usagesBitmap() const { return m_usages; }
</span><span class="lines">@@ -74,6 +78,11 @@
</span><span class="cx"> CryptoKeyUsage m_usages;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+inline CryptoKeyType CryptoKey::type() const
+{
+ return m_type;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #define SPECIALIZE_TYPE_TRAITS_CRYPTO_KEY(ToClassName, KeyClass) \
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFaceSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFaceSet.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFaceSet.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/css/FontFaceSet.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -182,16 +182,16 @@
</span><span class="cx"> return m_promise.value();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String FontFaceSet::status() const
</del><ins>+FontFaceSetLoadStatus FontFaceSet::status() const
</ins><span class="cx"> {
</span><span class="cx"> switch (m_backing->status()) {
</span><span class="cx"> case CSSFontFaceSet::Status::Loading:
</span><del>- return ASCIILiteral("loading");
</del><ins>+ return FontFaceSetLoadStatus::Loading;
</ins><span class="cx"> case CSSFontFaceSet::Status::Loaded:
</span><del>- return ASCIILiteral("loaded");
</del><ins>+ return FontFaceSetLoadStatus::Loaded;
</ins><span class="cx"> }
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><del>- return ASCIILiteral("loaded");
</del><ins>+ return FontFaceSetLoadStatus::Loaded;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool FontFaceSet::canSuspendForDocumentSuspension() const
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontFaceSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/FontFaceSet.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontFaceSet.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/css/FontFaceSet.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -35,6 +35,8 @@
</span><span class="cx">
</span><span class="cx"> class DOMCoreException;
</span><span class="cx">
</span><ins>+enum class FontFaceSetLoadStatus { Loading, Loaded };
+
</ins><span class="cx"> class FontFaceSet final : public RefCounted<FontFaceSet>, private CSSFontFaceSetClient, public EventTargetWithInlineData, private ActiveDOMObject {
</span><span class="cx"> public:
</span><span class="cx"> static Ref<FontFaceSet> create(Document&, const Vector<RefPtr<FontFace>>& initialFaces);
</span><span class="lines">@@ -50,7 +52,7 @@
</span><span class="cx"> void load(JSC::ExecState&, const String& font, const String& text, DeferredWrapper&& promise, ExceptionCode&);
</span><span class="cx"> bool check(const String& font, const String& text, ExceptionCode&);
</span><span class="cx">
</span><del>- String status() const;
</del><ins>+ FontFaceSetLoadStatus status() const;
</ins><span class="cx">
</span><span class="cx"> typedef DOMPromise<FontFaceSet&, DOMCoreException&> Promise;
</span><span class="cx"> Promise& promise(JSC::ExecState&);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -3041,7 +3041,7 @@
</span><span class="cx"> if (m_session) {
</span><span class="cx"> m_session->addActiveMediaElement(*this);
</span><span class="cx">
</span><del>- if (m_session->kindEnum() == MediaSession::Kind::Content) {
</del><ins>+ if (m_session->kind() == MediaSessionKind::Content) {
</ins><span class="cx"> if (Page* page = document().page())
</span><span class="cx"> page->chrome().client().focusedContentMediaElementDidChange(m_elementID);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLVideoElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLVideoElement.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLVideoElement.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/html/HTMLVideoElement.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -381,30 +381,12 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_PRESENTATION_MODE)
</span><span class="cx">
</span><del>-static const AtomicString& presentationModeFullscreen()
</del><ins>+bool HTMLVideoElement::webkitSupportsPresentationMode(VideoPresentationMode mode) const
</ins><span class="cx"> {
</span><del>- static NeverDestroyed<AtomicString> fullscreen("fullscreen", AtomicString::ConstructFromLiteral);
- return fullscreen;
-}
-
-static const AtomicString& presentationModePictureInPicture()
-{
- static NeverDestroyed<AtomicString> pictureInPicture("picture-in-picture", AtomicString::ConstructFromLiteral);
- return pictureInPicture;
-}
-
-static const AtomicString& presentationModeInline()
-{
- static NeverDestroyed<AtomicString> inlineMode("inline", AtomicString::ConstructFromLiteral);
- return inlineMode;
-}
-
-bool HTMLVideoElement::webkitSupportsPresentationMode(const String& mode) const
-{
- if (mode == presentationModeFullscreen())
</del><ins>+ if (mode == VideoPresentationMode::Fullscreen)
</ins><span class="cx"> return mediaSession().fullscreenPermitted(*this) && supportsFullscreen(HTMLMediaElementEnums::VideoFullscreenModeStandard);
</span><span class="cx">
</span><del>- if (mode == presentationModePictureInPicture()) {
</del><ins>+ if (mode == VideoPresentationMode::PictureInPicture) {
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> if (!supportsPictureInPicture())
</span><span class="cx"> return false;
</span><span class="lines">@@ -413,39 +395,29 @@
</span><span class="cx"> return mediaSession().allowsPictureInPicture(*this) && supportsFullscreen(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (mode == presentationModeInline())
</del><ins>+ if (mode == VideoPresentationMode::Inline)
</ins><span class="cx"> return !mediaSession().requiresFullscreenForVideoPlayback(*this);
</span><span class="cx">
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool presentationModeToFullscreenMode(const String& presentationMode, HTMLMediaElementEnums::VideoFullscreenMode& fullscreenMode)
</del><ins>+static inline HTMLMediaElementEnums::VideoFullscreenMode toFullscreenMode(VideoPresentationMode mode)
</ins><span class="cx"> {
</span><del>- if (presentationMode == presentationModeFullscreen()) {
- fullscreenMode = HTMLMediaElementEnums::VideoFullscreenModeStandard;
- return true;
</del><ins>+ switch (mode) {
+ case VideoPresentationMode::Fullscreen:
+ return HTMLMediaElementEnums::VideoFullscreenModeStandard;
+ case VideoPresentationMode::PictureInPicture:
+ return HTMLMediaElementEnums::VideoFullscreenModePictureInPicture;
+ case VideoPresentationMode::Inline:
+ return HTMLMediaElementEnums::VideoFullscreenModeNone;
</ins><span class="cx"> }
</span><del>-
- if (presentationMode == presentationModePictureInPicture()) {
- fullscreenMode = HTMLMediaElementEnums::VideoFullscreenModePictureInPicture;
- return true;
- }
-
- if (presentationMode == presentationModeInline()) {
- fullscreenMode = HTMLMediaElementEnums::VideoFullscreenModeNone;
- return true;
- }
- return false;
</del><ins>+ ASSERT_NOT_REACHED();
+ return HTMLMediaElementEnums::VideoFullscreenModeNone;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLVideoElement::webkitSetPresentationMode(const String& mode)
</del><ins>+void HTMLVideoElement::webkitSetPresentationMode(VideoPresentationMode mode)
</ins><span class="cx"> {
</span><del>- VideoFullscreenMode fullscreenMode = VideoFullscreenModeNone;
- if (!presentationModeToFullscreenMode(mode, fullscreenMode))
- return;
-
- LOG_WITH_STREAM(Media, stream << "HTMLVideoElement::webkitSetPresentationMode(" << this << ") - setting to \"" << mode << "\"");
- setFullscreenMode(fullscreenMode);
</del><ins>+ setFullscreenMode(toFullscreenMode(mode));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLVideoElement::setFullscreenMode(HTMLMediaElementEnums::VideoFullscreenMode mode)
</span><span class="lines">@@ -461,23 +433,26 @@
</span><span class="cx"> enterFullscreen(mode);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String HTMLVideoElement::webkitPresentationMode() const
</del><ins>+static VideoPresentationMode toPresentationMode(HTMLMediaElement::VideoFullscreenMode mode)
</ins><span class="cx"> {
</span><del>- HTMLMediaElement::VideoFullscreenMode mode = fullscreenMode();
</del><ins>+ if (mode == HTMLMediaElementEnums::VideoFullscreenModeStandard)
+ return VideoPresentationMode::Fullscreen;
</ins><span class="cx">
</span><del>- if (mode == VideoFullscreenModeStandard)
- return presentationModeFullscreen();
</del><ins>+ if (mode & HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)
+ return VideoPresentationMode::PictureInPicture;
</ins><span class="cx">
</span><del>- if (mode & VideoFullscreenModePictureInPicture)
- return presentationModePictureInPicture();
</del><ins>+ if (mode == HTMLMediaElementEnums::VideoFullscreenModeNone)
+ return VideoPresentationMode::Inline;
</ins><span class="cx">
</span><del>- if (mode == VideoFullscreenModeNone)
- return presentationModeInline();
-
</del><span class="cx"> ASSERT_NOT_REACHED();
</span><del>- return presentationModeInline();
</del><ins>+ return VideoPresentationMode::Inline;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+VideoPresentationMode HTMLVideoElement::webkitPresentationMode() const
+{
+ return toPresentationMode(fullscreenMode());
+}
+
</ins><span class="cx"> void HTMLVideoElement::fullscreenModeChanged(VideoFullscreenMode mode)
</span><span class="cx"> {
</span><span class="cx"> if (mode != fullscreenMode()) {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLVideoElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLVideoElement.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLVideoElement.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/html/HTMLVideoElement.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef HTMLVideoElement_h
-#define HTMLVideoElement_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">
</span><span class="lines">@@ -35,6 +34,8 @@
</span><span class="cx">
</span><span class="cx"> class HTMLImageLoader;
</span><span class="cx">
</span><ins>+enum class VideoPresentationMode { Fullscreen, PictureInPicture, Inline };
+
</ins><span class="cx"> class HTMLVideoElement final : public HTMLMediaElement {
</span><span class="cx"> public:
</span><span class="cx"> static Ref<HTMLVideoElement> create(const QualifiedName&, Document&, bool);
</span><span class="lines">@@ -81,9 +82,9 @@
</span><span class="cx"> RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_PRESENTATION_MODE)
</span><del>- bool webkitSupportsPresentationMode(const String&) const;
- void webkitSetPresentationMode(const String&);
- String webkitPresentationMode() const;
</del><ins>+ bool webkitSupportsPresentationMode(VideoPresentationMode) const;
+ void webkitSetPresentationMode(VideoPresentationMode);
+ VideoPresentationMode webkitPresentationMode() const;
</ins><span class="cx"> void setFullscreenMode(VideoFullscreenMode);
</span><span class="cx"> void fullscreenModeChanged(VideoFullscreenMode) override;
</span><span class="cx"> #endif
</span><span class="lines">@@ -132,4 +133,3 @@
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(VIDEO)
</span><del>-#endif // HTMLVideoElement_h
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -58,32 +58,29 @@
</span><span class="cx"> #include "TextMetrics.h"
</span><span class="cx"> #include "TextRun.h"
</span><span class="cx"> #include "TextStream.h"
</span><del>-
</del><span class="cx"> #include <wtf/CheckedArithmetic.h>
</span><span class="cx"> #include <wtf/MathExtras.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><del>-#if USE(CG)
-#if !PLATFORM(IOS)
</del><ins>+#if USE(CG) && !PLATFORM(IOS)
</ins><span class="cx"> #include <ApplicationServices/ApplicationServices.h>
</span><del>-#endif // !PLATFORM(IOS)
</del><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if USE(CG)
-#define DefaultSmoothingQuality SmoothingQuality::Low
-#else
-#define DefaultSmoothingQuality SmoothingQuality::Medium
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx">
</span><ins>+#if USE(CG)
+const ImageSmoothingQuality defaultSmoothingQuality = ImageSmoothingQuality::Low;
+#else
+const ImageSmoothingQuality defaultSmoothingQuality = ImageSmoothingQuality::Medium;
+#endif
+
</ins><span class="cx"> static const int defaultFontSize = 10;
</span><span class="cx"> static const char* const defaultFontFamily = "sans-serif";
</span><span class="cx"> static const char* const defaultFont = "10px sans-serif";
</span><span class="lines">@@ -207,7 +204,7 @@
</span><span class="cx"> , hasInvertibleTransform(true)
</span><span class="cx"> , lineDashOffset(0)
</span><span class="cx"> , imageSmoothingEnabled(true)
</span><del>- , imageSmoothingQuality(DefaultSmoothingQuality)
</del><ins>+ , imageSmoothingQuality(defaultSmoothingQuality)
</ins><span class="cx"> , textAlign(StartTextAlign)
</span><span class="cx"> , textBaseline(AlphabeticTextBaseline)
</span><span class="cx"> , direction(Direction::Inherit)
</span><span class="lines">@@ -933,21 +930,14 @@
</span><span class="cx"> return op == CompositeSourceIn || op == CompositeSourceOut || op == CompositeDestinationIn || op == CompositeDestinationAtop;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool parseWinding(const String& windingRuleString, WindRule& windRule)
</del><ins>+static WindRule toWindRule(CanvasWindingRule rule)
</ins><span class="cx"> {
</span><del>- if (windingRuleString == "nonzero")
- windRule = RULE_NONZERO;
- else if (windingRuleString == "evenodd")
- windRule = RULE_EVENODD;
- else
- return false;
-
- return true;
</del><ins>+ return rule == CanvasWindingRule::Nonzero ? RULE_NONZERO : RULE_EVENODD;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CanvasRenderingContext2D::fill(const String& windingRuleString)
</del><ins>+void CanvasRenderingContext2D::fill(CanvasWindingRule windingRule)
</ins><span class="cx"> {
</span><del>- fillInternal(m_path, windingRuleString);
</del><ins>+ fillInternal(m_path, windingRule);
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><span class="cx"> clearPathForDashboardBackwardCompatibilityMode();
</span><span class="lines">@@ -963,18 +953,18 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CanvasRenderingContext2D::clip(const String& windingRuleString)
</del><ins>+void CanvasRenderingContext2D::clip(CanvasWindingRule windingRule)
</ins><span class="cx"> {
</span><del>- clipInternal(m_path, windingRuleString);
</del><ins>+ clipInternal(m_path, windingRule);
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><span class="cx"> clearPathForDashboardBackwardCompatibilityMode();
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CanvasRenderingContext2D::fill(DOMPath& path, const String& windingRuleString)
</del><ins>+void CanvasRenderingContext2D::fill(DOMPath& path, CanvasWindingRule windingRule)
</ins><span class="cx"> {
</span><del>- fillInternal(path.path(), windingRuleString);
</del><ins>+ fillInternal(path.path(), windingRule);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CanvasRenderingContext2D::stroke(DOMPath& path)
</span><span class="lines">@@ -982,12 +972,12 @@
</span><span class="cx"> strokeInternal(path.path());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CanvasRenderingContext2D::clip(DOMPath& path, const String& windingRuleString)
</del><ins>+void CanvasRenderingContext2D::clip(DOMPath& path, CanvasWindingRule windingRule)
</ins><span class="cx"> {
</span><del>- clipInternal(path.path(), windingRuleString);
</del><ins>+ clipInternal(path.path(), windingRule);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CanvasRenderingContext2D::fillInternal(const Path& path, const String& windingRuleString)
</del><ins>+void CanvasRenderingContext2D::fillInternal(const Path& path, CanvasWindingRule windingRule)
</ins><span class="cx"> {
</span><span class="cx"> GraphicsContext* c = drawingContext();
</span><span class="cx"> if (!c)
</span><span class="lines">@@ -1002,10 +992,7 @@
</span><span class="cx">
</span><span class="cx"> if (!path.isEmpty()) {
</span><span class="cx"> WindRule windRule = c->fillRule();
</span><del>- WindRule newWindRule = RULE_NONZERO;
- if (!parseWinding(windingRuleString, newWindRule))
- return;
- c->setFillRule(newWindRule);
</del><ins>+ c->setFillRule(toWindRule(windingRule));
</ins><span class="cx">
</span><span class="cx"> if (isFullCanvasCompositeMode(state().globalComposite)) {
</span><span class="cx"> beginCompositeLayer();
</span><span class="lines">@@ -1057,7 +1044,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CanvasRenderingContext2D::clipInternal(const Path& path, const String& windingRuleString)
</del><ins>+void CanvasRenderingContext2D::clipInternal(const Path& path, CanvasWindingRule windingRule)
</ins><span class="cx"> {
</span><span class="cx"> GraphicsContext* c = drawingContext();
</span><span class="cx"> if (!c)
</span><span class="lines">@@ -1065,12 +1052,8 @@
</span><span class="cx"> if (!state().hasInvertibleTransform)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- WindRule newWindRule = RULE_NONZERO;
- if (!parseWinding(windingRuleString, newWindRule))
- return;
-
</del><span class="cx"> realizeSaves();
</span><del>- c->canvasClip(path, newWindRule);
</del><ins>+ c->canvasClip(path, toWindRule(windingRule));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline void CanvasRenderingContext2D::beginCompositeLayer()
</span><span class="lines">@@ -1087,27 +1070,27 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CanvasRenderingContext2D::isPointInPath(const float x, const float y, const String& windingRuleString)
</del><ins>+bool CanvasRenderingContext2D::isPointInPath(float x, float y, CanvasWindingRule windingRule)
</ins><span class="cx"> {
</span><del>- return isPointInPathInternal(m_path, x, y, windingRuleString);
</del><ins>+ return isPointInPathInternal(m_path, x, y, windingRule);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool CanvasRenderingContext2D::isPointInStroke(const float x, const float y)
</del><ins>+bool CanvasRenderingContext2D::isPointInStroke(float x, float y)
</ins><span class="cx"> {
</span><span class="cx"> return isPointInStrokeInternal(m_path, x, y);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CanvasRenderingContext2D::isPointInPath(DOMPath& path, const float x, const float y, const String& windingRuleString)
</del><ins>+bool CanvasRenderingContext2D::isPointInPath(DOMPath& path, float x, float y, CanvasWindingRule windingRule)
</ins><span class="cx"> {
</span><del>- return isPointInPathInternal(path.path(), x, y, windingRuleString);
</del><ins>+ return isPointInPathInternal(path.path(), x, y, windingRule);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool CanvasRenderingContext2D::isPointInStroke(DOMPath& path, const float x, const float y)
</del><ins>+bool CanvasRenderingContext2D::isPointInStroke(DOMPath& path, float x, float y)
</ins><span class="cx"> {
</span><span class="cx"> return isPointInStrokeInternal(path.path(), x, y);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CanvasRenderingContext2D::isPointInPathInternal(const Path& path, float x, float y, const String& windingRuleString)
</del><ins>+bool CanvasRenderingContext2D::isPointInPathInternal(const Path& path, float x, float y, CanvasWindingRule windingRule)
</ins><span class="cx"> {
</span><span class="cx"> GraphicsContext* c = drawingContext();
</span><span class="cx"> if (!c)
</span><span class="lines">@@ -1120,11 +1103,7 @@
</span><span class="cx"> if (!std::isfinite(transformedPoint.x()) || !std::isfinite(transformedPoint.y()))
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- WindRule windRule = RULE_NONZERO;
- if (!parseWinding(windingRuleString, windRule))
- return false;
-
- return path.contains(transformedPoint, windRule);
</del><ins>+ return path.contains(transformedPoint, toWindRule(windingRule));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CanvasRenderingContext2D::isPointInStrokeInternal(const Path& path, float x, float y)
</span><span class="lines">@@ -2558,14 +2537,14 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-static InterpolationQuality smoothingToInterpolationQuality(CanvasRenderingContext2D::SmoothingQuality quality)
</del><ins>+static InterpolationQuality smoothingToInterpolationQuality(ImageSmoothingQuality quality)
</ins><span class="cx"> {
</span><span class="cx"> switch (quality) {
</span><del>- case CanvasRenderingContext2D::SmoothingQuality::Low:
</del><ins>+ case ImageSmoothingQuality::Low:
</ins><span class="cx"> return InterpolationLow;
</span><del>- case CanvasRenderingContext2D::SmoothingQuality::Medium:
</del><ins>+ case ImageSmoothingQuality::Medium:
</ins><span class="cx"> return InterpolationMedium;
</span><del>- case CanvasRenderingContext2D::SmoothingQuality::High:
</del><ins>+ case ImageSmoothingQuality::High:
</ins><span class="cx"> return InterpolationHigh;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2573,35 +2552,13 @@
</span><span class="cx"> return InterpolationLow;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-String CanvasRenderingContext2D::imageSmoothingQuality() const
</del><ins>+ImageSmoothingQuality CanvasRenderingContext2D::imageSmoothingQuality() const
</ins><span class="cx"> {
</span><del>- switch (state().imageSmoothingQuality) {
- case SmoothingQuality::Low:
- return ASCIILiteral("low");
- case SmoothingQuality::Medium:
- return ASCIILiteral("medium");
- case SmoothingQuality::High:
- return ASCIILiteral("high");
- }
-
- ASSERT_NOT_REACHED();
- return ASCIILiteral("low");
</del><ins>+ return state().imageSmoothingQuality;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void CanvasRenderingContext2D::setImageSmoothingQuality(const String& smoothingQualityString)
</del><ins>+void CanvasRenderingContext2D::setImageSmoothingQuality(ImageSmoothingQuality quality)
</ins><span class="cx"> {
</span><del>- SmoothingQuality quality;
- if (smoothingQualityString == "low")
- quality = SmoothingQuality::Low;
- else if (smoothingQualityString == "medium")
- quality = SmoothingQuality::Medium;
- else if (smoothingQualityString == "high")
- quality = SmoothingQuality::High;
- else {
- ASSERT_NOT_REACHED();
- return;
- }
-
</del><span class="cx"> if (quality == state().imageSmoothingQuality)
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef CanvasRenderingContext2D_h
-#define CanvasRenderingContext2D_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "AffineTransform.h"
</span><span class="cx"> #include "CanvasPathMethods.h"
</span><span class="lines">@@ -58,6 +57,9 @@
</span><span class="cx">
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="cx">
</span><ins>+enum class CanvasWindingRule { Nonzero, Evenodd };
+enum class ImageSmoothingQuality { Low, Medium, High };
+
</ins><span class="cx"> class CanvasRenderingContext2D final : public CanvasRenderingContext, public CanvasPathMethods {
</span><span class="cx"> public:
</span><span class="cx"> CanvasRenderingContext2D(HTMLCanvasElement*, bool usesCSSCompatibilityParseMode, bool usesDashboardCompatibilityMode);
</span><span class="lines">@@ -129,19 +131,19 @@
</span><span class="cx">
</span><span class="cx"> void beginPath();
</span><span class="cx">
</span><del>- void fill(const String& winding = ASCIILiteral("nonzero"));
</del><ins>+ void fill(CanvasWindingRule = CanvasWindingRule::Nonzero);
</ins><span class="cx"> void stroke();
</span><del>- void clip(const String& winding = ASCIILiteral("nonzero"));
</del><ins>+ void clip(CanvasWindingRule = CanvasWindingRule::Nonzero);
</ins><span class="cx">
</span><del>- void fill(DOMPath&, const String& winding = ASCIILiteral("nonzero"));
</del><ins>+ void fill(DOMPath&, CanvasWindingRule = CanvasWindingRule::Nonzero);
</ins><span class="cx"> void stroke(DOMPath&);
</span><del>- void clip(DOMPath&, const String& winding = ASCIILiteral("nonzero"));
</del><ins>+ void clip(DOMPath&, CanvasWindingRule = CanvasWindingRule::Nonzero);
</ins><span class="cx">
</span><del>- bool isPointInPath(const float x, const float y, const String& winding = ASCIILiteral("nonzero"));
- bool isPointInStroke(const float x, const float y);
</del><ins>+ bool isPointInPath(float x, float y, CanvasWindingRule = CanvasWindingRule::Nonzero);
+ bool isPointInStroke(float x, float y);
</ins><span class="cx">
</span><del>- bool isPointInPath(DOMPath&, const float x, const float y, const String& winding = ASCIILiteral("nonzero"));
- bool isPointInStroke(DOMPath&, const float x, const float y);
</del><ins>+ bool isPointInPath(DOMPath&, float x, float y, CanvasWindingRule = CanvasWindingRule::Nonzero);
+ bool isPointInStroke(DOMPath&, float x, float y);
</ins><span class="cx">
</span><span class="cx"> void clearRect(float x, float y, float width, float height);
</span><span class="cx"> void fillRect(float x, float y, float width, float height);
</span><span class="lines">@@ -220,15 +222,9 @@
</span><span class="cx"> bool imageSmoothingEnabled() const;
</span><span class="cx"> void setImageSmoothingEnabled(bool);
</span><span class="cx">
</span><del>- String imageSmoothingQuality() const;
- void setImageSmoothingQuality(const String&);
</del><ins>+ ImageSmoothingQuality imageSmoothingQuality() const;
+ void setImageSmoothingQuality(ImageSmoothingQuality);
</ins><span class="cx">
</span><del>- enum class SmoothingQuality {
- Low,
- Medium,
- High
- };
-
</del><span class="cx"> bool usesDisplayListDrawing() const { return m_usesDisplayListDrawing; };
</span><span class="cx"> void setUsesDisplayListDrawing(bool flag) { m_usesDisplayListDrawing = flag; };
</span><span class="cx">
</span><span class="lines">@@ -291,7 +287,7 @@
</span><span class="cx"> Vector<float> lineDash;
</span><span class="cx"> float lineDashOffset;
</span><span class="cx"> bool imageSmoothingEnabled;
</span><del>- SmoothingQuality imageSmoothingQuality;
</del><ins>+ ImageSmoothingQuality imageSmoothingQuality;
</ins><span class="cx">
</span><span class="cx"> // Text state.
</span><span class="cx"> TextAlign textAlign;
</span><span class="lines">@@ -349,11 +345,11 @@
</span><span class="cx"> void beginCompositeLayer();
</span><span class="cx"> void endCompositeLayer();
</span><span class="cx">
</span><del>- void fillInternal(const Path&, const String& winding);
</del><ins>+ void fillInternal(const Path&, CanvasWindingRule);
</ins><span class="cx"> void strokeInternal(const Path&);
</span><del>- void clipInternal(const Path&, const String& winding);
</del><ins>+ void clipInternal(const Path&, CanvasWindingRule);
</ins><span class="cx">
</span><del>- bool isPointInPathInternal(const Path&, float x, float y, const String& winding);
</del><ins>+ bool isPointInPathInternal(const Path&, float x, float y, CanvasWindingRule);
</ins><span class="cx"> bool isPointInStrokeInternal(const Path&, float x, float y);
</span><span class="cx">
</span><span class="cx"> void drawFocusIfNeededInternal(const Path&, Element*);
</span><span class="lines">@@ -401,5 +397,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_CANVASRENDERINGCONTEXT(WebCore::CanvasRenderingContext2D, is2d())
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaWebPlaybackSessionModelMediaElementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -157,13 +157,10 @@
</span><span class="cx"> String localizedDeviceName;
</span><span class="cx">
</span><span class="cx"> if (m_mediaElement->mediaControlsHost()) {
</span><del>- static NeverDestroyed<String> airplay(ASCIILiteral("airplay"));
- static NeverDestroyed<String> tvout(ASCIILiteral("tvout"));
-
- String type = m_mediaElement->mediaControlsHost()->externalDeviceType();
- if (type == airplay)
</del><ins>+ auto type = m_mediaElement->mediaControlsHost()->externalDeviceType();
+ if (type == DeviceType::Airplay)
</ins><span class="cx"> targetType = WebPlaybackSessionInterface::TargetTypeAirPlay;
</span><del>- else if (type == tvout)
</del><ins>+ else if (type == DeviceType::Tvout)
</ins><span class="cx"> targetType = WebPlaybackSessionInterface::TargetTypeTVOut;
</span><span class="cx"> localizedDeviceName = m_mediaElement->mediaControlsHost()->externalDeviceDisplayName();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSourceBufferPrivateClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef SourceBufferPrivateClient_h
-#define SourceBufferPrivateClient_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx">
</span><span class="lines">@@ -45,8 +44,6 @@
</span><span class="cx"> public:
</span><span class="cx"> virtual ~SourceBufferPrivateClient() { }
</span><span class="cx">
</span><del>- virtual void sourceBufferPrivateDidEndStream(SourceBufferPrivate*, const WTF::AtomicString&) = 0;
-
</del><span class="cx"> struct InitializationSegment {
</span><span class="cx"> MediaTime duration;
</span><span class="cx">
</span><span class="lines">@@ -90,5 +87,3 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(MEDIA_SOURCE)
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Tools/ChangeLog        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-04-30 Darin Adler <darin@apple.com>
+
+ Next batch of conversions to use C++ enum class instead of strings for enumerations
+ https://bugs.webkit.org/show_bug.cgi?id=157232
+
+ Reviewed by Chris Dumez.
+
+ * Scripts/webkitpy/style/checker.py: Skip the bindings script tests when doing style
+ checking. We don't want to waste time trying to make our generated code match our style.
+
</ins><span class="cx"> 2016-04-29 Srinivasan Vijayaraghavan <svijayaraghavan@apple.com>
</span><span class="cx">
</span><span class="cx"> Add JSC test results in JSON format to a Buildbot log.
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpystylecheckerpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/style/checker.py (200290 => 200291)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/style/checker.py        2016-04-30 18:06:47 UTC (rev 200290)
+++ trunk/Tools/Scripts/webkitpy/style/checker.py        2016-04-30 19:16:00 UTC (rev 200291)
</span><span class="lines">@@ -154,7 +154,6 @@
</span><span class="cx"> os.path.join('Source', 'WebCore', 'bindings', 'gobject', 'WebKitDOMEventTarget.h'),
</span><span class="cx"> os.path.join('Source', 'WebCore', 'bindings', 'gobject', 'WebKitDOMNodeFilter.h'),
</span><span class="cx"> os.path.join('Source', 'WebCore', 'bindings', 'gobject', 'WebKitDOMXPathNSResolver.h'),
</span><del>- os.path.join('Source', 'WebCore', 'bindings', 'scripts', 'test', 'GObject'),
</del><span class="cx"> os.path.join('Source', 'WebKit', 'gtk', 'webkit'),
</span><span class="cx"> os.path.join('Tools', 'DumpRenderTree', 'gtk')],
</span><span class="cx"> ["-readability/naming",
</span><span class="lines">@@ -321,11 +320,11 @@
</span><span class="cx"> # future merges.
</span><span class="cx"> _SKIPPED_FILES_WITH_WARNING = [
</span><span class="cx"> os.path.join('Tools', 'TestWebKitAPI', 'Tests', 'WebKitGtk'),
</span><del>- # All WebKit*.h files in Source/WebKit2/UIProcess/API/gtk,
- # except those ending in ...Private.h are GTK+ API headers,
- # which differ greatly from WebKit coding style.
</del><ins>+
+ # WebKit*.h files in Source/WebKit2/UIProcess/API/gtk, except those ending in Private.h are GTK+ API headers, which do not follow WebKit coding style.
</ins><span class="cx"> re.compile(re.escape(os.path.join('Source', 'WebKit2', 'UIProcess', 'API', 'gtk') + os.path.sep) + r'WebKit(?!.*Private\.h).*\.h$'),
</span><span class="cx"> re.compile(re.escape(os.path.join('Source', 'WebKit2', 'WebProcess', 'InjectedBundle', 'API', 'gtk') + os.path.sep) + r'WebKit(?!.*Private\.h).*\.h$'),
</span><ins>+
</ins><span class="cx"> os.path.join('Source', 'WebKit2', 'UIProcess', 'API', 'gtk', 'webkit2.h'),
</span><span class="cx"> os.path.join('Source', 'WebKit2', 'WebProcess', 'InjectedBundle', 'API', 'gtk', 'webkit-web-extension.h')]
</span><span class="cx">
</span><span class="lines">@@ -335,7 +334,8 @@
</span><span class="cx"> # with FileType.NONE are automatically skipped without warning.
</span><span class="cx"> _SKIPPED_FILES_WITHOUT_WARNING = [
</span><span class="cx"> "LayoutTests" + os.path.sep,
</span><del>- ]
</del><ins>+ # Files generated by the bindings script should not be checked for style.
+ os.path.join('Source', 'WebCore', 'bindings', 'scripts', 'test')]
</ins><span class="cx">
</span><span class="cx"> # Extensions of files which are allowed to contain carriage returns.
</span><span class="cx"> _CARRIAGE_RETURN_ALLOWED_FILE_EXTENSIONS = [
</span></span></pre>
</div>
</div>
</body>
</html>