<!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&lt;EndOfStreamError&gt;
instead of overloading and taking const AtomicString&amp;.
(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 &quot;-&quot; 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-&gt;signature-&gt;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 &quot;auto&quot; 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  &lt;darin@apple.com&gt;
+
+        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&lt;EndOfStreamError&gt;
+        instead of overloading and taking const AtomicString&amp;.
+        (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 &quot;-&quot; 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-&gt;signature-&gt;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 &quot;auto&quot; 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  &lt;n_wang@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: @aria-label attribute should work on &lt;label&gt; 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  &lt;cdumez@apple.com&gt;
</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&lt;FetchResponse&gt; FetchResponse::error(ScriptExecutionContext&amp; 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&lt;FetchResponse&gt; FetchResponse::redirect(ScriptExecutionContext&amp; context, const String&amp; url, int status, ExceptionCode&amp; 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&lt;FetchResponse&gt; 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-&gt;m_response.setHTTPStatusCode(status);
</span><span class="cx">     redirectResponse-&gt;m_headers-&gt;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&amp; init, ExceptionCode&amp; 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&amp; context, Type type, FetchBody&amp;&amp; body, Ref&lt;FetchHeaders&gt;&amp;&amp; headers, ResourceResponse&amp;&amp; response)
</del><ins>+FetchResponse::FetchResponse(ScriptExecutionContext&amp; context, ResponseType type, FetchBody&amp;&amp; body, Ref&lt;FetchHeaders&gt;&amp;&amp; headers, ResourceResponse&amp;&amp; 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&lt;FetchResponse&gt; 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-&gt;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(&quot;basic&quot;);
-    case Type::Cors:
-        return ASCIILiteral(&quot;cors&quot;);
-    case Type::Default:
-        return ASCIILiteral(&quot;default&quot;);
-    case Type::Error:
-        return ASCIILiteral(&quot;error&quot;);
-    case Type::Opaque:
-        return ASCIILiteral(&quot;opaque&quot;);
-    case Type::OpaqueRedirect:
-        return ASCIILiteral(&quot;opaqueredirect&quot;);
-    };
-    ASSERT_NOT_REACHED();
-    return String();
-}
-
</del><span class="cx"> void FetchResponse::startFetching(ScriptExecutionContext&amp; context, const FetchRequest&amp; request, FetchPromise&amp;&amp; promise)
</span><span class="cx"> {
</span><del>-    Ref&lt;FetchResponse&gt; 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-&gt;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&lt;FetchResponse&gt; create(ScriptExecutionContext&amp; context) { return adoptRef(*new FetchResponse(context, Type::Default, { }, FetchHeaders::create(FetchHeaders::Guard::Response), ResourceResponse())); }
</del><ins>+    static Ref&lt;FetchResponse&gt; create(ScriptExecutionContext&amp; context) { return adoptRef(*new FetchResponse(context, ResponseType::Default, { }, FetchHeaders::create(FetchHeaders::Guard::Response), ResourceResponse())); }
</ins><span class="cx">     static Ref&lt;FetchResponse&gt; error(ScriptExecutionContext&amp;);
</span><span class="cx">     static RefPtr&lt;FetchResponse&gt; redirect(ScriptExecutionContext&amp;, const String&amp;, int, ExceptionCode&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -59,7 +60,7 @@
</span><span class="cx"> 
</span><span class="cx">     void initializeWith(const Dictionary&amp;, ExceptionCode&amp;);
</span><span class="cx"> 
</span><del>-    String type() const;
</del><ins>+    ResponseType type() const;
</ins><span class="cx">     const String&amp; 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&amp;, ResponseType, FetchBody&amp;&amp;, Ref&lt;FetchHeaders&gt;&amp;&amp;, ResourceResponse&amp;&amp;);
</ins><span class="cx"> 
</span><del>-    FetchResponse(ScriptExecutionContext&amp;, Type, FetchBody&amp;&amp;, Ref&lt;FetchHeaders&gt;&amp;&amp;, ResourceResponse&amp;&amp;);
-
</del><span class="cx">     static void startFetching(ScriptExecutionContext&amp;, const FetchRequest&amp;, FetchPromise&amp;&amp;);
</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&lt;FetchLoader&gt; 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&lt;FetchHeaders&gt; m_headers;
</span><span class="cx">     bool m_isRedirected = false;
</span><span class="cx">     Optional&lt;BodyLoader&gt; 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&lt;String&gt; none(ASCIILiteral(&quot;none&quot;));
-    String type = none;
-    
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    static NeverDestroyed&lt;String&gt; airplay(ASCIILiteral(&quot;airplay&quot;));
-    static NeverDestroyed&lt;String&gt; tvout(ASCIILiteral(&quot;tvout&quot;));
-    
</del><ins>+#if !ENABLE(WIRELESS_PLAYBACK_TARGET)
+    return DeviceType::None;
+#else
</ins><span class="cx">     MediaPlayer* player = m_mediaElement-&gt;player();
</span><span class="cx">     if (!player) {
</span><span class="cx">         LOG(Media, &quot;MediaControlsHost::externalDeviceType - returning \&quot;none\&quot; because player is NULL&quot;);
</span><del>-        return none;
</del><ins>+        return DeviceType::None;
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     switch (player-&gt;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, &quot;MediaControlsHost::externalDeviceType - returning \&quot;%s\&quot;&quot;, 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&lt;MediaControlsHost&gt; {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;MediaControlsHost&gt; 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 = &quot;&quot;;
-static const char* ambientKind = &quot;ambient&quot;;
-static const char* transientKind = &quot;transient&quot;;
-static const char* transientSoloKind = &quot;transient-solo&quot;;
-static const char* contentKind = &quot;content&quot;;
-
-MediaSession::Kind MediaSession::parseKind(const String&amp; 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&amp; context, const String&amp; kind)
</del><ins>+MediaSession::MediaSession(ScriptExecutionContext&amp; context, MediaSessionKind kind)
</ins><span class="cx">     : m_document(downcast&lt;Document&gt;(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 &quot;content&quot;, then create a new media remote controller for media
</span><span class="lines">@@ -82,22 +58,6 @@
</span><span class="cx">         m_controls-&gt;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&lt;MediaSession&gt; {
</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&lt;MediaSession&gt; create(ScriptExecutionContext&amp; context, const String&amp; kind = String())
</del><ins>+    static Ref&lt;MediaSession&gt; create(ScriptExecutionContext&amp; 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&amp;, const String&amp;);
</span><span class="cx"> 
</span><del>-    static Kind parseKind(const String&amp;);
-
</del><span class="cx">     void addMediaElement(HTMLMediaElement&amp;);
</span><span class="cx">     void removeMediaElement(HTMLMediaElement&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -109,7 +95,7 @@
</span><span class="cx">     HashSet&lt;HTMLMediaElement*&gt;* m_iteratedActiveParticipatingElements { nullptr };
</span><span class="cx"> 
</span><span class="cx">     Document&amp; m_document;
</span><del>-    const Kind m_kind { Kind::Default };
</del><ins>+    const MediaSessionKind m_kind;
</ins><span class="cx">     RefPtr&lt;MediaRemoteControls&gt; 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 = &quot;content&quot;),
</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-&gt;kindEnum() == MediaSession::Kind::Default || session-&gt;kindEnum() == MediaSession::Kind::Content)
</del><ins>+            if (session-&gt;kind() == MediaSessionKind::Default || session-&gt;kind() == MediaSessionKind::Content)
</ins><span class="cx">                 session-&gt;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-&gt;kindEnum() == MediaSession::Kind::Default || session-&gt;kindEnum() == MediaSession::Kind::Content)
</del><ins>+            if (session-&gt;kind() == MediaSessionKind::Default || session-&gt;kind() == MediaSessionKind::Content)
</ins><span class="cx">                 session-&gt;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-&gt;kindEnum() != MediaSession::Kind::Ambient)
</del><ins>+            if (session-&gt;kind() != MediaSessionKind::Ambient)
</ins><span class="cx">                 session-&gt;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-&gt;kindEnum() == MediaSession::Kind::Default || session-&gt;kindEnum() == MediaSession::Kind::Content)
</del><ins>+            if (session-&gt;kind() == MediaSessionKind::Default || session-&gt;kind() == MediaSessionKind::Content)
</ins><span class="cx">                 session-&gt;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-&gt;kindEnum() != MediaSession::Kind::Ambient)
</del><ins>+            if (session-&gt;kind() != MediaSessionKind::Ambient)
</ins><span class="cx">                 session-&gt;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&amp; ec)
</del><ins>+void MediaSource::endOfStream(Optional&lt;EndOfStreamError&gt; error, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    endOfStream(emptyAtom, ec);
-}
-
-void MediaSource::endOfStream(const AtomicString&amp; error, ExceptionCode&amp; 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 &quot;open&quot; 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&amp; error, ExceptionCode&amp; ec)
</del><ins>+void MediaSource::streamEndedWithError(Optional&lt;EndOfStreamError&gt; error)
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;const AtomicString&gt; network(&quot;network&quot;, AtomicString::ConstructFromLiteral);
-    static NeverDestroyed&lt;const AtomicString&gt; decode(&quot;decode&quot;, AtomicString::ConstructFromLiteral);
</del><ins>+    LOG(MediaSource, &quot;MediaSource::streamEndedWithError(%p)&quot;, this);
</ins><span class="cx"> 
</span><del>-    LOG(MediaSource, &quot;MediaSource::streamEndedWithError(%p) : %s&quot;, 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 &quot;ended&quot;.
</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-&gt;markEndOfStream(MediaSourcePrivate::EosNoError);
</span><del>-    }
-
-    if (error == network) {
</del><ins>+    } else if (error == EndOfStreamError::Network) {
</ins><span class="cx">         // â†³ If error is set to &quot;network&quot;
</span><span class="cx">         ASSERT(m_mediaElement);
</span><span class="cx">         if (m_mediaElement-&gt;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-&gt;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 &quot;decode&quot;
</span><ins>+        ASSERT(error == EndOfStreamError::Decode);
</ins><span class="cx">         ASSERT(m_mediaElement);
</span><span class="cx">         if (m_mediaElement-&gt;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-&gt;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 &quot;sequence&quot;.
</span><span class="cx">     // Otherwise:
</span><span class="cx">     // â†³ Set the mode attribute on the new object to &quot;segments&quot;.
</span><del>-    buffer-&gt;setMode(shouldGenerateTimestamps ? SourceBuffer::sequenceKeyword() : SourceBuffer::segmentsKeyword(), IGNORE_EXCEPTION);
</del><ins>+    buffer-&gt;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&amp;, 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&amp; error, ExceptionCode&amp;);
</del><ins>+    void sourceBufferDidChangeActiveState(SourceBuffer&amp;, bool);
+    void streamEndedWithError(Optional&lt;EndOfStreamError&gt;);
</ins><span class="cx"> 
</span><span class="cx">     // MediaSourcePrivateClient
</span><span class="cx">     void setPrivateAndOpen(Ref&lt;MediaSourcePrivate&gt;&amp;&amp;) override;
</span><span class="lines">@@ -87,8 +88,7 @@
</span><span class="cx">     MediaTime currentTime() const;
</span><span class="cx">     const AtomicString&amp; readyState() const { return m_readyState; }
</span><span class="cx">     void setReadyState(const AtomicString&amp;);
</span><del>-    void endOfStream(ExceptionCode&amp;);
-    void endOfStream(const AtomicString&amp; error, ExceptionCode&amp;);
</del><ins>+    void endOfStream(Optional&lt;EndOfStreamError&gt;, ExceptionCode&amp;);
</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&amp; SourceBuffer::segmentsKeyword()
-{
-    static NeverDestroyed&lt;AtomicString&gt; segments(&quot;segments&quot;);
-    return segments.get();
-}
-
-const AtomicString&amp; SourceBuffer::sequenceKeyword()
-{
-    static NeverDestroyed&lt;AtomicString&gt; segments(&quot;sequence&quot;);
-    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&lt;MediaDescription&gt; 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&lt;SourceBuffer&gt; SourceBuffer::create(Ref&lt;SourceBufferPrivate&gt;&amp;&amp; sourceBufferPrivate, MediaSource* source)
</span><span class="cx"> {
</span><del>-    RefPtr&lt;SourceBuffer&gt; sourceBuffer(adoptRef(new SourceBuffer(WTFMove(sourceBufferPrivate), source)));
</del><ins>+    auto sourceBuffer = adoptRef(*new SourceBuffer(WTFMove(sourceBufferPrivate), source));
</ins><span class="cx">     sourceBuffer-&gt;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&lt;SourceBufferPrivate&gt;&amp;&amp; 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, &amp;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, &amp;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 &quot;sequence&quot;, 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, &quot;SourceBuffer::sourceBufferPrivateDidReceiveRenderingError(%p) - result = %i&quot;, this, error);
</span><span class="cx"> 
</span><span class="cx">     if (!isRemoved())
</span><del>-        m_source-&gt;streamEndedWithError(decodeError(), IgnorableExceptionCode());
</del><ins>+        m_source-&gt;streamEndedWithError(EndOfStreamError::Decode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool decodeTimeComparator(const PresentationOrderSampleMap::MapType::value_type&amp; a, const PresentationOrderSampleMap::MapType::value_type&amp; b)
</span><span class="lines">@@ -926,18 +902,6 @@
</span><span class="cx">     return element-&gt;maximumSourceBufferSize(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const AtomicString&amp; SourceBuffer::decodeError()
-{
-    static NeverDestroyed&lt;AtomicString&gt; decode(&quot;decode&quot;, AtomicString::ConstructFromLiteral);
-    return decode;
-}
-
-const AtomicString&amp; SourceBuffer::networkError()
-{
-    static NeverDestroyed&lt;AtomicString&gt; network(&quot;network&quot;, AtomicString::ConstructFromLiteral);
-    return network;
-}
-
</del><span class="cx"> VideoTrackList* SourceBuffer::videoTracks()
</span><span class="cx"> {
</span><span class="cx">     if (!m_source || !m_source-&gt;mediaElement())
</span><span class="lines">@@ -979,17 +943,9 @@
</span><span class="cx">     m_active = active;
</span><span class="cx">     m_private-&gt;setActive(active);
</span><span class="cx">     if (!isRemoved())
</span><del>-        m_source-&gt;sourceBufferDidChangeAcitveState(this, active);
</del><ins>+        m_source-&gt;sourceBufferDidChangeActiveState(*this, active);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::sourceBufferPrivateDidEndStream(SourceBufferPrivate*, const WTF::AtomicString&amp; error)
-{
-    LOG(MediaSource, &quot;SourceBuffer::sourceBufferPrivateDidEndStream(%p) - result = %s&quot;, this, String(error).utf8().data());
-
-    if (!isRemoved())
-        m_source-&gt;streamEndedWithError(error, IgnorableExceptionCode());
-}
-
</del><span class="cx"> void SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment(SourceBufferPrivate*, const InitializationSegment&amp; 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 &quot;decode&quot;.
</span><span class="cx">     if (decodeErrorParam)
</span><del>-        m_source-&gt;streamEndedWithError(decodeError(), IgnorableExceptionCode());
</del><ins>+        m_source-&gt;streamEndedWithError(EndOfStreamError::Decode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, PassRefPtr&lt;MediaSample&gt; prpSample)
</span><span class="lines">@@ -1374,7 +1330,7 @@
</span><span class="cx">         MediaTime frameDuration = sample-&gt;duration();
</span><span class="cx"> 
</span><span class="cx">         // 1.3 If mode equals &quot;sequence&quot; and group start timestamp is set, then run the following steps:
</span><del>-        if (m_mode == sequenceKeyword() &amp;&amp; m_groupStartTimestamp.isValid()) {
</del><ins>+        if (m_mode == AppendMode::Sequence &amp;&amp; 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) &gt; (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 &quot;segments&quot;:
</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 &quot;sequence&quot;:
</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-&gt;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 &lt; presentationStartTime) {
</span><span class="cx">             LOG(MediaSource, &quot;SourceBuffer::sourceBufferPrivateDidReceiveSample(%p) - failing because presentationTimestamp &lt; presentationStartTime&quot;, this);
</span><del>-            m_source-&gt;streamEndedWithError(decodeError(), IgnorableExceptionCode());
</del><ins>+            m_source-&gt;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&lt;Document&gt;(*scriptExecutionContext());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::setMode(const AtomicString&amp; newMode, ExceptionCode&amp; ec)
</del><ins>+void SourceBuffer::setMode(AppendMode newMode, ExceptionCode&amp; 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 &quot;segments&quot;, then throw an INVALID_ACCESS_ERR exception and abort these steps.
</span><del>-    if (m_shouldGenerateTimestamps &amp;&amp; newMode == segmentsKeyword()) {
</del><ins>+    if (m_shouldGenerateTimestamps &amp;&amp; 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 &quot;sequence&quot;, 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&lt;SourceBuffer&gt;, public ActiveDOMObject, public EventTargetWithInlineData, public SourceBufferPrivateClient, public AudioTrackClient, public VideoTrackClient, public TextTrackClient {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;SourceBuffer&gt; create(Ref&lt;SourceBufferPrivate&gt;&amp;&amp;, MediaSource*);
</span><span class="cx"> 
</span><del>-    static const AtomicString&amp; segmentsKeyword();
-    static const AtomicString&amp; 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&amp; document() const;
</span><span class="cx"> 
</span><del>-    const AtomicString&amp; mode() const { return m_mode; }
-    void setMode(const AtomicString&amp;, ExceptionCode&amp;);
</del><ins>+    AppendMode mode() const { return m_mode; }
+    void setMode(AppendMode, ExceptionCode&amp;);
</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&amp;) override;
</del><span class="cx">     void sourceBufferPrivateDidReceiveInitializationSegment(SourceBufferPrivate*, const InitializationSegment&amp;) override;
</span><span class="cx">     void sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, PassRefPtr&lt;MediaSample&gt;) 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&lt;TextTrackCue&gt;) override;
</span><span class="cx">     void textTrackRemoveCue(TextTrack*, PassRefPtr&lt;TextTrackCue&gt;) override;
</span><span class="cx"> 
</span><del>-    static const WTF::AtomicString&amp; decodeError();
-    static const WTF::AtomicString&amp; networkError();
-
</del><span class="cx">     bool isRemoved() const;
</span><span class="cx">     void scheduleEvent(const AtomicString&amp; eventName);
</span><span class="cx"> 
</span><span class="lines">@@ -206,7 +202,7 @@
</span><span class="cx">     Ref&lt;SourceBufferPrivate&gt; 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&lt;unsigned char&gt; 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 &quot;ContextDestructionObserver.h&quot;
-#include &quot;ScriptWrappable.h&quot;
-#include &lt;wtf/NeverDestroyed.h&gt;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-Ref&lt;MediaDeviceInfo&gt; MediaDeviceInfo::create(ScriptExecutionContext* context, const String&amp; label, const String&amp; deviceId, const String&amp; groupId, const String&amp; kind)
-{
-    return adoptRef(*new MediaDeviceInfo(context, label, deviceId, groupId, kind));
-}
-
-MediaDeviceInfo::MediaDeviceInfo(ScriptExecutionContext* context, const String&amp; label, const String&amp; deviceId, const String&amp; groupId, const String&amp; kind)
</del><ins>+inline MediaDeviceInfo::MediaDeviceInfo(ScriptExecutionContext* context, const String&amp; label, const String&amp; deviceId, const String&amp; 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&amp; MediaDeviceInfo::audioInputType()
</del><ins>+Ref&lt;MediaDeviceInfo&gt; MediaDeviceInfo::create(ScriptExecutionContext* context, const String&amp; label, const String&amp; deviceId, const String&amp; groupId, MediaDeviceKind kind)
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;AtomicString&gt; audioinput(&quot;audioinput&quot;);
-    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&amp; MediaDeviceInfo::audioOutputType()
-{
-    static NeverDestroyed&lt;AtomicString&gt; audiooutput(&quot;audiooutput&quot;);
-    return audiooutput;
-}
-
-const AtomicString&amp; MediaDeviceInfo::videoInputType()
-{
-    static NeverDestroyed&lt;AtomicString&gt; videoinput(&quot;videoinput&quot;);
-    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 &quot;ContextDestructionObserver.h&quot;
</span><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class MediaDeviceInfo : public RefCounted&lt;MediaDeviceInfo&gt;, public ScriptWrappable, public ContextDestructionObserver {
</del><ins>+enum class MediaDeviceKind { Audioinput, Audiooutput, Videoinput };
+
+class MediaDeviceInfo : public RefCounted&lt;MediaDeviceInfo&gt;, public ScriptWrappable, private ContextDestructionObserver {
</ins><span class="cx"> public:
</span><del>-    static Ref&lt;MediaDeviceInfo&gt; create(ScriptExecutionContext*, const String&amp;, const String&amp;, const String&amp;, const String&amp;);
</del><ins>+    static Ref&lt;MediaDeviceInfo&gt; create(ScriptExecutionContext*, const String&amp;, const String&amp;, const String&amp;, MediaDeviceKind);
</ins><span class="cx"> 
</span><del>-    virtual ~MediaDeviceInfo() { }
-    
</del><span class="cx">     const String&amp; label() const { return m_label; }
</span><span class="cx">     const String&amp; deviceId() const { return m_deviceId; }
</span><span class="cx">     const String&amp; groupId() const { return m_groupId; }
</span><del>-    const String&amp; kind() const { return m_kind; }
</del><ins>+    MediaDeviceKind kind() const { return m_kind; }
</ins><span class="cx"> 
</span><del>-    static const AtomicString&amp; audioInputType();
-    static const AtomicString&amp; audioOutputType();
-    static const AtomicString&amp; videoInputType();
-
</del><span class="cx"> private:
</span><del>-    MediaDeviceInfo(ScriptExecutionContext*, const String&amp;, const String&amp;, const String&amp;, const String&amp;);
</del><ins>+    MediaDeviceInfo(ScriptExecutionContext*, const String&amp;, const String&amp;, const String&amp;, 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&lt;RefPtr&lt;MediaDeviceInfo&gt;&gt; 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">     &quot;audioinput&quot;,
</span><span class="cx">     &quot;audiooutput&quot;,
</span><span class="cx">     &quot;videoinput&quot;
</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&lt;RefPtr&lt;MediaDeviceInfo&gt;&gt; devices;
</span><del>-    for (auto deviceInfo : captureDevices) {
-        String deviceType = deviceInfo-&gt;kind() == TrackSourceInfo::SourceKind::Audio ? MediaDeviceInfo::audioInputType() : MediaDeviceInfo::videoInputType();
-        AtomicString label = emptyAtom;
</del><ins>+    for (auto&amp; deviceInfo : captureDevices) {
+        String label = emptyString();
</ins><span class="cx">         if (m_havePersistentPermission || document.hasHadActiveMediaStreamTrack())
</span><span class="cx">             label = deviceInfo-&gt;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-&gt;groupId());
</span><span class="cx"> 
</span><ins>+        auto deviceType = deviceInfo-&gt;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-&gt;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&amp; 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-&gt;remote();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const AtomicString&amp; MediaStreamTrack::readyState() const
</del><ins>+MediaStreamTrackState MediaStreamTrack::readyState() const
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;AtomicString&gt; endedState(&quot;ended&quot;, AtomicString::ConstructFromLiteral);
-    static NeverDestroyed&lt;AtomicString&gt; liveState(&quot;live&quot;, 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 &quot;MediaStreamTrackPrivate.h&quot;
</span><span class="cx"> #include &quot;RealtimeMediaSource.h&quot;
</span><span class="cx"> #include &quot;ScriptWrappable.h&quot;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</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&lt;MediaStreamTrack&gt;, public ActiveDOMObject, public EventTargetWithInlineData, public MediaStreamTrackPrivate::Observer {
</del><ins>+enum class MediaStreamTrackState { New, Live, Ended };
+
+class MediaStreamTrack final : public RefCounted&lt;MediaStreamTrack&gt;, 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&amp; 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&amp; AudioContext::state() const
-{
-    static NeverDestroyed&lt;AtomicString&gt; suspended(&quot;suspended&quot;);
-    static NeverDestroyed&lt;AtomicString&gt; running(&quot;running&quot;);
-    static NeverDestroyed&lt;AtomicString&gt; interrupted(&quot;interrupted&quot;);
-    static NeverDestroyed&lt;AtomicString&gt; closed(&quot;closed&quot;);
-
-    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 &quot;ActiveDOMObject.h&quot;
</span><span class="cx"> #include &quot;AsyncAudioDecoder.h&quot;
</span><span class="lines">@@ -39,7 +38,6 @@
</span><span class="cx"> #include &lt;atomic&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/ThreadSafeRefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/Threading.h&gt;
</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&amp;&amp;);
</span><span class="cx">     void close(Promise&amp;&amp;);
</span><span class="cx"> 
</span><del>-    const AtomicString&amp; 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&lt;AudioBufferSourceNode&gt; 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&lt;AudioContext&gt;::ref;
-    using ThreadSafeRefCounted&lt;AudioContext&gt;::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 &amp; RequireUserGestureForAudioStartRestriction; }
</span><span class="cx">     bool pageConsentRequiredForAudioStart() const { return m_restrictions &amp; 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&amp; lhs, const AudioContext&amp; rhs) {
</del><ins>+// FIXME: Find out why these ==/!= functions are needed and remove them if possible.
+
+inline bool operator==(const AudioContext&amp; lhs, const AudioContext&amp; rhs)
+{
</ins><span class="cx">     return &amp;lhs == &amp;rhs;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline bool operator!=(const AudioContext&amp; lhs, const AudioContext&amp; rhs) {
</del><ins>+inline bool operator!=(const AudioContext&amp; lhs, const AudioContext&amp; rhs)
+{
</ins><span class="cx">     return &amp;lhs != &amp;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 &quot;WaveShaperNode.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AudioContext.h&quot;
</ins><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -53,36 +54,41 @@
</span><span class="cx">     return waveShaperProcessor()-&gt;curve();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WaveShaperNode::setOversample(const String&amp; type, ExceptionCode&amp; 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 == &quot;none&quot;)
-        waveShaperProcessor()-&gt;setOversample(WaveShaperProcessor::OverSampleNone);
-    else if (type == &quot;2x&quot;)
-        waveShaperProcessor()-&gt;setOversample(WaveShaperProcessor::OverSample2x);
-    else if (type == &quot;4x&quot;)
-        waveShaperProcessor()-&gt;setOversample(WaveShaperProcessor::OverSample4x);
-    else
-        ec = INVALID_STATE_ERR;
</del><ins>+    waveShaperProcessor()-&gt;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&lt;WaveShaperNode*&gt;(this)-&gt;waveShaperProcessor()-&gt;oversample()) {
</span><span class="cx">     case WaveShaperProcessor::OverSampleNone:
</span><del>-        return &quot;none&quot;;
</del><ins>+        return OverSampleType::None;
</ins><span class="cx">     case WaveShaperProcessor::OverSample2x:
</span><del>-        return &quot;2x&quot;;
</del><ins>+        return OverSampleType::_2x;
</ins><span class="cx">     case WaveShaperProcessor::OverSample4x:
</span><del>-        return &quot;4x&quot;;
-    default:
-        ASSERT_NOT_REACHED();
-        return &quot;none&quot;;
</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 &quot;AudioBasicProcessorNode.h&quot;
</span><del>-#include &quot;BiquadProcessor.h&quot;
</del><span class="cx"> #include &quot;WaveShaperProcessor.h&quot;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</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&lt;WaveShaperNode&gt; create(AudioContext&amp; 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&amp; , ExceptionCode&amp;);
-    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>-    &quot;AppendMode&quot; =&gt; 1,
-    &quot;AudioContextState&quot; =&gt; 1,
</del><span class="cx">     &quot;AutoFillButtonType&quot; =&gt; 1,
</span><span class="cx">     &quot;CachePolicy&quot; =&gt; 1,
</span><del>-    &quot;CanvasWindingRule&quot; =&gt; 1,
-    &quot;DeviceType&quot; =&gt; 1,
-    &quot;EndOfStreamError&quot; =&gt; 1,
-    &quot;FontFaceSetLoadStatus&quot; =&gt; 1,
-    &quot;IDBCursorDirection&quot; =&gt; 1,
-    &quot;IDBRequestReadyState&quot; =&gt; 1,
-    &quot;IDBTransactionMode&quot; =&gt; 1,
-    &quot;ImageSmoothingQuality&quot; =&gt; 1,
-    &quot;KeyType&quot; =&gt; 1,
-    &quot;KeyUsage&quot; =&gt; 1,
</del><span class="cx">     &quot;MediaControlEvent&quot; =&gt; 1,
</span><del>-    &quot;MediaDeviceKind&quot; =&gt; 1,
</del><span class="cx">     &quot;MediaSessionInterruptingCategory&quot; =&gt; 1,
</span><del>-    &quot;MediaSessionKind&quot; =&gt; 1,
-    &quot;MediaStreamTrackState&quot; =&gt; 1,
-    &quot;OverSampleType&quot; =&gt; 1,
</del><span class="cx">     &quot;PageOverlayType&quot; =&gt; 1,
</span><span class="cx">     &quot;RTCBundlePolicyEnum&quot; =&gt; 1,
</span><span class="cx">     &quot;RTCIceTransportPolicyEnum&quot; =&gt; 1,
</span><span class="lines">@@ -151,10 +135,8 @@
</span><span class="cx">     &quot;RequestRedirect&quot; =&gt; 1,
</span><span class="cx">     &quot;RequestType&quot; =&gt; 1,
</span><span class="cx">     &quot;ResourceLoadPriority&quot; =&gt; 1,
</span><del>-    &quot;ResponseType&quot; =&gt; 1,
</del><span class="cx">     &quot;TextTrackKind&quot; =&gt; 1,
</span><span class="cx">     &quot;TextTrackMode&quot; =&gt; 1,
</span><del>-    &quot;VideoPresentationMode&quot; =&gt; 1,
</del><span class="cx">     &quot;XMLHttpRequestResponseType&quot; =&gt; 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(&quot;\r&quot;, $headerTemplate);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    # - Add header protection
-    push(@headerContentHeader, &quot;\n#ifndef $className&quot; . &quot;_h&quot;);
-    push(@headerContentHeader, &quot;\n#define $className&quot; . &quot;_h\n\n&quot;);
</del><ins>+    push(@headerContentHeader, &quot;\n#pragma once\n\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">     my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($interface);
</span><span class="cx">     push(@headerContentHeader, &quot;#if ${conditionalString}\n\n&quot;) 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 &quot;EmptyString&quot; if $name eq &quot;&quot;;
</span><del>-    return $codeGenerator-&gt;WK_ucfirst($name);
</del><ins>+    $name = join(&quot;&quot;, map { $codeGenerator-&gt;WK_ucfirst($_) } split(&quot;-&quot;, $name));
+    $name = &quot;_$name&quot; 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 = &quot;&quot;;
</span><span class="cx">     foreach my $enumeration (@$enumerations) {
</span><span class="cx">         my $name = $enumeration-&gt;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 &quot;static&quot; because these functions may be unused
-        # and we don't want to get warnings about unused static functions.
-        $result .= &quot;const String&amp; stringValue($className);\n&quot;;
-        $result .= &quot;Optional&lt;$className&gt; enumerationValue$className(const String&amp;);\n\n&quot;;
</del><ins>+        # FIXME: A little ugly to have this be a side effect instead of a return value.
+        AddToImplIncludes(&quot;&lt;runtime/JSString.h&gt;&quot;);
</ins><span class="cx"> 
</span><del>-        $result .= &quot;const String&amp; stringValue($className enumerationValue)\n&quot;;
</del><ins>+        # Declare these instead of using &quot;static&quot; because these may be unused and we don't
+        # want to get warnings about them.
+        $result .= &quot;JSString* jsStringWithCache(ExecState*, $className);\n&quot;;
+        $result .= &quot;Optional&lt;$className&gt; parse$className(ExecState&amp;, JSValue);\n&quot;;
+        $result .= &quot;extern const char expectedEnumerationValues${className}[];\n\n&quot;;
+
+        # Take an ExecState* instead of an ExecState&amp; to match the jsStringWithCache from JSString.h.
+        # FIXME: Change to take VM&amp; instead of ExecState*.
+        $result .= &quot;JSString* jsStringWithCache(ExecState* state, $className enumerationValue)\n&quot;;
</ins><span class="cx">         $result .= &quot;{\n&quot;;
</span><span class="cx">         # FIXME: Might be nice to make this global be &quot;const&quot;, 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-&gt;values}) {
</span><span class="cx">             my $enumerationValueName = GetEnumerationValueName($value);
</span><del>-            if ($index) {
-                $result .= &quot;    static_assert(static_cast&lt;size_t&gt;($className::$enumerationValueName) == $index, \&quot;$className::$enumerationValueName is not $index as expected\&quot;);\n&quot;;
-            } else {
-                # Keep the style checker happy. Not sure I still love this style guideline.
-                $result .= &quot;    static_assert(!static_cast&lt;size_t&gt;($className::$enumerationValueName), \&quot;$className::$enumerationValueName is not $index as expected\&quot;);\n&quot;;
-            }
</del><ins>+            $result .= &quot;    static_assert(static_cast&lt;size_t&gt;($className::$enumerationValueName) == $index, \&quot;$className::$enumerationValueName is not $index as expected\&quot;);\n&quot;;
</ins><span class="cx">             $index++;
</span><span class="cx">         }
</span><span class="cx">         $result .= &quot;    ASSERT(static_cast&lt;size_t&gt;(enumerationValue) &lt; WTF_ARRAY_LENGTH(values));\n&quot;;
</span><del>-        $result .= &quot;    return values[static_cast&lt;size_t&gt;(enumerationValue)];\n&quot;;
</del><ins>+        $result .= &quot;    return jsStringWithCache(state, values[static_cast&lt;size_t&gt;(enumerationValue)]);\n&quot;;
</ins><span class="cx">         $result .= &quot;}\n\n&quot;;
</span><span class="cx"> 
</span><del>-        $result .= &quot;Optional&lt;$className&gt; enumerationValue$className(const String&amp; stringValue)\n&quot;;
</del><ins>+        $result .= &quot;template&lt;&gt; struct JSValueTraits&lt;$className&gt; {\n&quot;;
+        $result .= &quot;    static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, $className value) { return jsStringWithCache(state, value); }\n&quot;;
+        $result .= &quot;};\n\n&quot;;
+
+        # FIXME: Change to take VM&amp; instead of ExecState&amp;.
+        # FIXME: Consider using toStringOrNull to make exception checking faster.
+        # FIXME: Consider finding a more efficient way to match against all the strings quickly.
+        $result .= &quot;Optional&lt;$className&gt; parse$className(ExecState&amp; state, JSValue value)\n&quot;;
</ins><span class="cx">         $result .= &quot;{\n&quot;;
</span><ins>+        $result .= &quot;    auto stringValue = value.toWTFString(&amp;state);\n&quot;;
</ins><span class="cx">         foreach my $value (@{$enumeration-&gt;values}) {
</span><span class="cx">             my $enumerationValueName = GetEnumerationValueName($value);
</span><del>-            $result .= &quot;    if (stringValue == \&quot;$value\&quot;)\n&quot;;
</del><ins>+            if ($value eq &quot;&quot;) {
+                $result .= &quot;    if (stringValue.isEmpty())\n&quot;;
+            } else {
+                $result .= &quot;    if (stringValue == \&quot;$value\&quot;)\n&quot;;
+            }
</ins><span class="cx">             $result .= &quot;        return $className::$enumerationValueName;\n&quot;;
</span><span class="cx">         }
</span><span class="cx">         $result .= &quot;    return Nullopt;\n&quot;;
</span><span class="cx">         $result .= &quot;}\n\n&quot;;
</span><ins>+
+        $result .= &quot;const char expectedEnumerationValues${className}[] = \&quot;\\\&quot;&quot; . join (&quot;\\\&quot;, \\\&quot;&quot;, @{$enumeration-&gt;values}) . &quot;\\\&quot;\&quot;;\n\n&quot;;
</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-&gt;GenerateConditionalString($interface);
</span><del>-    push(@headerContent, &quot;\n} // namespace WebCore\n\n&quot;);
-    push(@headerContent, &quot;#endif // ${conditionalString}\n\n&quot;) if $conditionalString;
-    push(@headerContent, &quot;#endif\n&quot;);
</del><ins>+    push(@headerContent, &quot;\n} // namespace WebCore\n&quot;);
+    push(@headerContent, &quot;\n#endif // ${conditionalString}\n&quot;) if $conditionalString;
</ins><span class="cx"> 
</span><span class="cx">     if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
</span><ins>+        push(@headerContent, &quot;\n&quot;);
</ins><span class="cx">         push(@headerContent, split(&quot;\r&quot;, $endAppleCopyright));
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -2778,8 +2796,8 @@
</span><span class="cx">                     push(@implContent, &quot;    $setter(*state, *castedThis, castedThis-&gt;wrapped(), $eventName, value);\n&quot;);
</span><span class="cx">                 }
</span><span class="cx">                 push(@implContent, &quot;    return true;\n&quot;);
</span><del>-            } elsif ($attribute-&gt;signature-&gt;type =~ /Constructor$/) {
-                my $constructorType = $attribute-&gt;signature-&gt;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-&gt;signature-&gt;extendedAttributes-&gt;{&quot;PutForwards&quot;};
</span><span class="cx">                     if ($putForwards) {
</span><span class="cx">                         my $implGetterFunctionName = $codeGenerator-&gt;WK_lcfirst($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ImplementedAs&quot;} || $name);
</span><del>-                        my $attributeType = $attribute-&gt;signature-&gt;type;
</del><span class="cx">                         if ($attribute-&gt;signature-&gt;isNullable) {
</span><del>-                            push(@implContent, &quot;    RefPtr&lt;${attributeType}&gt; forwardedImpl = castedThis-&gt;wrapped().${implGetterFunctionName}();\n&quot;);
</del><ins>+                            push(@implContent, &quot;    RefPtr&lt;${type}&gt; forwardedImpl = castedThis-&gt;wrapped().${implGetterFunctionName}();\n&quot;);
</ins><span class="cx">                             push(@implContent, &quot;    if (!forwardedImpl)\n&quot;);
</span><span class="cx">                             push(@implContent, &quot;        return false;\n&quot;);
</span><span class="cx">                             push(@implContent, &quot;    auto&amp; impl = *forwardedImpl;\n&quot;);
</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, &quot;    Ref&lt;${attributeType}&gt; forwardedImpl = castedThis-&gt;wrapped().${implGetterFunctionName}();\n&quot;);
</del><ins>+                            push(@implContent, &quot;    Ref&lt;${type}&gt; forwardedImpl = castedThis-&gt;wrapped().${implGetterFunctionName}();\n&quot;);
</ins><span class="cx">                             push(@implContent, &quot;    auto&amp; impl = forwardedImpl.get();\n&quot;);
</span><span class="cx">                         }
</span><del>-                        $attribute = $codeGenerator-&gt;GetAttributeFromInterface($interface, $attribute-&gt;signature-&gt;type, $putForwards);
</del><ins>+                        $attribute = $codeGenerator-&gt;GetAttributeFromInterface($interface, $type, $putForwards);
</ins><span class="cx">                     } else {
</span><span class="cx">                         push(@implContent, &quot;    auto&amp; impl = castedThis-&gt;wrapped();\n&quot;);
</span><span class="cx">                     }
</span><span class="lines">@@ -2827,10 +2844,9 @@
</span><span class="cx">                 if ($attribute-&gt;signature-&gt;extendedAttributes-&gt;{&quot;StrictTypeChecking&quot;}) {
</span><span class="cx">                     $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
</span><span class="cx"> 
</span><del>-                    my $argType = $attribute-&gt;signature-&gt;type;
-                    if ($codeGenerator-&gt;IsWrapperType($argType)) {
-                        push(@implContent, &quot;    if (UNLIKELY(!value.isUndefinedOrNull() &amp;&amp; !value.inherits(JS${argType}::info()))) {\n&quot;);
-                        push(@implContent, &quot;        throwAttributeTypeError(*state, \&quot;$interfaceName\&quot;, \&quot;$name\&quot;, \&quot;$argType\&quot;);\n&quot;);
</del><ins>+                    if ($codeGenerator-&gt;IsWrapperType($type)) {
+                        push(@implContent, &quot;    if (UNLIKELY(!value.isUndefinedOrNull() &amp;&amp; !value.inherits(JS${type}::info()))) {\n&quot;);
+                        push(@implContent, &quot;        throwAttributeTypeError(*state, \&quot;$interfaceName\&quot;, \&quot;$name\&quot;, \&quot;$type\&quot;);\n&quot;);
</ins><span class="cx">                         push(@implContent, &quot;        return false;\n&quot;);
</span><span class="cx">                         push(@implContent, &quot;    };\n&quot;);
</span><span class="cx">                     }
</span><span class="lines">@@ -2840,7 +2856,7 @@
</span><span class="cx">                 push(@implContent, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</span><span class="cx">                 push(@implContent, &quot;        return false;\n&quot;);
</span><span class="cx"> 
</span><del>-                if ($codeGenerator-&gt;IsEnumType($type)) {
</del><ins>+                if ($codeGenerator-&gt;IsStringBasedEnumType($type)) {
</ins><span class="cx">                     my @enumValues = $codeGenerator-&gt;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, &quot;        return false;\n&quot;);
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if ($attribute-&gt;signature-&gt;type eq &quot;double&quot; or $attribute-&gt;signature-&gt;type eq &quot;float&quot;) {
</del><ins>+                if ($codeGenerator-&gt;IsEnumType($type)) {
+                    push (@implContent, &quot;    if (UNLIKELY(!nativeValue))\n&quot;);
+                    push (@implContent, &quot;        return false;\n&quot;);
+                }
+
+                if ($type eq &quot;double&quot; or $type eq &quot;float&quot;) {
</ins><span class="cx">                     push(@implContent, &quot;    if (UNLIKELY(!std::isfinite(nativeValue))) {\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;        throwVMTypeError(state);\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;        return false;\n&quot;);
</span><span class="lines">@@ -2888,8 +2909,10 @@
</span><span class="cx">                     push(@implContent, &quot;    return true;\n&quot;);
</span><span class="cx">                 } else {
</span><span class="cx">                     my ($functionName, @arguments) = $codeGenerator-&gt;SetterExpression(\%implIncludes, $interfaceName, $attribute);
</span><del>-                    if ($codeGenerator-&gt;IsTypedArrayType($attribute-&gt;signature-&gt;type) and not $attribute-&gt;signature-&gt;type eq &quot;ArrayBuffer&quot;) {
</del><ins>+                    if ($codeGenerator-&gt;IsTypedArrayType($type) and not $type eq &quot;ArrayBuffer&quot;) {
</ins><span class="cx">                         push(@arguments, &quot;nativeValue.get()&quot;);
</span><ins>+                    } elsif ($codeGenerator-&gt;IsEnumType($type) and not $codeGenerator-&gt;IsStringBasedEnumType($type)) {
+                        push(@arguments, &quot;nativeValue.value()&quot;);
</ins><span class="cx">                     } else {
</span><span class="cx">                         push(@arguments, &quot;nativeValue&quot;);
</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-&gt;isVariadic;
</span><del>-    return 0 if $codeGenerator-&gt;IsEnumType($type);
</del><ins>+    return 0 if $codeGenerator-&gt;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, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">             }
</span><del>-        } elsif ($codeGenerator-&gt;IsEnumType($argType)) {
</del><ins>+        } elsif ($codeGenerator-&gt;IsStringBasedEnumType($argType)) {
</ins><span class="cx">             $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
</span><span class="cx"> 
</span><span class="cx">             my $exceptionCheck = sub {
</span><span class="lines">@@ -3681,6 +3704,42 @@
</span><span class="cx">                 &amp;$exceptionCheck(&quot;&quot;);
</span><span class="cx">                 &amp;$enumValueCheck(&quot;&quot;);
</span><span class="cx">             }
</span><ins>+        } elsif ($codeGenerator-&gt;IsEnumType($argType)) {
+            my $className = GetEnumerationClassName($argType);
+            $implIncludes{&quot;&lt;runtime/Error.h&gt;&quot;} = 1;
+
+            my $nativeType = $className;
+            my $optionalValue = &quot;optionalValue&quot;;
+            my $defineOptionalValue = &quot;auto optionalValue&quot;;
+            my $indent = &quot;&quot;;
+
+            if ($parameter-&gt;isOptional &amp;&amp; !defined($parameter-&gt;default)) {
+                $nativeType = &quot;Optional&lt;$className&gt;&quot;;
+                $optionalValue = $name;
+                $defineOptionalValue = $name;
+            }
+
+            push(@$outputArray, &quot;    auto ${name}Value = state-&gt;argument($argsIndex);\n&quot;);
+            push(@$outputArray, &quot;    $nativeType $name;\n&quot;);
+
+            if ($parameter-&gt;isOptional) {
+                push(@$outputArray, &quot;    if (${name}Value.isUndefined()) {\n&quot;);
+                if (defined($parameter-&gt;default)) {
+                    my $enumerationValueName = GetEnumerationValueName(substr($parameter-&gt;default, 1, -1));
+                    push(@$outputArray, &quot;        $name = $className::$enumerationValueName;\n&quot;);
+                }
+                push(@$outputArray, &quot;    } else {\n&quot;);
+                $indent = &quot;    &quot;;
+            }
+
+            push(@$outputArray, &quot;$indent    $defineOptionalValue = parse$className(*state, ${name}Value);\n&quot;);
+            push(@$outputArray, &quot;$indent    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
+            push(@$outputArray, &quot;$indent        return JSValue::encode(jsUndefined());\n&quot;);
+            push(@$outputArray, &quot;$indent    if (UNLIKELY(!$optionalValue))\n&quot;);
+            push(@$outputArray, &quot;$indent        return throwArgumentMustBeEnumError(*state, $argsIndex, \&quot;$name\&quot;, \&quot;$interfaceName\&quot;, $quotedFunctionName, expectedEnumerationValues$className);\n&quot;);
+            push(@$outputArray, &quot;$indent    $name = optionalValue.value();\n&quot;) if $optionalValue ne $name;
+
+            push(@$outputArray, &quot;    }\n&quot;) if $indent ne &quot;&quot;;
</ins><span class="cx">         } else {
</span><span class="cx">             # If the &quot;StrictTypeChecking&quot; 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, &quot;\n    // Functions\n&quot;);
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             my @params = @{$function-&gt;parameters};
</span><del>-            if (!$function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Custom&quot;} &amp;&amp;
-                !(GetNativeType($function-&gt;signature-&gt;type) eq &quot;bool&quot;)) {
</del><ins>+            if (!$function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Custom&quot;} &amp;&amp; GetNativeType($function-&gt;signature-&gt;type) ne &quot;bool&quot;) {
</ins><span class="cx">                 push(@headerContent, &quot;    COMPILE_ASSERT(false)&quot;);
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="lines">@@ -3865,10 +3923,10 @@
</span><span class="cx">     push(@headerContent, &quot;JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, $interfaceName*);\n&quot;);
</span><span class="cx">     push(@headerContent, &quot;inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, $interfaceName&amp; impl) { return toJS(state, globalObject, &amp;impl); }\n\n&quot;);
</span><span class="cx"> 
</span><del>-    push(@headerContent, &quot;} // namespace WebCore\n\n&quot;);
</del><ins>+    push(@headerContent, &quot;} // namespace WebCore\n&quot;);
+
</ins><span class="cx">     my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($interface);
</span><del>-    push(@headerContent, &quot;#endif // ${conditionalString}\n\n&quot;) if $conditionalString;
-    push(@headerContent, &quot;#endif\n&quot;);
</del><ins>+    push(@headerContent, &quot;\n#endif // ${conditionalString}\n&quot;) 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, &quot;\n// Functions\n&quot;);
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             my @params = @{$function-&gt;parameters};
</span><del>-            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Custom&quot;} ||
-                !(GetNativeType($function-&gt;signature-&gt;type) eq &quot;bool&quot;)) {
</del><ins>+            if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Custom&quot;} || GetNativeType($function-&gt;signature-&gt;type) ne &quot;bool&quot;) {
</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 &quot;auto&quot; for most of these?
+
</ins><span class="cx">     my $svgNativeType = $codeGenerator-&gt;GetSVGTypeNeedingTearOff($type);
</span><span class="cx">     return &quot;${svgNativeType}*&quot; if $svgNativeType;
</span><span class="cx">     return &quot;RefPtr&lt;DOMStringList&gt;&quot; if $type eq &quot;DOMStringList&quot;;
</span><span class="lines">@@ -4249,7 +4308,7 @@
</span><span class="cx"> 
</span><span class="cx">     return &quot;Vector&lt;&quot; . GetNativeVectorInnerType($arrayOrSequenceType) . &quot;&gt;&quot; if $arrayOrSequenceType;
</span><span class="cx">     return &quot;String&quot; if $codeGenerator-&gt;IsStringBasedEnumType($type);
</span><del>-    return GetEnumerationClassName($type) if $codeGenerator-&gt;IsEnumType($type);
</del><ins>+    return &quot;auto&quot; if $codeGenerator-&gt;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 &quot;${type}*&quot;;
</span><span class="lines">@@ -4416,7 +4475,7 @@
</span><span class="cx"> 
</span><span class="cx">     if ($codeGenerator-&gt;IsEnumType($type)) {
</span><span class="cx">         my $className = GetEnumerationClassName($type);
</span><del>-        return &quot;enumerationValue$className($value.toWTFString(state)).value()&quot;;
</del><ins>+        return &quot;parse$className(*state, $value)&quot;;
</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-&gt;IsEnumType($type)) {
</span><span class="cx">         AddToImplIncludes(&quot;&lt;runtime/JSString.h&gt;&quot;, $conditional);
</span><del>-        $value = &quot;stringValue($value)&quot; unless $codeGenerator-&gt;IsStringBasedEnumType($type);
</del><span class="cx">         return &quot;jsStringWithCache(state, $value)&quot;;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestActiveDOMObject.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestClassWithJSBuiltinConstructor.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestCustomConstructorWithNoInterfaceObject.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestCustomNamedGetter.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestEventConstructor.h&quot;
</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 &quot;JSEventTarget.h&quot;
</span><span class="cx"> #include &quot;TestEventTarget.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestException.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestGenerateIsReachable.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestGlobalObject.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestMediaQueryListListener.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestNamedConstructor.h&quot;
</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 &quot;JSNode.h&quot;
</span><span class="cx"> #include &quot;TestNode.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestNondeterministic.h&quot;
</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&amp; stringValue(TestEnumType);
-Optional&lt;TestEnumType&gt; enumerationValueTestEnumType(const String&amp;);
</del><ins>+JSString* jsStringWithCache(ExecState*, TestEnumType);
+Optional&lt;TestEnumType&gt; parseTestEnumType(ExecState&amp;, JSValue);
+extern const char* const expectedEnumerationValuesTestEnumType;
</ins><span class="cx"> 
</span><del>-const String&amp; stringValue(TestEnumType enumerationValue)
</del><ins>+JSString* jsStringWithCache(ExecState* state, TestEnumType enumerationValue)
</ins><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const String&gt; values[] = {
</span><span class="cx">         ASCIILiteral(&quot;&quot;),
</span><span class="lines">@@ -100,17 +101,22 @@
</span><span class="cx">         ASCIILiteral(&quot;EnumValue2&quot;),
</span><span class="cx">         ASCIILiteral(&quot;EnumValue3&quot;),
</span><span class="cx">     };
</span><del>-    static_assert(!static_cast&lt;size_t&gt;(TestEnumType::EmptyString), &quot;TestEnumType::EmptyString is not 0 as expected&quot;);
</del><ins>+    static_assert(static_cast&lt;size_t&gt;(TestEnumType::EmptyString) == 0, &quot;TestEnumType::EmptyString is not 0 as expected&quot;);
</ins><span class="cx">     static_assert(static_cast&lt;size_t&gt;(TestEnumType::EnumValue1) == 1, &quot;TestEnumType::EnumValue1 is not 1 as expected&quot;);
</span><span class="cx">     static_assert(static_cast&lt;size_t&gt;(TestEnumType::EnumValue2) == 2, &quot;TestEnumType::EnumValue2 is not 2 as expected&quot;);
</span><span class="cx">     static_assert(static_cast&lt;size_t&gt;(TestEnumType::EnumValue3) == 3, &quot;TestEnumType::EnumValue3 is not 3 as expected&quot;);
</span><span class="cx">     ASSERT(static_cast&lt;size_t&gt;(enumerationValue) &lt; WTF_ARRAY_LENGTH(values));
</span><del>-    return values[static_cast&lt;size_t&gt;(enumerationValue)];
</del><ins>+    return jsStringWithCache(state, values[static_cast&lt;size_t&gt;(enumerationValue)]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Optional&lt;TestEnumType&gt; enumerationValueTestEnumType(const String&amp; stringValue)
</del><ins>+template&lt;&gt; struct JSValueTraits&lt;TestEnumType&gt; {
+    static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, TestEnumType value) { return jsStringWithCache(state, value); }
+};
+
+Optional&lt;TestEnumType&gt; parseTestEnumType(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><del>-    if (stringValue == &quot;&quot;)
</del><ins>+    auto stringValue = value.toWTFString(&amp;state);
+    if (stringValue.isEmpty())
</ins><span class="cx">         return TestEnumType::EmptyString;
</span><span class="cx">     if (stringValue == &quot;EnumValue1&quot;)
</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&amp; stringValue(Optional);
-Optional&lt;Optional&gt; enumerationValueOptional(const String&amp;);
</del><ins>+const char* const expectedEnumerationValuesTestEnumType = &quot;\&quot;\&quot;, \&quot;EnumValue1\&quot;, \&quot;EnumValue2\&quot;, \&quot;EnumValue3\&quot;&quot;;
</ins><span class="cx"> 
</span><del>-const String&amp; stringValue(Optional enumerationValue)
</del><ins>+JSString* jsStringWithCache(ExecState*, Optional);
+Optional&lt;Optional&gt; parseOptional(ExecState&amp;, JSValue);
+extern const char* const expectedEnumerationValuesOptional;
+
+JSString* jsStringWithCache(ExecState* state, Optional enumerationValue)
</ins><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const String&gt; values[] = {
</span><span class="cx">         ASCIILiteral(&quot;&quot;),
</span><span class="lines">@@ -132,17 +141,22 @@
</span><span class="cx">         ASCIILiteral(&quot;OptionalValue2&quot;),
</span><span class="cx">         ASCIILiteral(&quot;OptionalValue3&quot;),
</span><span class="cx">     };
</span><del>-    static_assert(!static_cast&lt;size_t&gt;(Optional::EmptyString), &quot;Optional::EmptyString is not 0 as expected&quot;);
</del><ins>+    static_assert(static_cast&lt;size_t&gt;(Optional::EmptyString) == 0, &quot;Optional::EmptyString is not 0 as expected&quot;);
</ins><span class="cx">     static_assert(static_cast&lt;size_t&gt;(Optional::OptionalValue1) == 1, &quot;Optional::OptionalValue1 is not 1 as expected&quot;);
</span><span class="cx">     static_assert(static_cast&lt;size_t&gt;(Optional::OptionalValue2) == 2, &quot;Optional::OptionalValue2 is not 2 as expected&quot;);
</span><span class="cx">     static_assert(static_cast&lt;size_t&gt;(Optional::OptionalValue3) == 3, &quot;Optional::OptionalValue3 is not 3 as expected&quot;);
</span><span class="cx">     ASSERT(static_cast&lt;size_t&gt;(enumerationValue) &lt; WTF_ARRAY_LENGTH(values));
</span><del>-    return values[static_cast&lt;size_t&gt;(enumerationValue)];
</del><ins>+    return jsStringWithCache(state, values[static_cast&lt;size_t&gt;(enumerationValue)]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Optional&lt;Optional&gt; enumerationValueOptional(const String&amp; stringValue)
</del><ins>+template&lt;&gt; struct JSValueTraits&lt;Optional&gt; {
+    static JSString* arrayJSValue(ExecState* state, JSDOMGlobalObject*, Optional value) { return jsStringWithCache(state, value); }
+};
+
+Optional&lt;Optional&gt; parseOptional(ExecState&amp; state, JSValue value)
</ins><span class="cx"> {
</span><del>-    if (stringValue == &quot;&quot;)
</del><ins>+    auto stringValue = value.toWTFString(&amp;state);
+    if (stringValue.isEmpty())
</ins><span class="cx">         return Optional::EmptyString;
</span><span class="cx">     if (stringValue == &quot;OptionalValue1&quot;)
</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 = &quot;\&quot;\&quot;, \&quot;OptionalValue1\&quot;, \&quot;OptionalValue2\&quot;, \&quot;OptionalValue3\&quot;&quot;;
+
</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, &quot;TestObj&quot;, &quot;enumAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;attributeWithReservedEnumType&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;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, &quot;TestObj&quot;, &quot;enumAttr&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    TestEnumType nativeValue = enumerationValueTestEnumType(value.toWTFString(state)).value();
</del><ins>+    auto nativeValue = parseTestEnumType(*state, value);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><del>-    if (nativeValue != &quot;&quot; &amp;&amp; nativeValue != &quot;EnumValue1&quot; &amp;&amp; nativeValue != &quot;EnumValue2&quot; &amp;&amp; nativeValue != &quot;EnumValue3&quot;)
</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, &quot;TestObj&quot;, &quot;attributeWithReservedEnumType&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    Optional nativeValue = enumerationValueOptional(value.toWTFString(state)).value();
</del><ins>+    auto nativeValue = parseOptional(*state, value);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return false;
</span><del>-    if (nativeValue != &quot;&quot; &amp;&amp; nativeValue != &quot;OptionalValue1&quot; &amp;&amp; nativeValue != &quot;OptionalValue2&quot; &amp;&amp; nativeValue != &quot;OptionalValue3&quot;)
</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&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 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-&gt;argument(0).toString(state);
-    auto&amp; enumArg = enumArgString-&gt;value(state);
</del><ins>+    auto enumArgValue = state-&gt;argument(0);
+    TestEnumType enumArg;
+    auto optionalValue = parseTestEnumType(*state, enumArgValue);
</ins><span class="cx">     if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    if (enumArg != &quot;&quot; &amp;&amp; enumArg != &quot;EnumValue1&quot; &amp;&amp; enumArg != &quot;EnumValue2&quot; &amp;&amp; enumArg != &quot;EnumValue3&quot;)
-        return throwArgumentMustBeEnumError(*state, 0, &quot;enumArg&quot;, &quot;TestObj&quot;, &quot;methodWithEnumArg&quot;, &quot;\&quot;\&quot;, \&quot;EnumValue1\&quot;, \&quot;EnumValue2\&quot;, \&quot;EnumValue3\&quot;&quot;);
</del><ins>+    if (!optionalValue)
+        return throwArgumentMustBeEnumError(*state, 0, &quot;enumArg&quot;, &quot;TestObj&quot;, &quot;methodWithEnumArg&quot;, 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, &quot;TestObj&quot;, &quot;methodWithOptionalEnumArgAndDefaultValue&quot;);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><del>-    String enumArg;
-    if (state-&gt;argument(0).isUndefined())
-        enumArg = ASCIILiteral(&quot;EnumValue1&quot;);
-    else {
-        enumArg = state-&gt;uncheckedArgument(0).toWTFString(state);
</del><ins>+    auto enumArgValue = state-&gt;argument(0);
+    TestEnumType enumArg;
+    if (enumArgValue.isUndefined()) {
+        enumArg = TestEnumType::EnumValue1;
+    } else {
+        auto optionalValue = parseTestEnumType(*state, enumArgValue);
</ins><span class="cx">         if (UNLIKELY(state-&gt;hadException()))
</span><span class="cx">             return JSValue::encode(jsUndefined());
</span><del>-        if (enumArg != &quot;&quot; &amp;&amp; enumArg != &quot;EnumValue1&quot; &amp;&amp; enumArg != &quot;EnumValue2&quot; &amp;&amp; enumArg != &quot;EnumValue3&quot;)
-            return throwArgumentMustBeEnumError(*state, 0, &quot;enumArg&quot;, &quot;TestObj&quot;, &quot;methodWithOptionalEnumArgAndDefaultValue&quot;, &quot;\&quot;\&quot;, \&quot;EnumValue1\&quot;, \&quot;EnumValue2\&quot;, \&quot;EnumValue3\&quot;&quot;);
</del><ins>+        if (!optionalValue)
+            return throwArgumentMustBeEnumError(*state, 0, &quot;enumArg&quot;, &quot;TestObj&quot;, &quot;methodWithOptionalEnumArgAndDefaultValue&quot;, 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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestObj.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestOverloadedConstructors.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestOverrideBuiltins.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;TestTypedefs.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;attribute.h&quot;
</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 &quot;JSDOMWrapper.h&quot;
</span><span class="cx"> #include &quot;readonly.h&quot;
</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(&quot;secret&quot;);
-    case CryptoKeyType::Public:
-        return ASCIILiteral(&quot;public&quot;);
-    case CryptoKeyType::Private:
-        return ASCIILiteral(&quot;private&quot;);
-    }
-    RELEASE_ASSERT_NOT_REACHED();
-    return emptyString();
-}
-
</del><span class="cx"> void CryptoKey::buildAlgorithmDescription(CryptoAlgorithmDescriptionBuilder&amp; builder) const
</span><span class="cx"> {
</span><span class="cx">     builder.add(&quot;name&quot;, 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&lt;String&gt; CryptoKey::usages() const
</del><ins>+Vector&lt;KeyUsage&gt; CryptoKey::usages() const
</ins><span class="cx"> {
</span><span class="cx">     // The result is ordered alphabetically.
</span><del>-    Vector&lt;String&gt; result;
</del><ins>+    Vector&lt;KeyUsage&gt; result;
</ins><span class="cx">     if (m_usages &amp; CryptoKeyUsageDecrypt)
</span><del>-        result.append(ASCIILiteral(&quot;decrypt&quot;));
</del><ins>+        result.append(KeyUsage::Decrypt);
</ins><span class="cx">     if (m_usages &amp; CryptoKeyUsageDeriveBits)
</span><del>-        result.append(ASCIILiteral(&quot;deriveBits&quot;));
</del><ins>+        result.append(KeyUsage::DeriveBits);
</ins><span class="cx">     if (m_usages &amp; CryptoKeyUsageDeriveKey)
</span><del>-        result.append(ASCIILiteral(&quot;deriveKey&quot;));
</del><ins>+        result.append(KeyUsage::DeriveKey);
</ins><span class="cx">     if (m_usages &amp; CryptoKeyUsageEncrypt)
</span><del>-        result.append(ASCIILiteral(&quot;encrypt&quot;));
</del><ins>+        result.append(KeyUsage::Encrypt);
</ins><span class="cx">     if (m_usages &amp; CryptoKeyUsageSign)
</span><del>-        result.append(ASCIILiteral(&quot;sign&quot;));
</del><ins>+        result.append(KeyUsage::Sign);
</ins><span class="cx">     if (m_usages &amp; CryptoKeyUsageUnwrapKey)
</span><del>-        result.append(ASCIILiteral(&quot;unwrapKey&quot;));
</del><ins>+        result.append(KeyUsage::UnwrapKey);
</ins><span class="cx">     if (m_usages &amp; CryptoKeyUsageVerify)
</span><del>-        result.append(ASCIILiteral(&quot;verify&quot;));
</del><ins>+        result.append(KeyUsage::Verify);
</ins><span class="cx">     if (m_usages &amp; CryptoKeyUsageWrapKey)
</span><del>-        result.append(ASCIILiteral(&quot;wrapKey&quot;));
-
</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&lt;CryptoKey&gt; {
</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&amp;) const;
</span><del>-    Vector&lt;String&gt; usages() const;
</del><ins>+    Vector&lt;KeyUsage&gt; 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-&gt;status()) {
</span><span class="cx">     case CSSFontFaceSet::Status::Loading:
</span><del>-        return ASCIILiteral(&quot;loading&quot;);
</del><ins>+        return FontFaceSetLoadStatus::Loading;
</ins><span class="cx">     case CSSFontFaceSet::Status::Loaded:
</span><del>-        return ASCIILiteral(&quot;loaded&quot;);
</del><ins>+        return FontFaceSetLoadStatus::Loaded;
</ins><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><del>-    return ASCIILiteral(&quot;loaded&quot;);
</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&lt;FontFaceSet&gt;, private CSSFontFaceSetClient, public EventTargetWithInlineData, private ActiveDOMObject {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;FontFaceSet&gt; create(Document&amp;, const Vector&lt;RefPtr&lt;FontFace&gt;&gt;&amp; initialFaces);
</span><span class="lines">@@ -50,7 +52,7 @@
</span><span class="cx">     void load(JSC::ExecState&amp;, const String&amp; font, const String&amp; text, DeferredWrapper&amp;&amp; promise, ExceptionCode&amp;);
</span><span class="cx">     bool check(const String&amp; font, const String&amp; text, ExceptionCode&amp;);
</span><span class="cx"> 
</span><del>-    String status() const;
</del><ins>+    FontFaceSetLoadStatus status() const;
</ins><span class="cx"> 
</span><span class="cx">     typedef DOMPromise&lt;FontFaceSet&amp;, DOMCoreException&amp;&gt; Promise;
</span><span class="cx">     Promise&amp; promise(JSC::ExecState&amp;);
</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-&gt;addActiveMediaElement(*this);
</span><span class="cx"> 
</span><del>-                if (m_session-&gt;kindEnum() == MediaSession::Kind::Content) {
</del><ins>+                if (m_session-&gt;kind() == MediaSessionKind::Content) {
</ins><span class="cx">                     if (Page* page = document().page())
</span><span class="cx">                         page-&gt;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&amp; presentationModeFullscreen()
</del><ins>+bool HTMLVideoElement::webkitSupportsPresentationMode(VideoPresentationMode mode) const
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;AtomicString&gt; fullscreen(&quot;fullscreen&quot;, AtomicString::ConstructFromLiteral);
-    return fullscreen;
-}
-
-static const AtomicString&amp; presentationModePictureInPicture()
-{
-    static NeverDestroyed&lt;AtomicString&gt; pictureInPicture(&quot;picture-in-picture&quot;, AtomicString::ConstructFromLiteral);
-    return pictureInPicture;
-}
-
-static const AtomicString&amp; presentationModeInline()
-{
-    static NeverDestroyed&lt;AtomicString&gt; inlineMode(&quot;inline&quot;, AtomicString::ConstructFromLiteral);
-    return inlineMode;
-}
-
-bool HTMLVideoElement::webkitSupportsPresentationMode(const String&amp; mode) const
-{
-    if (mode == presentationModeFullscreen())
</del><ins>+    if (mode == VideoPresentationMode::Fullscreen)
</ins><span class="cx">         return mediaSession().fullscreenPermitted(*this) &amp;&amp; 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) &amp;&amp; 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&amp; presentationMode, HTMLMediaElementEnums::VideoFullscreenMode&amp; 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&amp; 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 &lt;&lt; &quot;HTMLVideoElement::webkitSetPresentationMode(&quot; &lt;&lt; this &lt;&lt; &quot;) - setting to \&quot;&quot; &lt;&lt; mode &lt;&lt; &quot;\&quot;&quot;);
-    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 &amp; HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)
+        return VideoPresentationMode::PictureInPicture;
</ins><span class="cx"> 
</span><del>-    if (mode &amp; 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&lt;HTMLVideoElement&gt; create(const QualifiedName&amp;, Document&amp;, bool);
</span><span class="lines">@@ -81,9 +82,9 @@
</span><span class="cx">     RenderPtr&lt;RenderElement&gt; createElementRenderer(RenderStyle&amp;&amp;, const RenderTreePosition&amp;) override;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_PRESENTATION_MODE)
</span><del>-    bool webkitSupportsPresentationMode(const String&amp;) const;
-    void webkitSetPresentationMode(const String&amp;);
-    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 &quot;TextMetrics.h&quot;
</span><span class="cx"> #include &quot;TextRun.h&quot;
</span><span class="cx"> #include &quot;TextStream.h&quot;
</span><del>-
</del><span class="cx"> #include &lt;wtf/CheckedArithmetic.h&gt;
</span><span class="cx"> #include &lt;wtf/MathExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><del>-#if USE(CG)
-#if !PLATFORM(IOS)
</del><ins>+#if USE(CG) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</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 &quot;Settings.h&quot;
</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 = &quot;sans-serif&quot;;
</span><span class="cx"> static const char* const defaultFont = &quot;10px sans-serif&quot;;
</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&amp; windingRuleString, WindRule&amp; windRule)
</del><ins>+static WindRule toWindRule(CanvasWindingRule rule)
</ins><span class="cx"> {
</span><del>-    if (windingRuleString == &quot;nonzero&quot;)
-        windRule = RULE_NONZERO;
-    else if (windingRuleString == &quot;evenodd&quot;)
-        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&amp; 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&amp; 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&amp; path, const String&amp; windingRuleString)
</del><ins>+void CanvasRenderingContext2D::fill(DOMPath&amp; 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&amp; 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&amp; path, const String&amp; windingRuleString)
</del><ins>+void CanvasRenderingContext2D::clip(DOMPath&amp; 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&amp; path, const String&amp; windingRuleString)
</del><ins>+void CanvasRenderingContext2D::fillInternal(const Path&amp; 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-&gt;fillRule();
</span><del>-        WindRule newWindRule = RULE_NONZERO;
-        if (!parseWinding(windingRuleString, newWindRule))
-            return;
-        c-&gt;setFillRule(newWindRule);
</del><ins>+        c-&gt;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&amp; path, const String&amp; windingRuleString)
</del><ins>+void CanvasRenderingContext2D::clipInternal(const Path&amp; 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-&gt;canvasClip(path, newWindRule);
</del><ins>+    c-&gt;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&amp; 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&amp; path, const float x, const float y, const String&amp; windingRuleString)
</del><ins>+bool CanvasRenderingContext2D::isPointInPath(DOMPath&amp; 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&amp; path, const float x, const float y)
</del><ins>+bool CanvasRenderingContext2D::isPointInStroke(DOMPath&amp; 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&amp; path, float x, float y, const String&amp; windingRuleString)
</del><ins>+bool CanvasRenderingContext2D::isPointInPathInternal(const Path&amp; 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&amp; 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(&quot;low&quot;);
-    case SmoothingQuality::Medium:
-        return ASCIILiteral(&quot;medium&quot;);
-    case SmoothingQuality::High:
-        return ASCIILiteral(&quot;high&quot;);
-    }
-
-    ASSERT_NOT_REACHED();
-    return ASCIILiteral(&quot;low&quot;);
</del><ins>+    return state().imageSmoothingQuality;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasRenderingContext2D::setImageSmoothingQuality(const String&amp; smoothingQualityString)
</del><ins>+void CanvasRenderingContext2D::setImageSmoothingQuality(ImageSmoothingQuality quality)
</ins><span class="cx"> {
</span><del>-    SmoothingQuality quality;
-    if (smoothingQualityString == &quot;low&quot;)
-        quality = SmoothingQuality::Low;
-    else if (smoothingQualityString == &quot;medium&quot;)
-        quality = SmoothingQuality::Medium;
-    else if (smoothingQualityString == &quot;high&quot;)
-        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 &quot;AffineTransform.h&quot;
</span><span class="cx"> #include &quot;CanvasPathMethods.h&quot;
</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&amp; winding = ASCIILiteral(&quot;nonzero&quot;));
</del><ins>+    void fill(CanvasWindingRule = CanvasWindingRule::Nonzero);
</ins><span class="cx">     void stroke();
</span><del>-    void clip(const String&amp; winding = ASCIILiteral(&quot;nonzero&quot;));
</del><ins>+    void clip(CanvasWindingRule = CanvasWindingRule::Nonzero);
</ins><span class="cx"> 
</span><del>-    void fill(DOMPath&amp;, const String&amp; winding = ASCIILiteral(&quot;nonzero&quot;));
</del><ins>+    void fill(DOMPath&amp;, CanvasWindingRule = CanvasWindingRule::Nonzero);
</ins><span class="cx">     void stroke(DOMPath&amp;);
</span><del>-    void clip(DOMPath&amp;, const String&amp; winding = ASCIILiteral(&quot;nonzero&quot;));
</del><ins>+    void clip(DOMPath&amp;, CanvasWindingRule = CanvasWindingRule::Nonzero);
</ins><span class="cx"> 
</span><del>-    bool isPointInPath(const float x, const float y, const String&amp; winding = ASCIILiteral(&quot;nonzero&quot;));
-    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&amp;, const float x, const float y, const String&amp; winding = ASCIILiteral(&quot;nonzero&quot;));
-    bool isPointInStroke(DOMPath&amp;, const float x, const float y);
</del><ins>+    bool isPointInPath(DOMPath&amp;, float x, float y, CanvasWindingRule = CanvasWindingRule::Nonzero);
+    bool isPointInStroke(DOMPath&amp;, 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&amp;);
</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&lt;float&gt; 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&amp;, const String&amp; winding);
</del><ins>+    void fillInternal(const Path&amp;, CanvasWindingRule);
</ins><span class="cx">     void strokeInternal(const Path&amp;);
</span><del>-    void clipInternal(const Path&amp;, const String&amp; winding);
</del><ins>+    void clipInternal(const Path&amp;, CanvasWindingRule);
</ins><span class="cx"> 
</span><del>-    bool isPointInPathInternal(const Path&amp;, float x, float y, const String&amp; winding);
</del><ins>+    bool isPointInPathInternal(const Path&amp;, float x, float y, CanvasWindingRule);
</ins><span class="cx">     bool isPointInStrokeInternal(const Path&amp;, float x, float y);
</span><span class="cx"> 
</span><span class="cx">     void drawFocusIfNeededInternal(const Path&amp;, 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-&gt;mediaControlsHost()) {
</span><del>-            static NeverDestroyed&lt;String&gt; airplay(ASCIILiteral(&quot;airplay&quot;));
-            static NeverDestroyed&lt;String&gt; tvout(ASCIILiteral(&quot;tvout&quot;));
-
-            String type = m_mediaElement-&gt;mediaControlsHost()-&gt;externalDeviceType();
-            if (type == airplay)
</del><ins>+            auto type = m_mediaElement-&gt;mediaControlsHost()-&gt;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-&gt;mediaControlsHost()-&gt;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&amp;) = 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  &lt;darin@apple.com&gt;
+
+        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  &lt;svijayaraghavan@apple.com&gt;
</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">      [&quot;-readability/naming&quot;,
</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">     &quot;LayoutTests&quot; + 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>