<!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>[210319] trunk/Source</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/210319">210319</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2017-01-04 22:45:48 -0800 (Wed, 04 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove PassRefPtr use from the &quot;html&quot; directory, other improvements
https://bugs.webkit.org/show_bug.cgi?id=166635

Reviewed by Alex Christensen.

Source/WebCore:

* CMakeLists.txt: Removed the duplicate copies of all the WebGL-specific files
in the main list of source files; there is no value in listing them twice.
Replaced WebGLGetInfo.cpp with WebGLAny.cpp.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::removeSourceBuffer): Updates since the tracks functions
return references now.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): Removed
unneeded SourceBufferPrivate* argument.
(WebCore::SourceBuffer::appendBufferTimerFired): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Ditto.
(WebCore::SourceBuffer::videoTracks): Return a reference rather than a pointer.
(WebCore::SourceBuffer::audioTracks): Ditto.
(WebCore::SourceBuffer::textTracks): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
Removed unneeded SourceBufferPrivate* argument.
(WebCore::SourceBuffer::validateInitializationSegment): Updated since tracks
functions now return a pointer.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Removed unneeded
SourceBufferPrivate* argument.
(WebCore::SourceBuffer::sourceBufferPrivateHasAudio): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateHasVideo): Ditto.
(WebCore::SourceBuffer::videoTrackSelectedChanged): Take a reference rather than
a pointer.
(WebCore::SourceBuffer::audioTrackEnabledChanged): Ditto.
(WebCore::SourceBuffer::textTrackModeChanged): Ditto.
(WebCore::SourceBuffer::textTrackAddCue): Ditto.
(WebCore::SourceBuffer::textTrackAddCues): Ditto.
(WebCore::SourceBuffer::textTrackRemoveCue): Ditto.
(WebCore::SourceBuffer::textTrackRemoveCues): Ditto.
(WebCore::SourceBuffer::textTrackKindChanged): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples): Ditto.
(WebCore::SourceBuffer::provideMediaData): Ditto.
(WebCore::SourceBuffer::reenqueueMediaForTime): Ditto.
* Modules/mediasource/SourceBuffer.h: Updated for above changes.

* WebCore.xcodeproj/project.pbxproj: Replaced WebGLGetInfo with WebGLAny.

* bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::toHTMLCanvasStyle): Removed explicit cast to CanvasStyle and unneeded
conversion to a pointer since CanvasStyle constructors now take references.

* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginInstance): Updated since bindingsInstance now returns a raw pointer.
(WebCore::pluginScriptObject): Ditto.

* bindings/js/JSWebGL2RenderingContextCustom.cpp:
(WebCore::toJS): Moved to WebGLAny.h/cpp.
(WebCore::JSWebGL2RenderingContext::getIndexedParameter): Updated since the toJS
function in WebGLAny.h takes references, not pointers.

* bindings/js/JSWebGLRenderingContextBaseCustom.cpp: Removed quite a few unneeded
includes and got rid of a lot of unneeded JSC prefixes.
(WebCore::toJS): Moved to WebGLAny.h/cpp.
(WebCore::toJSNewlyCreated):
(WebCore::objectParameter): Renamed from getObjectParameter and also changed to
take a pointer to member function so we don't need an enum and a switch statement.
(WebCore::toJS): Changed to take references rather than pointers.
(WebCore::JSWebGLRenderingContextBase::getAttachedShaders): Use a modern for loop.
(WebCore::JSWebGLRenderingContextBase::getBufferParameter): Use objectParameter.
(WebCore::JSWebGLRenderingContextBase::getRenderbufferParameter): Ditto.
(WebCore::JSWebGLRenderingContextBase::getVertexAttrib): Ditto.
(WebCore::toNumberVector): Renamed from toVector, since this is specifically for
vectors of numbers. Use uncheckedAppend instead of assignment.
(WebCore::functionForUniform): Marked this inline.
(WebCore::dataFunctionf): Updated for above changes.
(WebCore::dataFunctioni): Ditto.
(WebCore::dataFunctionMatrix): Ditto.

* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::fetch): Moved assertions to the top of the function.
Also added a FIXME because it's unclear why these assertions are correct. Updated
to use downcastScriptElement instead of toScriptElementIfPossible.

* dom/Document.h: Sorted list of forward-declared classes. Removed duplicate
forward declaration of ScriptModuleLoader.

* dom/PendingScript.cpp:
(WebCore::PendingScript::create): Take a ScriptElement instead of an Element.
(WebCore::PendingScript::PendingScript): Ditto.
(WebCore::PendingScript::loadableScript): Moved inline to header and made inline.
(WebCore::PendingScript::setClient): Take a reference instead of a pointer.
* dom/PendingScript.h: UPdated for above changes.

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::prepareScript): Pass a reference instead of a pointer.
(WebCore::ScriptElement::ref): Added. Forwards ref/deref to the underlying element
so we can use Ref and RefPtr with this class.
(WebCore::ScriptElement::deref): Ditto.
(WebCore::isScriptElement): Added. Replaces one of the two uses of
toScriptElementIfPossible, and is similar in style to is&lt;Element&gt;.
(WebCore::downcastScriptElement): Ditto, but for downcast.
* dom/ScriptElement.h: Updated for above changes.

* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::queueScriptForExecution): Take reference rather than
pointer, and pass ScriptElement rather than Element.
(WebCore::ScriptRunner::notifyFinished): Ditto.
(WebCore::ScriptRunner::timerFired): Ditto.
* dom/ScriptRunner.h: Updated for above changes.

* html/FileInputType.cpp:
(WebCore::FileInputType::files): Updated since m_fileList is a Ref.
(WebCore::FileInputType::createFileList): Updated to return a Ref instead of
a PassRefPtr. Also use reserveInitialCapacity/uncheckedAppend.
(WebCore::FileInputType::requestIcon): Updated since the updateRendering
function is now called iconLoaded. Also use references instead of pointers.
(WebCore::FileInputType::setFiles): Take a RefPtr&amp;&amp; insted of a PassRefPtr.
Also put some conditional code inside an #if.
(WebCore::FileInputType::filesChosen): Updated for function name change.
(WebCore::FileInputType::iconLoaded): Renamed from updateRendering.
Changed argument to RefPtr&amp;&amp; from PassRefPtr.
(WebCore::FileInputType::defaultToolTip): Got rid of unneeded local variable
and used the correct type, unsigned, rather than size_t.
* html/FileInputType.h: Updated for the above changes, use final instead
of override, and use Ref instead of RefPtr.

* html/HTMLElement.cpp:
(WebCore::HTMLElement::form): Renamed from virtualForm.
* html/HTMLElement.h: Replaced the form/virtualForm pair of functions with
just a form function. The old design dates back before we had &quot;final&quot; for
virtual functions, and now we can just use that instead.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::virtualForm): Deleted.
* html/HTMLFormControlElement.h: Mark the form function final, since it's
now both an inline function in this class, and an override of a virtual
function inherited from the base class. Deleted the virtualForm function.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultEventHandler): Removed use of the
formForSubmission function, which was just another way to get the same
thing as the form function; perhaps they were different in the past.
(WebCore::HTMLInputElement::setFiles): Take a RefPtr&amp;&amp; rather than a PassRefPtr.
* html/HTMLInputElement.h: Updated for the above.

* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::control): Made this const.
(WebCore::HTMLLabelElement::form): Made this const, so it can be used to
override the const form function from the base class.
* html/HTMLLabelElement.h: Marked the form function final, since we want it
to override the form function inherited from HTMLElement.

* html/HTMLLegendElement.cpp:
(WebCore::HTMLLegendElement::form): Renamed from virtualForm.
* html/HTMLLegendElement.h: Override form instead of virtualForm and mark it final
This makes things more efficient if someone calls form directly on this class;
before it would make an unnecessary virtual function call.

* html/HTMLMediaElement.cpp:
(WebCore::TrackDisplayUpdateScope::TrackDisplayUpdateScope): Take a reference
rather than a pointer.
(WebCore::TrackDisplayUpdateScope::~TrackDisplayUpdateScope): Ditto.
(WebCore::eventTimeCueCompare): Compare the cues the same way the cue list would
rather than using cueIndex.
(WebCore::HTMLMediaElement::audioTrackEnabledChanged): Take a reference.
(WebCore::HTMLMediaElement::textTrackModeChanged): Ditto.
(WebCore::HTMLMediaElement::videoTrackSelectedChanged): Ditto.
(WebCore::HTMLMediaElement::textTrackKindChanged): Ditto.
(WebCore::HTMLMediaElement::textTrackAddCues): Ditto.
(WebCore::HTMLMediaElement::textTrackRemoveCues): Ditto.
(WebCore::HTMLMediaElement::textTrackAddCue): Ditto.
(WebCore::HTMLMediaElement::textTrackRemoveCue): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Pass references.
(WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Ditto.
(WebCore::HTMLMediaElement::removeTextTrack): Ditto.
(WebCore::HTMLMediaElement::forgetResourceSpecificTracks): Ditto.
(WebCore::HTMLMediaElement::setController): Take a RefPtr&amp;&amp; instead of PassRefPtr.
* html/HTMLMediaElement.h: Updated for above changes.

* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::virtualForm): Deleted.
* html/HTMLObjectElement.h: Made the form function inline and final, which
achieves the same thing we did before with using, but without requiring the
separate virtualForm function, now deleted.

* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::collectOptionInnerText): Use isScriptElement
instead of toScriptElementIfPossible.

* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::bindingsInstance): Renamed from getInstance and
changed the return type to a raw pointer.
* html/HTMLPlugInElement.h: Updated for the above changes. Also changed the
updateSnapshot function to take a raw pointer instead of a PassRefPtr.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::createElementRenderer): Pass a pointer
to updateSnapshot.
(WebCore::HTMLPlugInImageElement::updateSnapshot): Updated to take a raw
pointer instead of a PassRefPtr.
* html/HTMLPlugInImageElement.h: Updated for above changes.

* html/HTMLScriptElement.h: Added using to resolve the ambiguity with the
ref/deref from HTMLElement and from ScriptElement.

* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::selection): Return a RefPtr instead
of a PassRefPtr.
* html/HTMLTextFormControlElement.h: Updated for above changes.

* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::textTrackKindChanged): Take a reference.
(WebCore::HTMLTrackElement::textTrackModeChanged): Ditto.
(WebCore::HTMLTrackElement::textTrackAddCues): Ditto.
(WebCore::HTMLTrackElement::textTrackRemoveCues): Ditto.
(WebCore::HTMLTrackElement::textTrackAddCue): Ditto.
(WebCore::HTMLTrackElement::textTrackRemoveCue): Ditto.
* html/HTMLTrackElement.h: Updated for above changes.

* html/InputType.cpp:
(WebCore::InputType::formForSubmission): Deleted.
(WebCore::InputType::setFiles): Take a RefPtr&amp;&amp; instead of a PassRefPtr.
* html/InputType.h: Updated for above changes.

* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure): Pass a reference.
(WebCore::PluginDocument::setPluginElement): Take a reference rather than
a PassRefPtr.
* html/PluginDocument.h: Updated for above changes.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setStrokeStyle): Pass a reference.
(WebCore::CanvasRenderingContext2D::setFillStyle): Ditto.
(WebCore::CanvasRenderingContext2D::drawTextInternal): Ditto.

* html/canvas/CanvasStyle.cpp:
(WebCore::CanvasStyle::CanvasStyle): Rewrite all constructors to use the
m_style variant instead of separate m_type and other data members. Also
change from PassRefPtr to a reference.
(WebCore::CanvasStyle::createFromString): Update to use the variant.
(WebCore::CanvasStyle::createFromStringWithOverrideAlpha): Ditto.
(WebCore::CanvasStyle::isEquivalentColor): Ditto.
(WebCore::CanvasStyle::isEquivalentRGBA): Ditto.
(WebCore::CanvasStyle::isEquivalentCMYKA): Ditto.
(WebCore::CanvasStyle::CanvasStyle): Deleted copy constructor; the compiler
can now generate a correct copy or move constructor.
(WebCore::CanvasStyle::~CanvasStyle): Deleted. Compiler generates this
properly now without help from us.
(WebCore::CanvasStyle::operator=): Deleted. The compiler can now generate
a correct copy of move assignment operator.
(WebCore::CanvasStyle::applyStrokeColor): Updated to take a reference and
use the variant.
(WebCore::CanvasStyle::applyFillColor): Ditto.

* html/canvas/CanvasStyle.h: Redid this class to use a variant instead of
a type enumeration and a union.

* html/canvas/OESVertexArrayObject.cpp:
(WebCore::OESVertexArrayObject::createVertexArrayOES): Updated use of enum
since it's now an enum class.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::WebGL2RenderingContext): Use Ref&amp;&amp; instead of
RefPtr&amp;&amp; for the GraphicsContext3D.
(WebCore::WebGL2RenderingContext::initializeVertexArrayObjects): Updated enum
and also use references.
(WebCore::WebGL2RenderingContext::getInternalformatParameter): Use nullptr to
return null rather than the old idiom (default-constructed WebGLGetInfo).
(WebCore::WebGL2RenderingContext::texStorage2D): Ditto.
(WebCore::WebGL2RenderingContext::getQueryParameter): Ditto.
(WebCore::WebGL2RenderingContext::getSamplerParameter): Ditto.
(WebCore::WebGL2RenderingContext::getSyncParameter): Ditto.
(WebCore::WebGL2RenderingContext::getIndexedParameter): Ditto.
(WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter): Ditto.
(WebCore::WebGL2RenderingContext::getActiveUniformBlockName): Ditto.
(WebCore::WebGL2RenderingContext::createVertexArray): Updated enum and also
use reference.
(WebCore::WebGL2RenderingContext::getExtension): Rearranged logic in three ways:
(1) Moved checks for whether an extension is supported inside the case for that
extension, rather than combining the extension name check with the extensions
enabled check. (2) Used the new enableSupportedExtension function to simplify
many of the checks to avoid repeating the extension name twice. (3) Changed the
idiom so we set the pointers to nullptr explicitly, preparing for a future where
we might make the extension pointers use std::optional so we can cache a negative
for each extension too, not just a positive result.
(WebCore::WebGL2RenderingContext::getSupportedExtensions): Use ASCIILiteral.
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter): Use nullptr
as above. For non-null types, return the object without converting, letting the
WebGLAny class handle things, except for enumerations, which we need to explicitly
static_cast to an integral type, and things that will be stored in the variant in
a RefPtr, where we use makeRefPtr.
(WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters):
Simplified and clarified the handling of COLOR_ATTACHMENT.
(WebCore::WebGL2RenderingContext::getParameter): Return WebGLAny, same idiom as
described above for getFramebufferAttachmentParameter.
* html/canvas/WebGL2RenderingContext.h: Updated for above changes.

* html/canvas/WebGLAny.cpp: Added.
(WebCore::toJS): Handles conversion to JavaScript types. This function is based
on the existing toJS functions from the two classes that were using WebGLGetInfo.
Eventually we can probably just get the bindings to automatically generate this,
but there is some work to do to get to that point.
* html/canvas/WebGLAny.h: Added. This type, a variant, replaces the WebGLGetInfo
class. Also includes the toJS function, which is the real point of this type, since
it's about returning a variant mapped appropriately to JavaScript types.

* html/canvas/WebGLContextGroup.cpp:
(WebCore::WebGLContextGroup::getAGraphicsContext3D): Changed to return a reference.
Droped unnecessary local variable with a long type name.
(WebCore::WebGLContextGroup::addContext): Take a reference.
(WebCore::WebGLContextGroup::removeContext): Ditto.
(WebCore::WebGLContextGroup::removeObject): Ditto.
(WebCore::WebGLContextGroup::addObject): Ditto.
(WebCore::WebGLContextGroup::detachAndRemoveAllObjects): Dropped unnecessary
local variable with a long type name.
* html/canvas/WebGLContextGroup.h: Updated for above changes.

* html/canvas/WebGLContextObject.cpp:
(WebCore::WebGLContextObject::~WebGLContextObject): Pass references.
(WebCore::WebGLContextObject::detachContext): Ditto.

* html/canvas/WebGLGetInfo.cpp: Removed.
* html/canvas/WebGLGetInfo.h: Removed.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::WebGLRenderingContext): Take a Ref&amp;&amp; instead
of as PassRefPtr.
(WebCore::WebGLRenderingContext::initializeVertexArrayObjects): Updated enum
and also use references.
(WebCore::WebGLRenderingContext::getExtension): Rearranged logic in three ways:
(1) Moved checks for whether an extension is supported inside the case for that
extension, rather than combining the extension name check with the extensions
enabled check. (2) Used the new enableSupportedExtension function to simplify
many of the checks to avoid repeating the extension name twice. (3) Changed the
idiom so we set the pointers to nullptr explicitly, preparing for a future where
we might make the extension pointers use std::optional so we can cache a negative
for each extension too, not just a positive result.
(WebCore::WebGLRenderingContext::getSupportedExtensions): Use ASCIILiteral.
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): Use nullptr
as above. For non-null types, return the object without converting, letting the
WebGLAny class handle things, except for enumerations, which we need to explicitly
static_cast to an integral type, and things that will be stored in the variant in
a RefPtr, where we use makeRefPtr.
(WebCore::WebGLRenderingContext::validateFramebufferFuncParameters):
Simplified and clarified the handling of COLOR_ATTACHMENT adding a FIXME about
something questionable.
(WebCore::WebGLRenderingContext::getParameter): Return WebGLAny, same idiom as
described above for getFramebufferAttachmentParameter.
* html/canvas/WebGLRenderingContext.h: Updated for above changes.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create): Updated to pass references
instead of pointers in a couple cases
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): Changed graphics
context argument type from RefPtr&amp;&amp; to Ref&amp;&amp;. Also moved initialization of scalars
from the constructor to the class definition.
(WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase): Pass a reference.
(WebCore::WebGLRenderingContextBase::createBuffer): Pass a reference instead of a pointer.
(WebCore::WebGLRenderingContextBase::createFramebuffer): Ditto.
(WebCore::WebGLRenderingContextBase::createTexture): Ditto.
(WebCore::WebGLRenderingContextBase::createProgram): Ditto.
(WebCore::WebGLRenderingContextBase::createRenderbuffer): Ditto.
(WebCore::WebGLRenderingContextBase::createShader): Ditto.
(WebCore::WebGLRenderingContextBase::deleteBuffer): Ditto.
(WebCore::WebGLRenderingContextBase::getBufferParameter): Update to use WebGLAny.
(WebCore::WebGLRenderingContextBase::getProgramParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getRenderbufferParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getShaderParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getTexParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getUniform): Ditto.
(WebCore::WebGLRenderingContextBase::getVertexAttrib): Ditto.
(WebCore::WebGLRenderingContextBase::getVertexAttribOffset): Removed unnneed
type casts.
(WebCore::WebGLRenderingContextBase::vertexAttribPointer): Pass a reference.
(WebCore::WebGLRenderingContextBase::removeSharedObject): Take a reference.
(WebCore::WebGLRenderingContextBase::addSharedObject): Ditto.
(WebCore::WebGLRenderingContextBase::removeContextObject): Ditto.
(WebCore::WebGLRenderingContextBase::addContextObject): Ditto.
(WebCore::WebGLRenderingContextBase::getBooleanParameter): Changed return type;
connversion to WebGLAny can happen at the point of use.
(WebCore::WebGLRenderingContextBase::getBooleanArrayParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getFloatParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getIntParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getUnsignedIntParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getInt64Parameter): Ditto.
(WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter): Ditto.
(WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter): Ditto.
(WebCore::WebGLRenderingContextBase::validateBufferDataParameters): Use
optional to simplify logic and get rid of a boolean.
(WebCore::WebGLRenderingContextBase::enableSupportedExtension): Added.
Helper used by the getExtension functions.
* html/canvas/WebGLRenderingContextBase.h: Updated for the above changes.
Also changed setBoundVertexArrayObject to take a raw pointer instead of
as PassRefPtr.

* html/canvas/WebGLSharedObject.cpp:
(WebCore::WebGLSharedObject::~WebGLSharedObject): Pass a reference.
(WebCore::WebGLSharedObject::detachContextGroup): Ditto.
(WebCore::WebGLSharedObject::getAGraphicsContext3D): Updated since the
underlying getAGraphicsContext3D function now returns a reference.

* html/canvas/WebGLSharedObject.h: Removed many unused &quot;is&quot; virtual functions.
* html/canvas/WebGLTransformFeedback.h: Ditto.

* html/canvas/WebGLVertexArrayObject.cpp:
(WebCore::WebGLVertexArrayObject::create): Updated for new type enumeration.
(WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): Ditto.
(WebCore::WebGLVertexArrayObject::deleteObjectImpl): Ditto.
* html/canvas/WebGLVertexArrayObject.h: Updated for above changes.

* html/canvas/WebGLVertexArrayObjectBase.cpp:
(WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase): Updated for new
type enumeration and moved initialization to class definition.
(WebCore::WebGLVertexArrayObjectBase::setElementArrayBuffer): Changed argument to
raw pointer instead of PassRefPtr.
(WebCore::WebGLVertexArrayObjectBase::setVertexAttribState): Changed argument to
reference instead of PassRefPtr.
(WebCore::WebGLVertexArrayObjectBase::unbindBuffer): Changed arugment type to
reference instead of PassRefPtr.
(WebCore::WebGLVertexArrayObjectBase::setVertexAttribDivisor): Removed unneeded
local variable.
* html/canvas/WebGLVertexArrayObjectBase.h: Updated for above changes.
Replaced VAOType with Type. Used class member initialization.

* html/canvas/WebGLVertexArrayObjectOES.cpp:
(WebCore::WebGLVertexArrayObjectOES::create): Updated for new type enumeration.
(WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES): Ditto.
(WebCore::WebGLVertexArrayObjectOES::~WebGLVertexArrayObjectOES) Ditto.:
(WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl): Ditto.
* html/canvas/WebGLVertexArrayObjectOES.h: Updated for above changes.

* html/forms/FileIconLoader.cpp:
(WebCore::FileIconLoader::iconLoaded): Renamed from notifyFinished. Also changed
the name of the function this calls to iconLoaded. Changed the arguemnt to
RefPtr&amp;&amp; instead of PassRefPtr.
* html/forms/FileIconLoader.h: Updated for above changes.

* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::attachLater): Use isScriptElement instead of
toScriptElementIfPossible.
(WebCore::HTMLConstructionSite::insertForeignElement): Ditto.

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Pass script
element as a Ref rather than RefPtr.
(WebCore::HTMLDocumentParser::watchForLoad): Pass a reference instead of a pointer.

* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::executeParsingBlockingScript): Deleted. Moved the code
into the single call site, execute ParsingBlockingScripts.
(WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Changed argument
type to a reference from a RefPtr; this funtion was not taking ownership. Also remove
call to toScriptElementIfPossible,
since pending scripts now contains script elements already.
(WebCore::HTMLScriptRunner::execute): Changed argument type to Ref&lt;ScriptElement&gt;&amp;&amp;
from PassRefPtr&lt;Element&gt;.
(WebCore::HTMLScriptRunner::executeParsingBlockingScripts): Moved code here from
executeParsingBlockingScript. Also pass a reference.
(WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing): Pass a reference.
(WebCore::requestPendingScript): Changed argument type to ScriptElement&amp; from
Element*.
(WebCore::HTMLScriptRunner::requestParsingBlockingScript): Ditto.
(WebCore::HTMLScriptRunner::requestDeferredScript): Ditto.
(WebCore::HTMLScriptRunner::runScript): Ditto.
* html/parser/HTMLScriptRunner.h: Updated for above changes.

* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::takeScriptToProcess): Changed return type from
RefPtr&lt;Element&gt; to RefPtr&lt;ScriptElement&gt;.
(WebCore::HTMLTreeBuilder::processEndTag): Downcast the script element to
HTMLScriptElement so we can store it as a ScriptElement.
(WebCore::HTMLTreeBuilder::processTokenInForeignContent): Downcast the script
element to SVGScriptElement so we can store it as a script element.
* html/parser/HTMLTreeBuilder.h: Updated for above changes. Changed the type
of m_scriptToProcess to RefPtr&lt;ScriptElement&gt;.

* html/parser/TextDocumentParser.cpp: Added now-needed include.

* html/parser/XSSAuditorDelegate.cpp:
(WebCore::XSSAuditorDelegate::generateViolationReport): Changed return type
to Ref from PassRefPtr.
* html/parser/XSSAuditorDelegate.h: Updated for above.

* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::AudioTrack): Take references.
(WebCore::AudioTrack::setPrivate): Ditto.
(WebCore::AudioTrack::setEnabled): Removed redundant code to do what the
private setEnabled function is already going to do.
(WebCore::AudioTrack::inbandTrackIndex): Removed assertion since m_private
is now a Ref rather than RefPtr.
(WebCore::AudioTrack::enabledChanged): Added an early exit so we will only
call audioTrackEnabledChanged if m_enabled is actually changing. Also removed
the unneeded track private argument.
(WebCore::AudioTrack::idChanged): Ditto.
(WebCore::AudioTrack::labelChanged): Ditto.
(WebCore::AudioTrack::languageChanged): Ditto.
(WebCore::AudioTrack::willRemove): Ditto.
* html/track/AudioTrack.h: Updated for above changes.

* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::addDataCue): Removed inband text track private
argument. Use contains instead of find/end.
(WebCore::InbandDataTextTrack::updateDataCue): Ditto. Use get instead of find/end.
(WebCore::InbandDataTextTrack::removeDataCue): Ditto.
* html/track/InbandDataTextTrack.h: Updated for above changes.

* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::InbandGenericTextTrack): Take references.
(WebCore::InbandGenericTextTrack::create): Ditto.
(WebCore::InbandGenericTextTrack::updateCueFromCueData): Ditto.
(WebCore::InbandGenericTextTrack::addGenericCue): Ditto. Also removed unused
track private argument.
(WebCore::InbandGenericTextTrack::updateGenericCue): Ditto.
(WebCore::InbandGenericTextTrack::removeGenericCue): Ditto.
(WebCore::InbandGenericTextTrack::parseWebVTTCueData): Ditto.
(WebCore::InbandGenericTextTrack::parseWebVTTFileHeader): Ditto.
(WebCore::InbandGenericTextTrack::newRegionsParsed): Pass a reference.
* html/track/InbandGenericTextTrack.h: Updated for above changes.

* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::create): Return a Ref instead of a PassRefPtr. Take
references.
(WebCore::InbandTextTrack::InbandTextTrack): Ditto.
(WebCore::InbandTextTrack::setPrivate): Take a reference instead of a PassRefPtr.
(WebCore::InbandTextTrack::isClosedCaptions): Removed check for null since m_private
is now a Ref and so never null.
(WebCore::InbandTextTrack::isSDH): Ditto.
(WebCore::InbandTextTrack::containsOnlyForcedSubtitles): Ditto.
(WebCore::InbandTextTrack::isMainProgramContent): Ditto.
(WebCore::InbandTextTrack::isEasyToRead): Ditto.
(WebCore::InbandTextTrack::inbandTrackIndex): Ditto.
(WebCore::InbandTextTrack::inBandMetadataTrackDispatchType): Ditto.
(WebCore::InbandTextTrack::idChanged): Removed unneeded track private argument.
(WebCore::InbandTextTrack::labelChanged): Ditto.
(WebCore::InbandTextTrack::languageChanged): Ditto.
(WebCore::InbandTextTrack::willRemove): Ditto.
(WebCore::InbandTextTrack::updateKindFromPrivate): Improved switch statement
by removing default so we get a warning if we forget to handle a kind value.
(WebCore::InbandTextTrack::startTimeVariance): Removed check for null.
* html/track/InbandTextTrack.h: Updated for above changes. Changed m_private from
a RefPtr to a Ref.

* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::InbandWebVTTTextTrack): Take references.
(WebCore::InbandWebVTTTextTrack::create): Ditto.
(WebCore::InbandWebVTTTextTrack::parseWebVTTCueData): Removed unneeded track
private arguemnt.
(WebCore::InbandWebVTTTextTrack::newRegionsParsed): Pass a reference.
* html/track/InbandWebVTTTextTrack.h: Updated for above changes.

* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::newCuesAvailable): Pass references.
(WebCore::LoadableTextTrack::newRegionsAvailable): Ditto.

* html/track/TextTrack.cpp:
(WebCore::TextTrack::~TextTrack): Use references.
(WebCore::TextTrack::setKind): Ditto.
(WebCore::TextTrack::setMode): Ditto.
(WebCore::TextTrack::removeAllCues): Ditto.
(WebCore::TextTrack::activeCues): Ditto.
(WebCore::TextTrack::addCue): Ditto.
(WebCore::TextTrack::removeCue): Removed unneeded code to handle a cue
that points to a track but is not in that track. Added a call to
setIsActive(false) here instead of having the remove function do it.
(WebCore::TextTrack::addRegion): Use references.
(WebCore::TextTrack::removeRegion): Removed unneeded code to handle a
region that points to a track but is not in that track.
(WebCore::TextTrack::cueWillChange): Use references.
(WebCore::TextTrack::cueDidChange): Ditto.
(WebCore::TextTrack::setLanguage): Ditto.
* html/track/TextTrack.h: Updated for above changes.

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::TextTrackCue): Initialized the data members
in the class definition.
(WebCore::TextTrackCue::cueIndex): Deleted.
(WebCore::TextTrackCue::invalidateCueIndex): Deleted.
* html/track/TextTrackCue.h: Updated for the above. Removed m_cueIndex,
because it is not a good design to store these and try to keep them up
to date.

* html/track/TextTrackCueList.cpp:
(WebCore::compareCues): Added. Helper for sorting and checking sorting.
(WebCore::TextTrackCueList::TextTrackCueList): Deleted. Let the compiler
generate this.
(WebCore::TextTrackCueList::length): Moved to header.
(WebCore::TextTrackCueList::cueIndex): Renamed from getCueIndex.
Changed return type to unsigned rather than unsigned long.
(WebCore::TextTrackCueList::item): Updated for name change.
(WebCore::TextTrackCueList::getCueById): Ditto.
(WebCore::TextTrackCueList::activeCues): Build the vector directly
rather than wastefully adding with TextTrackCueList::add, which will
try to sort.
(WebCore::TextTrackCueList::add): Take a Ref&amp;&amp; instead of a PassRefPtr.
Also, keep sorted using std::upper_bound instead of the recursive
binary search this code was using before. Also remove the
invalidateCueIndexes call since there are no cue indices any more.
Also remove the boolean return value since no caller was using it.
(WebCore::TextTrackCueList::remove): Take a reference instead of a
pointer. Also remove the boolean return value since no caller was using it.
(WebCore::TextTrackCueList::contains): Deleted. Was unused.
(WebCore::TextTrackCueList::updateCueIndex): Reimplemented using the
std::upper_bound and std::rotate operations. The old code that used
remove and add was inefficient and also could cause a cue to be deallocated
if something else wasn't holding a reference to the cue. Also changed to take
a reference.
(WebCore::TextTrackCueList::clear): Deleted. Was unused.
(WebCore::TextTrackCueList::invalidateCueIndexes): Deleted. No longer
needed since we don't store cue indices in the cues any more.
* html/track/TextTrackCueList.h: Updated for the above changes.

* html/track/VTTRegionList.cpp:
(WebCore::VTTRegionList::VTTRegionList): Deleted. Let the compiler
generate this.
(WebCore::VTTRegionList::length): Moved to header.
(WebCore::VTTRegionList::item): Updated for name and type changes.
(WebCore::VTTRegionList::getRegionById): Ditto.
(WebCore::VTTRegionList::add): Changed to take a Ref&amp;&amp; instead of a
PassRefPtr.
(WebCore::VTTRegionList::remove): Updated.
(WebCore::VTTRegionList::clear): Deleted. Was unused.
* html/track/VTTRegionList.h: Updated for the above changes.
* html/track/VTTRegionList.idl: Made return values nullable to reflect
the actual semantic of the code.

* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::VideoTrack): Use references.
(WebCore::VideoTrack::setPrivate): Ditto.
(WebCore::VideoTrack::setSelected): Ditto.
(WebCore::VideoTrack::inbandTrackIndex): Removed assertion since m_private
is now a Ref instead of a RefPtr.
(WebCore::VideoTrack::selectedChanged): Removed unneeded track private argument.
(WebCore::VideoTrack::idChanged): Ditto.
(WebCore::VideoTrack::labelChanged): Ditto.
(WebCore::VideoTrack::languageChanged): Ditto.
(WebCore::VideoTrack::willRemove): Ditto.
(WebCore::VideoTrack::setKind): Updated to use reference.
(WebCore::VideoTrack::setLanguage): Ditto.
* html/track/VideoTrack.h: Updated for the above. Changed derivation to private.
Removed unneeded defaultKindKeyword.

* loader/EmptyClients.h: Updated to use reference.

* loader/PingLoader.cpp:
(WebCore::PingLoader::sendViolationReport): Take a Ref&amp;&amp; instead of RefPtr&amp;&amp;.
* loader/PingLoader.h: Updated for above change.

* page/Chrome.cpp:
(WebCore::Chrome::loadIconForFiles): Take a reference.
* page/Chrome.h: Updated for above change.
* page/ChromeClient.h: Ditto.

* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation): Use auto.

* platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
(WebPlaybackSessionModelMediaElement::selectAudioMediaOption): Simplified
algorithm by removing unneeded direct call to audioTrackEnabledChanged,
which will be called by setEnabled and doesn't need to be called again here.
(WebPlaybackSessionModelMediaElement::selectLegibleMediaOption): Removed
unhelpful assertion and unnneded initialization.

* platform/graphics/AudioTrackPrivate.h: Removed unnneeed track private
argument and initialized data members where they are defined.

* platform/graphics/InbandTextTrackPrivateClient.h: Use Ref instead of
PassRefPtr, initialize data members where they are defined, and removed
the unneeded track private arguments from the client functions.

* platform/graphics/SourceBufferPrivate.h: Fixed functions that were taking
AtomicString to take a const&amp; instead. Use Ref&amp;&amp; instead of PassRefPtr.

* platform/graphics/SourceBufferPrivateClient.h: Removed unneded private pointer
arguments from client functions.

* platform/graphics/TrackPrivateBase.h: Removed unneeded private pointers
from client functions.
* platform/graphics/VideoTrackPrivate: Ditto.

* platform/graphics/avfoundation/AudioTrackPrivateAVF.h: Use
const AtomicString&amp;.

* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
(WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue): Updated for change to arguments.
(WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Ditto.
(WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues): Ditto.
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Ditto.
(WebCore::InbandTextTrackPrivateAVF::resetCueValues): Ditto.
(WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Ditto.

* platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp:
(WebCore::AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC):
Moved initialization of data memebrs to where they are defined.
(WebCore::AudioTrackPrivateMediaSourceAVFObjC::enabled): Deleted. No longer needed.
(WebCore::AudioTrackPrivateMediaSourceAVFObjC::setEnabled): Changed to use the enabled
flag from the base class instead of a separate m_enabled in this class.
* platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
Removed the enabled function and the m_enabled data member.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: Marked functions
final instead of override and updated arguemnts.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): Updated for change
to arguments.
(WebCore::SourceBufferPrivateAVFObjC::processCodedFrame): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::appendCompleted): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::hasVideo): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::hasAudio): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::flush): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::seekToTime): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): Ditto.

* platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: Updated for
changes to arguments.
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): Ditto.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): Ditto.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::appsinkNewSample): Ditto.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::append): Ditto.
(WebCore::SourceBufferPrivateGStreamer::flush): Ditto.
(WebCore::SourceBufferPrivateGStreamer::enqueueSample): Ditto.
(WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples): Ditto.
(WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment): Ditto.
(WebCore::SourceBufferPrivateGStreamer::didReceiveSample): Ditto.
(WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples): Ditto.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Ditto.
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::append): Ditto.
(WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment): Ditto.
(WebCore::MockSourceBufferPrivate::didReceiveSample): Ditto.
(WebCore::MockSourceBufferPrivate::enqueuedSamplesForTrackID): Ditto.
(WebCore::MockSourceBufferPrivate::enqueueSample): Ditto.
(WebCore::MockSourceBufferPrivate::hasVideo): Ditto.
(WebCore::MockSourceBufferPrivate::hasAudio): Ditto.
(WebCore::MockSourceBufferPrivate::fastSeekTimeForMediaTime): Ditto.
(WebCore::MockSourceBufferPrivate::seekToTime): Ditto.
* platform/mock/mediasource/MockSourceBufferPrivate.h: Ditto.

* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::updateSnapshot): Take raw pointer instead
of PassRefPtr.
* rendering/RenderSnapshottedPlugIn.h: Updated for above change.

* svg/SVGScriptElement.h: Added using to resolve the ambiguity with the
ref/deref from SVGElement and from ScriptElement.

* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished): Updated to simplify since
the pending script now has a script element.

* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::startElementNs): Use isSciprtElement instead
of toScriptElementIfPossible.
(WebCore::XMLDocumentParser::endElementNs): Ditto. Also use downcastScriptElement.

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::loadIconForFiles): Take a reference instead of a pointer.

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::loadIconForFiles): Take a reference instead of a pointer.
* WebCoreSupport/WebChromeClient.h: Updated for the above.

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::loadIconForFiles): Take a reference instead of a pointer.
* WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.

Source/WTF:

* wtf/RefPtr.h:
(WTF::makeRefPtr): Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfRefPtrh">trunk/Source/WTF/wtf/RefPtr.h</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourcecpp">trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp</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="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCanvasRenderingContext2DCustomcpp">trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSPluginElementFunctionscpp">trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWebGL2RenderingContextCustomcpp">trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWebGLRenderingContextBaseCustomcpp">trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptModuleLoadercpp">trunk/Source/WebCore/bindings/js/ScriptModuleLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomPendingScriptcpp">trunk/Source/WebCore/dom/PendingScript.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPendingScripth">trunk/Source/WebCore/dom/PendingScript.h</a></li>
<li><a href="#trunkSourceWebCoredomScriptElementcpp">trunk/Source/WebCore/dom/ScriptElement.cpp</a></li>
<li><a href="#trunkSourceWebCoredomScriptElementh">trunk/Source/WebCore/dom/ScriptElement.h</a></li>
<li><a href="#trunkSourceWebCoredomScriptRunnercpp">trunk/Source/WebCore/dom/ScriptRunner.cpp</a></li>
<li><a href="#trunkSourceWebCoredomScriptRunnerh">trunk/Source/WebCore/dom/ScriptRunner.h</a></li>
<li><a href="#trunkSourceWebCorehtmlFileInputTypecpp">trunk/Source/WebCore/html/FileInputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlFileInputTypeh">trunk/Source/WebCore/html/FileInputType.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementcpp">trunk/Source/WebCore/html/HTMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementh">trunk/Source/WebCore/html/HTMLElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormControlElementcpp">trunk/Source/WebCore/html/HTMLFormControlElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLFormControlElementh">trunk/Source/WebCore/html/HTMLFormControlElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementcpp">trunk/Source/WebCore/html/HTMLInputElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementh">trunk/Source/WebCore/html/HTMLInputElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLabelElementcpp">trunk/Source/WebCore/html/HTMLLabelElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLabelElementh">trunk/Source/WebCore/html/HTMLLabelElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLegendElementcpp">trunk/Source/WebCore/html/HTMLLegendElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLegendElementh">trunk/Source/WebCore/html/HTMLLegendElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementcpp">trunk/Source/WebCore/html/HTMLObjectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementh">trunk/Source/WebCore/html/HTMLObjectElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLOptionElementcpp">trunk/Source/WebCore/html/HTMLOptionElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInElementcpp">trunk/Source/WebCore/html/HTMLPlugInElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInElementh">trunk/Source/WebCore/html/HTMLPlugInElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInImageElementcpp">trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInImageElementh">trunk/Source/WebCore/html/HTMLPlugInImageElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLScriptElementcpp">trunk/Source/WebCore/html/HTMLScriptElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLScriptElementh">trunk/Source/WebCore/html/HTMLScriptElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextFormControlElementcpp">trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextFormControlElementh">trunk/Source/WebCore/html/HTMLTextFormControlElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTrackElementcpp">trunk/Source/WebCore/html/HTMLTrackElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTrackElementh">trunk/Source/WebCore/html/HTMLTrackElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlInputTypecpp">trunk/Source/WebCore/html/InputType.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlInputTypeh">trunk/Source/WebCore/html/InputType.h</a></li>
<li><a href="#trunkSourceWebCorehtmlPluginDocumentcpp">trunk/Source/WebCore/html/PluginDocument.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlPluginDocumenth">trunk/Source/WebCore/html/PluginDocument.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="#trunkSourceWebCorehtmlcanvasCanvasStylecpp">trunk/Source/WebCore/html/canvas/CanvasStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasCanvasStyleh">trunk/Source/WebCore/html/canvas/CanvasStyle.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasOESVertexArrayObjectcpp">trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGL2RenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGL2RenderingContexth">trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLBuffercpp">trunk/Source/WebCore/html/canvas/WebGLBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLBufferh">trunk/Source/WebCore/html/canvas/WebGLBuffer.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLContextGroupcpp">trunk/Source/WebCore/html/canvas/WebGLContextGroup.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLContextGrouph">trunk/Source/WebCore/html/canvas/WebGLContextGroup.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLContextObjectcpp">trunk/Source/WebCore/html/canvas/WebGLContextObject.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLFramebuffercpp">trunk/Source/WebCore/html/canvas/WebGLFramebuffer.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLObjectcpp">trunk/Source/WebCore/html/canvas/WebGLObject.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLObjecth">trunk/Source/WebCore/html/canvas/WebGLObject.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLProgramcpp">trunk/Source/WebCore/html/canvas/WebGLProgram.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLProgramh">trunk/Source/WebCore/html/canvas/WebGLProgram.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLQueryh">trunk/Source/WebCore/html/canvas/WebGLQuery.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContexth">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseh">trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLSamplerh">trunk/Source/WebCore/html/canvas/WebGLSampler.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLShaderh">trunk/Source/WebCore/html/canvas/WebGLShader.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLSharedObjectcpp">trunk/Source/WebCore/html/canvas/WebGLSharedObject.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLSharedObjecth">trunk/Source/WebCore/html/canvas/WebGLSharedObject.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLSynch">trunk/Source/WebCore/html/canvas/WebGLSync.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLTransformFeedbackh">trunk/Source/WebCore/html/canvas/WebGLTransformFeedback.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectcpp">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjecth">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectBasecpp">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectBaseh">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectOEScpp">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectOESh">trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h</a></li>
<li><a href="#trunkSourceWebCorehtmlformsFileIconLoadercpp">trunk/Source/WebCore/html/forms/FileIconLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlformsFileIconLoaderh">trunk/Source/WebCore/html/forms/FileIconLoader.h</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLConstructionSitecpp">trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLDocumentParsercpp">trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLScriptRunnercpp">trunk/Source/WebCore/html/parser/HTMLScriptRunner.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLScriptRunnerh">trunk/Source/WebCore/html/parser/HTMLScriptRunner.h</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLTreeBuildercpp">trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLTreeBuilderh">trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h</a></li>
<li><a href="#trunkSourceWebCorehtmlparserTextDocumentParsercpp">trunk/Source/WebCore/html/parser/TextDocumentParser.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserXSSAuditorDelegatecpp">trunk/Source/WebCore/html/parser/XSSAuditorDelegate.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserXSSAuditorDelegateh">trunk/Source/WebCore/html/parser/XSSAuditorDelegate.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackAudioTrackcpp">trunk/Source/WebCore/html/track/AudioTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackAudioTrackh">trunk/Source/WebCore/html/track/AudioTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandDataTextTrackcpp">trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandDataTextTrackh">trunk/Source/WebCore/html/track/InbandDataTextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandGenericTextTrackcpp">trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandGenericTextTrackh">trunk/Source/WebCore/html/track/InbandGenericTextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandTextTrackcpp">trunk/Source/WebCore/html/track/InbandTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandTextTrackh">trunk/Source/WebCore/html/track/InbandTextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandWebVTTTextTrackcpp">trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackInbandWebVTTTextTrackh">trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackLoadableTextTrackcpp">trunk/Source/WebCore/html/track/LoadableTextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackLoadableTextTrackh">trunk/Source/WebCore/html/track/LoadableTextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackcpp">trunk/Source/WebCore/html/track/TextTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackh">trunk/Source/WebCore/html/track/TextTrack.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCuecpp">trunk/Source/WebCore/html/track/TextTrackCue.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueh">trunk/Source/WebCore/html/track/TextTrackCue.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueListcpp">trunk/Source/WebCore/html/track/TextTrackCueList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTextTrackCueListh">trunk/Source/WebCore/html/track/TextTrackCueList.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTrackBasecpp">trunk/Source/WebCore/html/track/TrackBase.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackTrackBaseh">trunk/Source/WebCore/html/track/TrackBase.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegionListcpp">trunk/Source/WebCore/html/track/VTTRegionList.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegionListh">trunk/Source/WebCore/html/track/VTTRegionList.h</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVTTRegionListidl">trunk/Source/WebCore/html/track/VTTRegionList.idl</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVideoTrackcpp">trunk/Source/WebCore/html/track/VideoTrack.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmltrackVideoTrackh">trunk/Source/WebCore/html/track/VideoTrack.h</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientsh">trunk/Source/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkSourceWebCoreloaderPingLoadercpp">trunk/Source/WebCore/loader/PingLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderPingLoaderh">trunk/Source/WebCore/loader/PingLoader.h</a></li>
<li><a href="#trunkSourceWebCorepageChromecpp">trunk/Source/WebCore/page/Chrome.cpp</a></li>
<li><a href="#trunkSourceWebCorepageChromeh">trunk/Source/WebCore/page/Chrome.h</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebCorepagecspContentSecurityPolicycpp">trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaWebPlaybackSessionModelMediaElementmm">trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsAudioTrackPrivateh">trunk/Source/WebCore/platform/graphics/AudioTrackPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsInbandTextTrackPrivateClienth">trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSourceBufferPrivateh">trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSourceBufferPrivateClienth">trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsTrackPrivateBaseh">trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsVideoTrackPrivateh">trunk/Source/WebCore/platform/graphics/VideoTrackPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationAudioTrackPrivateAVFh">trunk/Source/WebCore/platform/graphics/avfoundation/AudioTrackPrivateAVF.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationInbandMetadataTextTrackPrivateAVFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationInbandTextTrackPrivateAVFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationVideoTrackPrivateAVFh">trunk/Source/WebCore/platform/graphics/avfoundation/VideoTrackPrivateAVF.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcAudioTrackPrivateMediaSourceAVFObjCcpp">trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcAudioTrackPrivateMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateAVFObjCcpp">trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerInbandMetadataTextTrackPrivateGStreamerh">trunk/Source/WebCore/platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerInbandTextTrackPrivateGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerTrackPrivateBaseGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamermseAppendPipelinecpp">trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamermseSourceBufferPrivateGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamermseSourceBufferPrivateGStreamerh">trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamAudioTrackPrivateMediaStreamh">trunk/Source/WebCore/platform/mediastream/AudioTrackPrivateMediaStream.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmediastreamVideoTrackPrivateMediaStreamh">trunk/Source/WebCore/platform/mediastream/VideoTrackPrivateMediaStream.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivatecpp">trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivateh">trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockTracksh">trunk/Source/WebCore/platform/mock/mediasource/MockTracks.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderSnapshottedPlugIncpp">trunk/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderSnapshottedPlugInh">trunk/Source/WebCore/rendering/RenderSnapshottedPlugIn.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGScriptElementh">trunk/Source/WebCore/svg/SVGScriptElement.h</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParsercpp">trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp">trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebChromeClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebChromeClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebChromeClienth">trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLAnycpp">trunk/Source/WebCore/html/canvas/WebGLAny.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLAnyh">trunk/Source/WebCore/html/canvas/WebGLAny.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLGetInfocpp">trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLGetInfoh">trunk/Source/WebCore/html/canvas/WebGLGetInfo.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WTF/ChangeLog        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2017-01-04  Darin Adler  &lt;darin@apple.com&gt;
+
+        Remove PassRefPtr use from the &quot;html&quot; directory, other improvements
+        https://bugs.webkit.org/show_bug.cgi?id=166635
+
+        Reviewed by Alex Christensen.
+
+        * wtf/RefPtr.h:
+        (WTF::makeRefPtr): Added.
+
</ins><span class="cx"> 2017-01-04  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed build fix after r210313
</span></span></pre></div>
<a id="trunkSourceWTFwtfRefPtrh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/RefPtr.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/RefPtr.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WTF/wtf/RefPtr.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- *  Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
</del><ins>+ *  Copyright (C) 2005-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  *  This library is free software; you can redistribute it and/or
</span><span class="cx">  *  modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -242,10 +242,21 @@
</span><span class="cx">     return RefPtr&lt;T&gt;(p, RefPtr&lt;T&gt;::Adopt);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename T&gt; inline RefPtr&lt;T&gt; makeRefPtr(T* pointer)
+{
+    return pointer;
+}
+
+template&lt;typename T&gt; inline RefPtr&lt;T&gt; makeRefPtr(T&amp; reference)
+{
+    return &amp;reference;
+}
+
</ins><span class="cx"> } // namespace WTF
</span><span class="cx"> 
</span><span class="cx"> using WTF::RefPtr;
</span><span class="cx"> using WTF::adoptRef;
</span><ins>+using WTF::makeRefPtr;
</ins><span class="cx"> using WTF::static_pointer_cast;
</span><span class="cx"> 
</span><span class="cx"> #endif // WTF_RefPtr_h
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/CMakeLists.txt        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1759,7 +1759,6 @@
</span><span class="cx">     html/ValidationMessage.cpp
</span><span class="cx">     html/WeekInputType.cpp
</span><span class="cx"> 
</span><del>-    html/canvas/ANGLEInstancedArrays.cpp
</del><span class="cx">     html/canvas/CanvasGradient.cpp
</span><span class="cx">     html/canvas/CanvasPath.cpp
</span><span class="cx">     html/canvas/CanvasPattern.cpp
</span><span class="lines">@@ -1768,51 +1767,6 @@
</span><span class="cx">     html/canvas/CanvasRenderingContext2D.cpp
</span><span class="cx">     html/canvas/CanvasStyle.cpp
</span><span class="cx">     html/canvas/DOMPath.cpp
</span><del>-    html/canvas/EXTBlendMinMax.cpp
-    html/canvas/EXTFragDepth.cpp
-    html/canvas/EXTShaderTextureLOD.cpp
-    html/canvas/EXTTextureFilterAnisotropic.cpp
-    html/canvas/EXTsRGB.cpp
-    html/canvas/OESElementIndexUint.cpp
-    html/canvas/OESStandardDerivatives.cpp
-    html/canvas/OESTextureFloat.cpp
-    html/canvas/OESTextureFloatLinear.cpp
-    html/canvas/OESTextureHalfFloat.cpp
-    html/canvas/OESTextureHalfFloatLinear.cpp
-    html/canvas/OESVertexArrayObject.cpp
-    html/canvas/WebGL2RenderingContext.cpp
-    html/canvas/WebGLBuffer.cpp
-    html/canvas/WebGLCompressedTextureATC.cpp
-    html/canvas/WebGLCompressedTexturePVRTC.cpp
-    html/canvas/WebGLCompressedTextureS3TC.cpp
-    html/canvas/WebGLContextEvent.cpp
-    html/canvas/WebGLContextGroup.cpp
-    html/canvas/WebGLContextObject.cpp
-    html/canvas/WebGLDebugRendererInfo.cpp
-    html/canvas/WebGLDebugShaders.cpp
-    html/canvas/WebGLDepthTexture.cpp
-    html/canvas/WebGLDrawBuffers.cpp
-    html/canvas/WebGLExtension.cpp
-    html/canvas/WebGLFramebuffer.cpp
-    html/canvas/WebGLGetInfo.cpp
-    html/canvas/WebGLLoseContext.cpp
-    html/canvas/WebGLObject.cpp
-    html/canvas/WebGLProgram.cpp
-    html/canvas/WebGLQuery.cpp
-    html/canvas/WebGLRenderbuffer.cpp
-    html/canvas/WebGLRenderingContext.cpp
-    html/canvas/WebGLRenderingContextBase.cpp
-    html/canvas/WebGLSampler.cpp
-    html/canvas/WebGLShader.cpp
-    html/canvas/WebGLShaderPrecisionFormat.cpp
-    html/canvas/WebGLSharedObject.cpp
-    html/canvas/WebGLSync.cpp
-    html/canvas/WebGLTexture.cpp
-    html/canvas/WebGLTransformFeedback.cpp
-    html/canvas/WebGLUniformLocation.cpp
-    html/canvas/WebGLVertexArrayObject.cpp
-    html/canvas/WebGLVertexArrayObjectBase.cpp
-    html/canvas/WebGLVertexArrayObjectOES.cpp
</del><span class="cx"> 
</span><span class="cx">     html/forms/FileIconLoader.cpp
</span><span class="cx"> 
</span><span class="lines">@@ -3074,6 +3028,7 @@
</span><span class="cx">         html/canvas/OESTextureHalfFloatLinear.cpp
</span><span class="cx">         html/canvas/OESVertexArrayObject.cpp
</span><span class="cx">         html/canvas/WebGL2RenderingContext.cpp
</span><ins>+        html/canvas/WebGLAny.cpp
</ins><span class="cx">         html/canvas/WebGLBuffer.cpp
</span><span class="cx">         html/canvas/WebGLCompressedTextureATC.cpp
</span><span class="cx">         html/canvas/WebGLCompressedTexturePVRTC.cpp
</span><span class="lines">@@ -3087,7 +3042,6 @@
</span><span class="cx">         html/canvas/WebGLDrawBuffers.cpp
</span><span class="cx">         html/canvas/WebGLExtension.cpp
</span><span class="cx">         html/canvas/WebGLFramebuffer.cpp
</span><del>-        html/canvas/WebGLGetInfo.cpp
</del><span class="cx">         html/canvas/WebGLLoseContext.cpp
</span><span class="cx">         html/canvas/WebGLObject.cpp
</span><span class="cx">         html/canvas/WebGLProgram.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/ChangeLog        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,3 +1,772 @@
</span><ins>+2017-01-04  Darin Adler  &lt;darin@apple.com&gt;
+
+        Remove PassRefPtr use from the &quot;html&quot; directory, other improvements
+        https://bugs.webkit.org/show_bug.cgi?id=166635
+
+        Reviewed by Alex Christensen.
+
+        * CMakeLists.txt: Removed the duplicate copies of all the WebGL-specific files
+        in the main list of source files; there is no value in listing them twice.
+        Replaced WebGLGetInfo.cpp with WebGLAny.cpp.
+
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::removeSourceBuffer): Updates since the tracks functions
+        return references now.
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): Removed
+        unneeded SourceBufferPrivate* argument.
+        (WebCore::SourceBuffer::appendBufferTimerFired): Ditto.
+        (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Ditto.
+        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError): Ditto.
+        (WebCore::SourceBuffer::videoTracks): Return a reference rather than a pointer.
+        (WebCore::SourceBuffer::audioTracks): Ditto.
+        (WebCore::SourceBuffer::textTracks): Ditto.
+        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
+        Removed unneeded SourceBufferPrivate* argument.
+        (WebCore::SourceBuffer::validateInitializationSegment): Updated since tracks
+        functions now return a pointer.
+        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Removed unneeded
+        SourceBufferPrivate* argument.
+        (WebCore::SourceBuffer::sourceBufferPrivateHasAudio): Ditto.
+        (WebCore::SourceBuffer::sourceBufferPrivateHasVideo): Ditto.
+        (WebCore::SourceBuffer::videoTrackSelectedChanged): Take a reference rather than
+        a pointer.
+        (WebCore::SourceBuffer::audioTrackEnabledChanged): Ditto.
+        (WebCore::SourceBuffer::textTrackModeChanged): Ditto.
+        (WebCore::SourceBuffer::textTrackAddCue): Ditto.
+        (WebCore::SourceBuffer::textTrackAddCues): Ditto.
+        (WebCore::SourceBuffer::textTrackRemoveCue): Ditto.
+        (WebCore::SourceBuffer::textTrackRemoveCues): Ditto.
+        (WebCore::SourceBuffer::textTrackKindChanged): Ditto.
+        (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples): Ditto.
+        (WebCore::SourceBuffer::provideMediaData): Ditto.
+        (WebCore::SourceBuffer::reenqueueMediaForTime): Ditto.
+        * Modules/mediasource/SourceBuffer.h: Updated for above changes.
+
+        * WebCore.xcodeproj/project.pbxproj: Replaced WebGLGetInfo with WebGLAny.
+
+        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
+        (WebCore::toHTMLCanvasStyle): Removed explicit cast to CanvasStyle and unneeded
+        conversion to a pointer since CanvasStyle constructors now take references.
+
+        * bindings/js/JSPluginElementFunctions.cpp:
+        (WebCore::pluginInstance): Updated since bindingsInstance now returns a raw pointer.
+        (WebCore::pluginScriptObject): Ditto.
+
+        * bindings/js/JSWebGL2RenderingContextCustom.cpp:
+        (WebCore::toJS): Moved to WebGLAny.h/cpp.
+        (WebCore::JSWebGL2RenderingContext::getIndexedParameter): Updated since the toJS
+        function in WebGLAny.h takes references, not pointers.
+
+        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp: Removed quite a few unneeded
+        includes and got rid of a lot of unneeded JSC prefixes.
+        (WebCore::toJS): Moved to WebGLAny.h/cpp.
+        (WebCore::toJSNewlyCreated):
+        (WebCore::objectParameter): Renamed from getObjectParameter and also changed to
+        take a pointer to member function so we don't need an enum and a switch statement.
+        (WebCore::toJS): Changed to take references rather than pointers.
+        (WebCore::JSWebGLRenderingContextBase::getAttachedShaders): Use a modern for loop.
+        (WebCore::JSWebGLRenderingContextBase::getBufferParameter): Use objectParameter.
+        (WebCore::JSWebGLRenderingContextBase::getRenderbufferParameter): Ditto.
+        (WebCore::JSWebGLRenderingContextBase::getVertexAttrib): Ditto.
+        (WebCore::toNumberVector): Renamed from toVector, since this is specifically for
+        vectors of numbers. Use uncheckedAppend instead of assignment.
+        (WebCore::functionForUniform): Marked this inline.
+        (WebCore::dataFunctionf): Updated for above changes.
+        (WebCore::dataFunctioni): Ditto.
+        (WebCore::dataFunctionMatrix): Ditto.
+
+        * bindings/js/ScriptModuleLoader.cpp:
+        (WebCore::ScriptModuleLoader::fetch): Moved assertions to the top of the function.
+        Also added a FIXME because it's unclear why these assertions are correct. Updated
+        to use downcastScriptElement instead of toScriptElementIfPossible.
+
+        * dom/Document.h: Sorted list of forward-declared classes. Removed duplicate
+        forward declaration of ScriptModuleLoader.
+
+        * dom/PendingScript.cpp:
+        (WebCore::PendingScript::create): Take a ScriptElement instead of an Element.
+        (WebCore::PendingScript::PendingScript): Ditto.
+        (WebCore::PendingScript::loadableScript): Moved inline to header and made inline.
+        (WebCore::PendingScript::setClient): Take a reference instead of a pointer.
+        * dom/PendingScript.h: UPdated for above changes.
+
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElement::prepareScript): Pass a reference instead of a pointer.
+        (WebCore::ScriptElement::ref): Added. Forwards ref/deref to the underlying element
+        so we can use Ref and RefPtr with this class.
+        (WebCore::ScriptElement::deref): Ditto.
+        (WebCore::isScriptElement): Added. Replaces one of the two uses of
+        toScriptElementIfPossible, and is similar in style to is&lt;Element&gt;.
+        (WebCore::downcastScriptElement): Ditto, but for downcast.
+        * dom/ScriptElement.h: Updated for above changes.
+
+        * dom/ScriptRunner.cpp:
+        (WebCore::ScriptRunner::queueScriptForExecution): Take reference rather than
+        pointer, and pass ScriptElement rather than Element.
+        (WebCore::ScriptRunner::notifyFinished): Ditto.
+        (WebCore::ScriptRunner::timerFired): Ditto.
+        * dom/ScriptRunner.h: Updated for above changes.
+
+        * html/FileInputType.cpp:
+        (WebCore::FileInputType::files): Updated since m_fileList is a Ref.
+        (WebCore::FileInputType::createFileList): Updated to return a Ref instead of
+        a PassRefPtr. Also use reserveInitialCapacity/uncheckedAppend.
+        (WebCore::FileInputType::requestIcon): Updated since the updateRendering
+        function is now called iconLoaded. Also use references instead of pointers.
+        (WebCore::FileInputType::setFiles): Take a RefPtr&amp;&amp; insted of a PassRefPtr.
+        Also put some conditional code inside an #if.
+        (WebCore::FileInputType::filesChosen): Updated for function name change.
+        (WebCore::FileInputType::iconLoaded): Renamed from updateRendering.
+        Changed argument to RefPtr&amp;&amp; from PassRefPtr.
+        (WebCore::FileInputType::defaultToolTip): Got rid of unneeded local variable
+        and used the correct type, unsigned, rather than size_t.
+        * html/FileInputType.h: Updated for the above changes, use final instead
+        of override, and use Ref instead of RefPtr.
+
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::form): Renamed from virtualForm.
+        * html/HTMLElement.h: Replaced the form/virtualForm pair of functions with
+        just a form function. The old design dates back before we had &quot;final&quot; for
+        virtual functions, and now we can just use that instead.
+
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::virtualForm): Deleted.
+        * html/HTMLFormControlElement.h: Mark the form function final, since it's
+        now both an inline function in this class, and an override of a virtual
+        function inherited from the base class. Deleted the virtualForm function.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::defaultEventHandler): Removed use of the
+        formForSubmission function, which was just another way to get the same
+        thing as the form function; perhaps they were different in the past.
+        (WebCore::HTMLInputElement::setFiles): Take a RefPtr&amp;&amp; rather than a PassRefPtr.
+        * html/HTMLInputElement.h: Updated for the above.
+
+        * html/HTMLLabelElement.cpp:
+        (WebCore::HTMLLabelElement::control): Made this const.
+        (WebCore::HTMLLabelElement::form): Made this const, so it can be used to
+        override the const form function from the base class.
+        * html/HTMLLabelElement.h: Marked the form function final, since we want it
+        to override the form function inherited from HTMLElement.
+
+        * html/HTMLLegendElement.cpp:
+        (WebCore::HTMLLegendElement::form): Renamed from virtualForm.
+        * html/HTMLLegendElement.h: Override form instead of virtualForm and mark it final
+        This makes things more efficient if someone calls form directly on this class;
+        before it would make an unnecessary virtual function call.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::TrackDisplayUpdateScope::TrackDisplayUpdateScope): Take a reference
+        rather than a pointer.
+        (WebCore::TrackDisplayUpdateScope::~TrackDisplayUpdateScope): Ditto.
+        (WebCore::eventTimeCueCompare): Compare the cues the same way the cue list would
+        rather than using cueIndex.
+        (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Take a reference.
+        (WebCore::HTMLMediaElement::textTrackModeChanged): Ditto.
+        (WebCore::HTMLMediaElement::videoTrackSelectedChanged): Ditto.
+        (WebCore::HTMLMediaElement::textTrackKindChanged): Ditto.
+        (WebCore::HTMLMediaElement::textTrackAddCues): Ditto.
+        (WebCore::HTMLMediaElement::textTrackRemoveCues): Ditto.
+        (WebCore::HTMLMediaElement::textTrackAddCue): Ditto.
+        (WebCore::HTMLMediaElement::textTrackRemoveCue): Ditto.
+        (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Pass references.
+        (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto.
+        (WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Ditto.
+        (WebCore::HTMLMediaElement::removeTextTrack): Ditto.
+        (WebCore::HTMLMediaElement::forgetResourceSpecificTracks): Ditto.
+        (WebCore::HTMLMediaElement::setController): Take a RefPtr&amp;&amp; instead of PassRefPtr.
+        * html/HTMLMediaElement.h: Updated for above changes.
+
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::virtualForm): Deleted.
+        * html/HTMLObjectElement.h: Made the form function inline and final, which
+        achieves the same thing we did before with using, but without requiring the
+        separate virtualForm function, now deleted.
+
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::collectOptionInnerText): Use isScriptElement
+        instead of toScriptElementIfPossible.
+
+        * html/HTMLPlugInElement.cpp:
+        (WebCore::HTMLPlugInElement::bindingsInstance): Renamed from getInstance and
+        changed the return type to a raw pointer.
+        * html/HTMLPlugInElement.h: Updated for the above changes. Also changed the
+        updateSnapshot function to take a raw pointer instead of a PassRefPtr.
+
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::createElementRenderer): Pass a pointer
+        to updateSnapshot.
+        (WebCore::HTMLPlugInImageElement::updateSnapshot): Updated to take a raw
+        pointer instead of a PassRefPtr.
+        * html/HTMLPlugInImageElement.h: Updated for above changes.
+
+        * html/HTMLScriptElement.h: Added using to resolve the ambiguity with the
+        ref/deref from HTMLElement and from ScriptElement.
+
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::selection): Return a RefPtr instead
+        of a PassRefPtr.
+        * html/HTMLTextFormControlElement.h: Updated for above changes.
+
+        * html/HTMLTrackElement.cpp:
+        (WebCore::HTMLTrackElement::textTrackKindChanged): Take a reference.
+        (WebCore::HTMLTrackElement::textTrackModeChanged): Ditto.
+        (WebCore::HTMLTrackElement::textTrackAddCues): Ditto.
+        (WebCore::HTMLTrackElement::textTrackRemoveCues): Ditto.
+        (WebCore::HTMLTrackElement::textTrackAddCue): Ditto.
+        (WebCore::HTMLTrackElement::textTrackRemoveCue): Ditto.
+        * html/HTMLTrackElement.h: Updated for above changes.
+
+        * html/InputType.cpp:
+        (WebCore::InputType::formForSubmission): Deleted.
+        (WebCore::InputType::setFiles): Take a RefPtr&amp;&amp; instead of a PassRefPtr.
+        * html/InputType.h: Updated for above changes.
+
+        * html/PluginDocument.cpp:
+        (WebCore::PluginDocumentParser::createDocumentStructure): Pass a reference.
+        (WebCore::PluginDocument::setPluginElement): Take a reference rather than
+        a PassRefPtr.
+        * html/PluginDocument.h: Updated for above changes.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::setStrokeStyle): Pass a reference.
+        (WebCore::CanvasRenderingContext2D::setFillStyle): Ditto.
+        (WebCore::CanvasRenderingContext2D::drawTextInternal): Ditto.
+
+        * html/canvas/CanvasStyle.cpp:
+        (WebCore::CanvasStyle::CanvasStyle): Rewrite all constructors to use the
+        m_style variant instead of separate m_type and other data members. Also
+        change from PassRefPtr to a reference.
+        (WebCore::CanvasStyle::createFromString): Update to use the variant.
+        (WebCore::CanvasStyle::createFromStringWithOverrideAlpha): Ditto.
+        (WebCore::CanvasStyle::isEquivalentColor): Ditto.
+        (WebCore::CanvasStyle::isEquivalentRGBA): Ditto.
+        (WebCore::CanvasStyle::isEquivalentCMYKA): Ditto.
+        (WebCore::CanvasStyle::CanvasStyle): Deleted copy constructor; the compiler
+        can now generate a correct copy or move constructor.
+        (WebCore::CanvasStyle::~CanvasStyle): Deleted. Compiler generates this
+        properly now without help from us.
+        (WebCore::CanvasStyle::operator=): Deleted. The compiler can now generate
+        a correct copy of move assignment operator.
+        (WebCore::CanvasStyle::applyStrokeColor): Updated to take a reference and
+        use the variant.
+        (WebCore::CanvasStyle::applyFillColor): Ditto.
+
+        * html/canvas/CanvasStyle.h: Redid this class to use a variant instead of
+        a type enumeration and a union.
+
+        * html/canvas/OESVertexArrayObject.cpp:
+        (WebCore::OESVertexArrayObject::createVertexArrayOES): Updated use of enum
+        since it's now an enum class.
+
+        * html/canvas/WebGL2RenderingContext.cpp:
+        (WebCore::WebGL2RenderingContext::WebGL2RenderingContext): Use Ref&amp;&amp; instead of
+        RefPtr&amp;&amp; for the GraphicsContext3D.
+        (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects): Updated enum
+        and also use references.
+        (WebCore::WebGL2RenderingContext::getInternalformatParameter): Use nullptr to
+        return null rather than the old idiom (default-constructed WebGLGetInfo).
+        (WebCore::WebGL2RenderingContext::texStorage2D): Ditto.
+        (WebCore::WebGL2RenderingContext::getQueryParameter): Ditto.
+        (WebCore::WebGL2RenderingContext::getSamplerParameter): Ditto.
+        (WebCore::WebGL2RenderingContext::getSyncParameter): Ditto.
+        (WebCore::WebGL2RenderingContext::getIndexedParameter): Ditto.
+        (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter): Ditto.
+        (WebCore::WebGL2RenderingContext::getActiveUniformBlockName): Ditto.
+        (WebCore::WebGL2RenderingContext::createVertexArray): Updated enum and also
+        use reference.
+        (WebCore::WebGL2RenderingContext::getExtension): Rearranged logic in three ways:
+        (1) Moved checks for whether an extension is supported inside the case for that
+        extension, rather than combining the extension name check with the extensions
+        enabled check. (2) Used the new enableSupportedExtension function to simplify
+        many of the checks to avoid repeating the extension name twice. (3) Changed the
+        idiom so we set the pointers to nullptr explicitly, preparing for a future where
+        we might make the extension pointers use std::optional so we can cache a negative
+        for each extension too, not just a positive result.
+        (WebCore::WebGL2RenderingContext::getSupportedExtensions): Use ASCIILiteral.
+        (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter): Use nullptr
+        as above. For non-null types, return the object without converting, letting the
+        WebGLAny class handle things, except for enumerations, which we need to explicitly
+        static_cast to an integral type, and things that will be stored in the variant in
+        a RefPtr, where we use makeRefPtr.
+        (WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters):
+        Simplified and clarified the handling of COLOR_ATTACHMENT.
+        (WebCore::WebGL2RenderingContext::getParameter): Return WebGLAny, same idiom as
+        described above for getFramebufferAttachmentParameter.
+        * html/canvas/WebGL2RenderingContext.h: Updated for above changes.
+
+        * html/canvas/WebGLAny.cpp: Added.
+        (WebCore::toJS): Handles conversion to JavaScript types. This function is based
+        on the existing toJS functions from the two classes that were using WebGLGetInfo.
+        Eventually we can probably just get the bindings to automatically generate this,
+        but there is some work to do to get to that point.
+        * html/canvas/WebGLAny.h: Added. This type, a variant, replaces the WebGLGetInfo
+        class. Also includes the toJS function, which is the real point of this type, since
+        it's about returning a variant mapped appropriately to JavaScript types.
+
+        * html/canvas/WebGLContextGroup.cpp:
+        (WebCore::WebGLContextGroup::getAGraphicsContext3D): Changed to return a reference.
+        Droped unnecessary local variable with a long type name.
+        (WebCore::WebGLContextGroup::addContext): Take a reference.
+        (WebCore::WebGLContextGroup::removeContext): Ditto.
+        (WebCore::WebGLContextGroup::removeObject): Ditto.
+        (WebCore::WebGLContextGroup::addObject): Ditto.
+        (WebCore::WebGLContextGroup::detachAndRemoveAllObjects): Dropped unnecessary
+        local variable with a long type name.
+        * html/canvas/WebGLContextGroup.h: Updated for above changes.
+
+        * html/canvas/WebGLContextObject.cpp:
+        (WebCore::WebGLContextObject::~WebGLContextObject): Pass references.
+        (WebCore::WebGLContextObject::detachContext): Ditto.
+
+        * html/canvas/WebGLGetInfo.cpp: Removed.
+        * html/canvas/WebGLGetInfo.h: Removed.
+
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::WebGLRenderingContext): Take a Ref&amp;&amp; instead
+        of as PassRefPtr.
+        (WebCore::WebGLRenderingContext::initializeVertexArrayObjects): Updated enum
+        and also use references.
+        (WebCore::WebGLRenderingContext::getExtension): Rearranged logic in three ways:
+        (1) Moved checks for whether an extension is supported inside the case for that
+        extension, rather than combining the extension name check with the extensions
+        enabled check. (2) Used the new enableSupportedExtension function to simplify
+        many of the checks to avoid repeating the extension name twice. (3) Changed the
+        idiom so we set the pointers to nullptr explicitly, preparing for a future where
+        we might make the extension pointers use std::optional so we can cache a negative
+        for each extension too, not just a positive result.
+        (WebCore::WebGLRenderingContext::getSupportedExtensions): Use ASCIILiteral.
+        (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): Use nullptr
+        as above. For non-null types, return the object without converting, letting the
+        WebGLAny class handle things, except for enumerations, which we need to explicitly
+        static_cast to an integral type, and things that will be stored in the variant in
+        a RefPtr, where we use makeRefPtr.
+        (WebCore::WebGLRenderingContext::validateFramebufferFuncParameters):
+        Simplified and clarified the handling of COLOR_ATTACHMENT adding a FIXME about
+        something questionable.
+        (WebCore::WebGLRenderingContext::getParameter): Return WebGLAny, same idiom as
+        described above for getFramebufferAttachmentParameter.
+        * html/canvas/WebGLRenderingContext.h: Updated for above changes.
+
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::create): Updated to pass references
+        instead of pointers in a couple cases
+        (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): Changed graphics
+        context argument type from RefPtr&amp;&amp; to Ref&amp;&amp;. Also moved initialization of scalars
+        from the constructor to the class definition.
+        (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase): Pass a reference.
+        (WebCore::WebGLRenderingContextBase::createBuffer): Pass a reference instead of a pointer.
+        (WebCore::WebGLRenderingContextBase::createFramebuffer): Ditto.
+        (WebCore::WebGLRenderingContextBase::createTexture): Ditto.
+        (WebCore::WebGLRenderingContextBase::createProgram): Ditto.
+        (WebCore::WebGLRenderingContextBase::createRenderbuffer): Ditto.
+        (WebCore::WebGLRenderingContextBase::createShader): Ditto.
+        (WebCore::WebGLRenderingContextBase::deleteBuffer): Ditto.
+        (WebCore::WebGLRenderingContextBase::getBufferParameter): Update to use WebGLAny.
+        (WebCore::WebGLRenderingContextBase::getProgramParameter): Ditto.
+        (WebCore::WebGLRenderingContextBase::getRenderbufferParameter): Ditto.
+        (WebCore::WebGLRenderingContextBase::getShaderParameter): Ditto.
+        (WebCore::WebGLRenderingContextBase::getTexParameter): Ditto.
+        (WebCore::WebGLRenderingContextBase::getUniform): Ditto.
+        (WebCore::WebGLRenderingContextBase::getVertexAttrib): Ditto.
+        (WebCore::WebGLRenderingContextBase::getVertexAttribOffset): Removed unnneed
+        type casts.
+        (WebCore::WebGLRenderingContextBase::vertexAttribPointer): Pass a reference.
+        (WebCore::WebGLRenderingContextBase::removeSharedObject): Take a reference.
+        (WebCore::WebGLRenderingContextBase::addSharedObject): Ditto.
+        (WebCore::WebGLRenderingContextBase::removeContextObject): Ditto.
+        (WebCore::WebGLRenderingContextBase::addContextObject): Ditto.
+        (WebCore::WebGLRenderingContextBase::getBooleanParameter): Changed return type;
+        connversion to WebGLAny can happen at the point of use.
+        (WebCore::WebGLRenderingContextBase::getBooleanArrayParameter): Ditto.
+        (WebCore::WebGLRenderingContextBase::getFloatParameter): Ditto.
+        (WebCore::WebGLRenderingContextBase::getIntParameter): Ditto.
+        (WebCore::WebGLRenderingContextBase::getUnsignedIntParameter): Ditto.
+        (WebCore::WebGLRenderingContextBase::getInt64Parameter): Ditto.
+        (WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter): Ditto.
+        (WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter): Ditto.
+        (WebCore::WebGLRenderingContextBase::validateBufferDataParameters): Use
+        optional to simplify logic and get rid of a boolean.
+        (WebCore::WebGLRenderingContextBase::enableSupportedExtension): Added.
+        Helper used by the getExtension functions.
+        * html/canvas/WebGLRenderingContextBase.h: Updated for the above changes.
+        Also changed setBoundVertexArrayObject to take a raw pointer instead of
+        as PassRefPtr.
+
+        * html/canvas/WebGLSharedObject.cpp:
+        (WebCore::WebGLSharedObject::~WebGLSharedObject): Pass a reference.
+        (WebCore::WebGLSharedObject::detachContextGroup): Ditto.
+        (WebCore::WebGLSharedObject::getAGraphicsContext3D): Updated since the
+        underlying getAGraphicsContext3D function now returns a reference.
+
+        * html/canvas/WebGLSharedObject.h: Removed many unused &quot;is&quot; virtual functions.
+        * html/canvas/WebGLTransformFeedback.h: Ditto.
+
+        * html/canvas/WebGLVertexArrayObject.cpp:
+        (WebCore::WebGLVertexArrayObject::create): Updated for new type enumeration.
+        (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject): Ditto.
+        (WebCore::WebGLVertexArrayObject::deleteObjectImpl): Ditto.
+        * html/canvas/WebGLVertexArrayObject.h: Updated for above changes.
+
+        * html/canvas/WebGLVertexArrayObjectBase.cpp:
+        (WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase): Updated for new
+        type enumeration and moved initialization to class definition.
+        (WebCore::WebGLVertexArrayObjectBase::setElementArrayBuffer): Changed argument to
+        raw pointer instead of PassRefPtr.
+        (WebCore::WebGLVertexArrayObjectBase::setVertexAttribState): Changed argument to
+        reference instead of PassRefPtr.
+        (WebCore::WebGLVertexArrayObjectBase::unbindBuffer): Changed arugment type to
+        reference instead of PassRefPtr.
+        (WebCore::WebGLVertexArrayObjectBase::setVertexAttribDivisor): Removed unneeded
+        local variable.
+        * html/canvas/WebGLVertexArrayObjectBase.h: Updated for above changes.
+        Replaced VAOType with Type. Used class member initialization.
+
+        * html/canvas/WebGLVertexArrayObjectOES.cpp:
+        (WebCore::WebGLVertexArrayObjectOES::create): Updated for new type enumeration.
+        (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES): Ditto.
+        (WebCore::WebGLVertexArrayObjectOES::~WebGLVertexArrayObjectOES) Ditto.:
+        (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl): Ditto.
+        * html/canvas/WebGLVertexArrayObjectOES.h: Updated for above changes.
+
+        * html/forms/FileIconLoader.cpp:
+        (WebCore::FileIconLoader::iconLoaded): Renamed from notifyFinished. Also changed
+        the name of the function this calls to iconLoaded. Changed the arguemnt to
+        RefPtr&amp;&amp; instead of PassRefPtr.
+        * html/forms/FileIconLoader.h: Updated for above changes.
+
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::attachLater): Use isScriptElement instead of
+        toScriptElementIfPossible.
+        (WebCore::HTMLConstructionSite::insertForeignElement): Ditto.
+
+        * html/parser/HTMLDocumentParser.cpp:
+        (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Pass script
+        element as a Ref rather than RefPtr.
+        (WebCore::HTMLDocumentParser::watchForLoad): Pass a reference instead of a pointer.
+
+        * html/parser/HTMLScriptRunner.cpp:
+        (WebCore::HTMLScriptRunner::executeParsingBlockingScript): Deleted. Moved the code
+        into the single call site, execute ParsingBlockingScripts.
+        (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Changed argument
+        type to a reference from a RefPtr; this funtion was not taking ownership. Also remove
+        call to toScriptElementIfPossible,
+        since pending scripts now contains script elements already.
+        (WebCore::HTMLScriptRunner::execute): Changed argument type to Ref&lt;ScriptElement&gt;&amp;&amp;
+        from PassRefPtr&lt;Element&gt;.
+        (WebCore::HTMLScriptRunner::executeParsingBlockingScripts): Moved code here from
+        executeParsingBlockingScript. Also pass a reference.
+        (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing): Pass a reference.
+        (WebCore::requestPendingScript): Changed argument type to ScriptElement&amp; from
+        Element*.
+        (WebCore::HTMLScriptRunner::requestParsingBlockingScript): Ditto.
+        (WebCore::HTMLScriptRunner::requestDeferredScript): Ditto.
+        (WebCore::HTMLScriptRunner::runScript): Ditto.
+        * html/parser/HTMLScriptRunner.h: Updated for above changes.
+
+        * html/parser/HTMLTreeBuilder.cpp:
+        (WebCore::HTMLTreeBuilder::takeScriptToProcess): Changed return type from
+        RefPtr&lt;Element&gt; to RefPtr&lt;ScriptElement&gt;.
+        (WebCore::HTMLTreeBuilder::processEndTag): Downcast the script element to
+        HTMLScriptElement so we can store it as a ScriptElement.
+        (WebCore::HTMLTreeBuilder::processTokenInForeignContent): Downcast the script
+        element to SVGScriptElement so we can store it as a script element.
+        * html/parser/HTMLTreeBuilder.h: Updated for above changes. Changed the type
+        of m_scriptToProcess to RefPtr&lt;ScriptElement&gt;.
+
+        * html/parser/TextDocumentParser.cpp: Added now-needed include.
+
+        * html/parser/XSSAuditorDelegate.cpp:
+        (WebCore::XSSAuditorDelegate::generateViolationReport): Changed return type
+        to Ref from PassRefPtr.
+        * html/parser/XSSAuditorDelegate.h: Updated for above.
+
+        * html/track/AudioTrack.cpp:
+        (WebCore::AudioTrack::AudioTrack): Take references.
+        (WebCore::AudioTrack::setPrivate): Ditto.
+        (WebCore::AudioTrack::setEnabled): Removed redundant code to do what the
+        private setEnabled function is already going to do.
+        (WebCore::AudioTrack::inbandTrackIndex): Removed assertion since m_private
+        is now a Ref rather than RefPtr.
+        (WebCore::AudioTrack::enabledChanged): Added an early exit so we will only
+        call audioTrackEnabledChanged if m_enabled is actually changing. Also removed
+        the unneeded track private argument.
+        (WebCore::AudioTrack::idChanged): Ditto.
+        (WebCore::AudioTrack::labelChanged): Ditto.
+        (WebCore::AudioTrack::languageChanged): Ditto.
+        (WebCore::AudioTrack::willRemove): Ditto.
+        * html/track/AudioTrack.h: Updated for above changes.
+
+        * html/track/InbandDataTextTrack.cpp:
+        (WebCore::InbandDataTextTrack::addDataCue): Removed inband text track private
+        argument. Use contains instead of find/end.
+        (WebCore::InbandDataTextTrack::updateDataCue): Ditto. Use get instead of find/end.
+        (WebCore::InbandDataTextTrack::removeDataCue): Ditto.
+        * html/track/InbandDataTextTrack.h: Updated for above changes.
+
+        * html/track/InbandGenericTextTrack.cpp:
+        (WebCore::InbandGenericTextTrack::InbandGenericTextTrack): Take references.
+        (WebCore::InbandGenericTextTrack::create): Ditto.
+        (WebCore::InbandGenericTextTrack::updateCueFromCueData): Ditto.
+        (WebCore::InbandGenericTextTrack::addGenericCue): Ditto. Also removed unused
+        track private argument.
+        (WebCore::InbandGenericTextTrack::updateGenericCue): Ditto.
+        (WebCore::InbandGenericTextTrack::removeGenericCue): Ditto.
+        (WebCore::InbandGenericTextTrack::parseWebVTTCueData): Ditto.
+        (WebCore::InbandGenericTextTrack::parseWebVTTFileHeader): Ditto.
+        (WebCore::InbandGenericTextTrack::newRegionsParsed): Pass a reference.
+        * html/track/InbandGenericTextTrack.h: Updated for above changes.
+
+        * html/track/InbandTextTrack.cpp:
+        (WebCore::InbandTextTrack::create): Return a Ref instead of a PassRefPtr. Take
+        references.
+        (WebCore::InbandTextTrack::InbandTextTrack): Ditto.
+        (WebCore::InbandTextTrack::setPrivate): Take a reference instead of a PassRefPtr.
+        (WebCore::InbandTextTrack::isClosedCaptions): Removed check for null since m_private
+        is now a Ref and so never null.
+        (WebCore::InbandTextTrack::isSDH): Ditto.
+        (WebCore::InbandTextTrack::containsOnlyForcedSubtitles): Ditto.
+        (WebCore::InbandTextTrack::isMainProgramContent): Ditto.
+        (WebCore::InbandTextTrack::isEasyToRead): Ditto.
+        (WebCore::InbandTextTrack::inbandTrackIndex): Ditto.
+        (WebCore::InbandTextTrack::inBandMetadataTrackDispatchType): Ditto.
+        (WebCore::InbandTextTrack::idChanged): Removed unneeded track private argument.
+        (WebCore::InbandTextTrack::labelChanged): Ditto.
+        (WebCore::InbandTextTrack::languageChanged): Ditto.
+        (WebCore::InbandTextTrack::willRemove): Ditto.
+        (WebCore::InbandTextTrack::updateKindFromPrivate): Improved switch statement
+        by removing default so we get a warning if we forget to handle a kind value.
+        (WebCore::InbandTextTrack::startTimeVariance): Removed check for null.
+        * html/track/InbandTextTrack.h: Updated for above changes. Changed m_private from
+        a RefPtr to a Ref.
+
+        * html/track/InbandWebVTTTextTrack.cpp:
+        (WebCore::InbandWebVTTTextTrack::InbandWebVTTTextTrack): Take references.
+        (WebCore::InbandWebVTTTextTrack::create): Ditto.
+        (WebCore::InbandWebVTTTextTrack::parseWebVTTCueData): Removed unneeded track
+        private arguemnt.
+        (WebCore::InbandWebVTTTextTrack::newRegionsParsed): Pass a reference.
+        * html/track/InbandWebVTTTextTrack.h: Updated for above changes.
+
+        * html/track/LoadableTextTrack.cpp:
+        (WebCore::LoadableTextTrack::newCuesAvailable): Pass references.
+        (WebCore::LoadableTextTrack::newRegionsAvailable): Ditto.
+
+        * html/track/TextTrack.cpp:
+        (WebCore::TextTrack::~TextTrack): Use references.
+        (WebCore::TextTrack::setKind): Ditto.
+        (WebCore::TextTrack::setMode): Ditto.
+        (WebCore::TextTrack::removeAllCues): Ditto.
+        (WebCore::TextTrack::activeCues): Ditto.
+        (WebCore::TextTrack::addCue): Ditto.
+        (WebCore::TextTrack::removeCue): Removed unneeded code to handle a cue
+        that points to a track but is not in that track. Added a call to
+        setIsActive(false) here instead of having the remove function do it.
+        (WebCore::TextTrack::addRegion): Use references.
+        (WebCore::TextTrack::removeRegion): Removed unneeded code to handle a
+        region that points to a track but is not in that track.
+        (WebCore::TextTrack::cueWillChange): Use references.
+        (WebCore::TextTrack::cueDidChange): Ditto.
+        (WebCore::TextTrack::setLanguage): Ditto.
+        * html/track/TextTrack.h: Updated for above changes.
+
+        * html/track/TextTrackCue.cpp:
+        (WebCore::TextTrackCue::TextTrackCue): Initialized the data members
+        in the class definition.
+        (WebCore::TextTrackCue::cueIndex): Deleted.
+        (WebCore::TextTrackCue::invalidateCueIndex): Deleted.
+        * html/track/TextTrackCue.h: Updated for the above. Removed m_cueIndex,
+        because it is not a good design to store these and try to keep them up
+        to date.
+
+        * html/track/TextTrackCueList.cpp:
+        (WebCore::compareCues): Added. Helper for sorting and checking sorting.
+        (WebCore::TextTrackCueList::TextTrackCueList): Deleted. Let the compiler
+        generate this.
+        (WebCore::TextTrackCueList::length): Moved to header.
+        (WebCore::TextTrackCueList::cueIndex): Renamed from getCueIndex.
+        Changed return type to unsigned rather than unsigned long.
+        (WebCore::TextTrackCueList::item): Updated for name change.
+        (WebCore::TextTrackCueList::getCueById): Ditto.
+        (WebCore::TextTrackCueList::activeCues): Build the vector directly
+        rather than wastefully adding with TextTrackCueList::add, which will
+        try to sort.
+        (WebCore::TextTrackCueList::add): Take a Ref&amp;&amp; instead of a PassRefPtr.
+        Also, keep sorted using std::upper_bound instead of the recursive
+        binary search this code was using before. Also remove the
+        invalidateCueIndexes call since there are no cue indices any more.
+        Also remove the boolean return value since no caller was using it.
+        (WebCore::TextTrackCueList::remove): Take a reference instead of a
+        pointer. Also remove the boolean return value since no caller was using it.
+        (WebCore::TextTrackCueList::contains): Deleted. Was unused.
+        (WebCore::TextTrackCueList::updateCueIndex): Reimplemented using the
+        std::upper_bound and std::rotate operations. The old code that used
+        remove and add was inefficient and also could cause a cue to be deallocated
+        if something else wasn't holding a reference to the cue. Also changed to take
+        a reference.
+        (WebCore::TextTrackCueList::clear): Deleted. Was unused.
+        (WebCore::TextTrackCueList::invalidateCueIndexes): Deleted. No longer
+        needed since we don't store cue indices in the cues any more.
+        * html/track/TextTrackCueList.h: Updated for the above changes.
+
+        * html/track/VTTRegionList.cpp:
+        (WebCore::VTTRegionList::VTTRegionList): Deleted. Let the compiler
+        generate this.
+        (WebCore::VTTRegionList::length): Moved to header.
+        (WebCore::VTTRegionList::item): Updated for name and type changes.
+        (WebCore::VTTRegionList::getRegionById): Ditto.
+        (WebCore::VTTRegionList::add): Changed to take a Ref&amp;&amp; instead of a
+        PassRefPtr.
+        (WebCore::VTTRegionList::remove): Updated.
+        (WebCore::VTTRegionList::clear): Deleted. Was unused.
+        * html/track/VTTRegionList.h: Updated for the above changes.
+        * html/track/VTTRegionList.idl: Made return values nullable to reflect
+        the actual semantic of the code.
+
+        * html/track/VideoTrack.cpp:
+        (WebCore::VideoTrack::VideoTrack): Use references.
+        (WebCore::VideoTrack::setPrivate): Ditto.
+        (WebCore::VideoTrack::setSelected): Ditto.
+        (WebCore::VideoTrack::inbandTrackIndex): Removed assertion since m_private
+        is now a Ref instead of a RefPtr.
+        (WebCore::VideoTrack::selectedChanged): Removed unneeded track private argument.
+        (WebCore::VideoTrack::idChanged): Ditto.
+        (WebCore::VideoTrack::labelChanged): Ditto.
+        (WebCore::VideoTrack::languageChanged): Ditto.
+        (WebCore::VideoTrack::willRemove): Ditto.
+        (WebCore::VideoTrack::setKind): Updated to use reference.
+        (WebCore::VideoTrack::setLanguage): Ditto.
+        * html/track/VideoTrack.h: Updated for the above. Changed derivation to private.
+        Removed unneeded defaultKindKeyword.
+
+        * loader/EmptyClients.h: Updated to use reference.
+
+        * loader/PingLoader.cpp:
+        (WebCore::PingLoader::sendViolationReport): Take a Ref&amp;&amp; instead of RefPtr&amp;&amp;.
+        * loader/PingLoader.h: Updated for above change.
+
+        * page/Chrome.cpp:
+        (WebCore::Chrome::loadIconForFiles): Take a reference.
+        * page/Chrome.h: Updated for above change.
+        * page/ChromeClient.h: Ditto.
+
+        * page/csp/ContentSecurityPolicy.cpp:
+        (WebCore::ContentSecurityPolicy::reportViolation): Use auto.
+
+        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
+        (WebPlaybackSessionModelMediaElement::selectAudioMediaOption): Simplified
+        algorithm by removing unneeded direct call to audioTrackEnabledChanged,
+        which will be called by setEnabled and doesn't need to be called again here.
+        (WebPlaybackSessionModelMediaElement::selectLegibleMediaOption): Removed
+        unhelpful assertion and unnneded initialization.
+
+        * platform/graphics/AudioTrackPrivate.h: Removed unnneeed track private
+        argument and initialized data members where they are defined.
+
+        * platform/graphics/InbandTextTrackPrivateClient.h: Use Ref instead of
+        PassRefPtr, initialize data members where they are defined, and removed
+        the unneeded track private arguments from the client functions.
+
+        * platform/graphics/SourceBufferPrivate.h: Fixed functions that were taking
+        AtomicString to take a const&amp; instead. Use Ref&amp;&amp; instead of PassRefPtr.
+
+        * platform/graphics/SourceBufferPrivateClient.h: Removed unneded private pointer
+        arguments from client functions.
+
+        * platform/graphics/TrackPrivateBase.h: Removed unneeded private pointers
+        from client functions.
+        * platform/graphics/VideoTrackPrivate: Ditto.
+
+        * platform/graphics/avfoundation/AudioTrackPrivateAVF.h: Use
+        const AtomicString&amp;.
+
+        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
+        (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue): Updated for change to arguments.
+        (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Ditto.
+        (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues): Ditto.
+        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
+        (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Ditto.
+        (WebCore::InbandTextTrackPrivateAVF::resetCueValues): Ditto.
+        (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Ditto.
+
+        * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp:
+        (WebCore::AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC):
+        Moved initialization of data memebrs to where they are defined.
+        (WebCore::AudioTrackPrivateMediaSourceAVFObjC::enabled): Deleted. No longer needed.
+        (WebCore::AudioTrackPrivateMediaSourceAVFObjC::setEnabled): Changed to use the enabled
+        flag from the base class instead of a separate m_enabled in this class.
+        * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
+        Removed the enabled function and the m_enabled data member.
+
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: Marked functions
+        final instead of override and updated arguemnts.
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): Updated for change
+        to arguments.
+        (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame): Ditto.
+        (WebCore::SourceBufferPrivateAVFObjC::appendCompleted): Ditto.
+        (WebCore::SourceBufferPrivateAVFObjC::hasVideo): Ditto.
+        (WebCore::SourceBufferPrivateAVFObjC::hasAudio): Ditto.
+        (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): Ditto.
+        (WebCore::SourceBufferPrivateAVFObjC::flush): Ditto.
+        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
+        (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): Ditto.
+        (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime): Ditto.
+        (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Ditto.
+        (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): Ditto.
+        (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): Ditto.
+
+        * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h: Updated for
+        changes to arguments.
+        * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
+        (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample): Ditto.
+        * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
+        (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): Ditto.
+        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
+        (WebCore::AppendPipeline::appsinkNewSample): Ditto.
+        * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
+        (WebCore::SourceBufferPrivateGStreamer::append): Ditto.
+        (WebCore::SourceBufferPrivateGStreamer::flush): Ditto.
+        (WebCore::SourceBufferPrivateGStreamer::enqueueSample): Ditto.
+        (WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples): Ditto.
+        (WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples): Ditto.
+        (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Ditto.
+        (WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples): Ditto.
+        (WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment): Ditto.
+        (WebCore::SourceBufferPrivateGStreamer::didReceiveSample): Ditto.
+        (WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples): Ditto.
+        * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: Ditto.
+        * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
+        (WebCore::MockSourceBufferPrivate::append): Ditto.
+        (WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment): Ditto.
+        (WebCore::MockSourceBufferPrivate::didReceiveSample): Ditto.
+        (WebCore::MockSourceBufferPrivate::enqueuedSamplesForTrackID): Ditto.
+        (WebCore::MockSourceBufferPrivate::enqueueSample): Ditto.
+        (WebCore::MockSourceBufferPrivate::hasVideo): Ditto.
+        (WebCore::MockSourceBufferPrivate::hasAudio): Ditto.
+        (WebCore::MockSourceBufferPrivate::fastSeekTimeForMediaTime): Ditto.
+        (WebCore::MockSourceBufferPrivate::seekToTime): Ditto.
+        * platform/mock/mediasource/MockSourceBufferPrivate.h: Ditto.
+
+        * rendering/RenderSnapshottedPlugIn.cpp:
+        (WebCore::RenderSnapshottedPlugIn::updateSnapshot): Take raw pointer instead
+        of PassRefPtr.
+        * rendering/RenderSnapshottedPlugIn.h: Updated for above change.
+
+        * svg/SVGScriptElement.h: Added using to resolve the ambiguity with the
+        ref/deref from SVGElement and from ScriptElement.
+
+        * xml/parser/XMLDocumentParser.cpp:
+        (WebCore::XMLDocumentParser::notifyFinished): Updated to simplify since
+        the pending script now has a script element.
+
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLDocumentParser::startElementNs): Use isSciprtElement instead
+        of toScriptElementIfPossible.
+        (WebCore::XMLDocumentParser::endElementNs): Ditto. Also use downcastScriptElement.
+
</ins><span class="cx"> 2017-01-04  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move editing history scripts to WebCore PrivateHeaders
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2013 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -693,10 +693,10 @@
</span><span class="cx">     buffer.abortIfUpdating();
</span><span class="cx"> 
</span><span class="cx">     // 4. Let SourceBuffer audioTracks list equal the AudioTrackList object returned by sourceBuffer.audioTracks.
</span><del>-    RefPtr&lt;AudioTrackList&gt; audioTracks = buffer.audioTracks();
</del><ins>+    auto&amp; audioTracks = buffer.audioTracks();
</ins><span class="cx"> 
</span><span class="cx">     // 5. If the SourceBuffer audioTracks list is not empty, then run the following steps:
</span><del>-    if (audioTracks-&gt;length()) {
</del><ins>+    if (audioTracks.length()) {
</ins><span class="cx">         // 5.1 Let HTMLMediaElement audioTracks list equal the AudioTrackList object returned by the audioTracks
</span><span class="cx">         // attribute on the HTMLMediaElement.
</span><span class="cx">         // 5.2 Let the removed enabled audio track flag equal false.
</span><span class="lines">@@ -703,8 +703,8 @@
</span><span class="cx">         bool removedEnabledAudioTrack = false;
</span><span class="cx"> 
</span><span class="cx">         // 5.3 For each AudioTrack object in the SourceBuffer audioTracks list, run the following steps:
</span><del>-        while (audioTracks-&gt;length()) {
-            auto&amp; track = *audioTracks-&gt;lastItem();
</del><ins>+        while (audioTracks.length()) {
+            auto&amp; track = *audioTracks.lastItem();
</ins><span class="cx"> 
</span><span class="cx">             // 5.3.1 Set the sourceBuffer attribute on the AudioTrack object to null.
</span><span class="cx">             track.setSourceBuffer(nullptr);
</span><span class="lines">@@ -723,7 +723,7 @@
</span><span class="cx">             // 5.3.5 Remove the AudioTrack object from the SourceBuffer audioTracks list.
</span><span class="cx">             // 5.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
</span><span class="cx">             // cancelable, and that uses the TrackEvent interface, at the SourceBuffer audioTracks list.
</span><del>-            audioTracks-&gt;remove(track);
</del><ins>+            audioTracks.remove(track);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // 5.4 If the removed enabled audio track flag equals true, then queue a task to fire a simple event
</span><span class="lines">@@ -733,10 +733,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 6. Let SourceBuffer videoTracks list equal the VideoTrackList object returned by sourceBuffer.videoTracks.
</span><del>-    RefPtr&lt;VideoTrackList&gt; videoTracks = buffer.videoTracks();
</del><ins>+    auto&amp; videoTracks = buffer.videoTracks();
</ins><span class="cx"> 
</span><span class="cx">     // 7. If the SourceBuffer videoTracks list is not empty, then run the following steps:
</span><del>-    if (videoTracks-&gt;length()) {
</del><ins>+    if (videoTracks.length()) {
</ins><span class="cx">         // 7.1 Let HTMLMediaElement videoTracks list equal the VideoTrackList object returned by the videoTracks
</span><span class="cx">         // attribute on the HTMLMediaElement.
</span><span class="cx">         // 7.2 Let the removed selected video track flag equal false.
</span><span class="lines">@@ -743,8 +743,8 @@
</span><span class="cx">         bool removedSelectedVideoTrack = false;
</span><span class="cx"> 
</span><span class="cx">         // 7.3 For each VideoTrack object in the SourceBuffer videoTracks list, run the following steps:
</span><del>-        while (videoTracks-&gt;length()) {
-            auto&amp; track = *videoTracks-&gt;lastItem();
</del><ins>+        while (videoTracks.length()) {
+            auto&amp; track = *videoTracks.lastItem();
</ins><span class="cx"> 
</span><span class="cx">             // 7.3.1 Set the sourceBuffer attribute on the VideoTrack object to null.
</span><span class="cx">             track.setSourceBuffer(nullptr);
</span><span class="lines">@@ -763,7 +763,7 @@
</span><span class="cx">             // 7.3.5 Remove the VideoTrack object from the SourceBuffer videoTracks list.
</span><span class="cx">             // 7.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
</span><span class="cx">             // cancelable, and that uses the TrackEvent interface, at the SourceBuffer videoTracks list.
</span><del>-            videoTracks-&gt;remove(track);
</del><ins>+            videoTracks.remove(track);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // 7.4 If the removed selected video track flag equals true, then queue a task to fire a simple event
</span><span class="lines">@@ -773,10 +773,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 8. Let SourceBuffer textTracks list equal the TextTrackList object returned by sourceBuffer.textTracks.
</span><del>-    RefPtr&lt;TextTrackList&gt; textTracks = buffer.textTracks();
</del><ins>+    auto&amp; textTracks = buffer.textTracks();
</ins><span class="cx"> 
</span><span class="cx">     // 9. If the SourceBuffer textTracks list is not empty, then run the following steps:
</span><del>-    if (textTracks-&gt;length()) {
</del><ins>+    if (textTracks.length()) {
</ins><span class="cx">         // 9.1 Let HTMLMediaElement textTracks list equal the TextTrackList object returned by the textTracks
</span><span class="cx">         // attribute on the HTMLMediaElement.
</span><span class="cx">         // 9.2 Let the removed enabled text track flag equal false.
</span><span class="lines">@@ -783,8 +783,8 @@
</span><span class="cx">         bool removedEnabledTextTrack = false;
</span><span class="cx"> 
</span><span class="cx">         // 9.3 For each TextTrack object in the SourceBuffer textTracks list, run the following steps:
</span><del>-        while (textTracks-&gt;length()) {
-            auto&amp; track = *textTracks-&gt;lastItem();
</del><ins>+        while (textTracks.length()) {
+            auto&amp; track = *textTracks.lastItem();
</ins><span class="cx"> 
</span><span class="cx">             // 9.3.1 Set the sourceBuffer attribute on the TextTrack object to null.
</span><span class="cx">             track.setSourceBuffer(nullptr);
</span><span class="lines">@@ -803,7 +803,7 @@
</span><span class="cx">             // 9.3.5 Remove the TextTrack object from the SourceBuffer textTracks list.
</span><span class="cx">             // 9.3.6 Queue a task to fire a trusted event named removetrack, that does not bubble and is not
</span><span class="cx">             // cancelable, and that uses the TrackEvent interface, at the SourceBuffer textTracks list.
</span><del>-            textTracks-&gt;remove(track);
</del><ins>+            textTracks.remove(track);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // 9.4 If the removed enabled text track flag equals true, then queue a task to fire a simple event
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2013 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -59,9 +59,6 @@
</span><span class="cx"> #include &lt;runtime/VM.h&gt;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><del>-#if !LOG_DISABLED
-#include &lt;wtf/text/StringBuilder.h&gt;
-#endif
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -421,7 +418,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-MediaTime SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime(SourceBufferPrivate*, const MediaTime&amp; targetTime, const MediaTime&amp; negativeThreshold, const MediaTime&amp; positiveThreshold)
</del><ins>+MediaTime SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime(const MediaTime&amp; targetTime, const MediaTime&amp; negativeThreshold, const MediaTime&amp; positiveThreshold)
</ins><span class="cx"> {
</span><span class="cx">     MediaTime seekTime = targetTime;
</span><span class="cx">     MediaTime lowerBoundTime = targetTime - negativeThreshold;
</span><span class="lines">@@ -566,7 +563,7 @@
</span><span class="cx"> 
</span><span class="cx">     // 1. Loop Top: If the input buffer is empty, then jump to the need more data step below.
</span><span class="cx">     if (!m_pendingAppendData.size()) {
</span><del>-        sourceBufferPrivateAppendComplete(&amp;m_private.get(), AppendSucceeded);
</del><ins>+        sourceBufferPrivateAppendComplete(AppendSucceeded);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -574,7 +571,7 @@
</span><span class="cx">     m_pendingAppendData.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::sourceBufferPrivateAppendComplete(SourceBufferPrivate*, AppendResult result)
</del><ins>+void SourceBuffer::sourceBufferPrivateAppendComplete(AppendResult result)
</ins><span class="cx"> {
</span><span class="cx">     if (isRemoved())
</span><span class="cx">         return;
</span><span class="lines">@@ -635,7 +632,7 @@
</span><span class="cx">     LOG(Media, &quot;SourceBuffer::sourceBufferPrivateAppendComplete(%p) - buffered = %s&quot;, this, toString(m_buffered-&gt;ranges()).utf8().data());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::sourceBufferPrivateDidReceiveRenderingError(SourceBufferPrivate*, int error)
</del><ins>+void SourceBuffer::sourceBufferPrivateDidReceiveRenderingError(int error)
</ins><span class="cx"> {
</span><span class="cx"> #if LOG_DISABLED
</span><span class="cx">     UNUSED_PARAM(error);
</span><span class="lines">@@ -945,7 +942,7 @@
</span><span class="cx">     if (isRemoved())
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    HTMLMediaElement* element = m_source-&gt;mediaElement();
</del><ins>+    auto* element = m_source-&gt;mediaElement();
</ins><span class="cx">     if (!element)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="lines">@@ -952,28 +949,25 @@
</span><span class="cx">     return element-&gt;maximumSourceBufferSize(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-VideoTrackList* SourceBuffer::videoTracks()
</del><ins>+VideoTrackList&amp; SourceBuffer::videoTracks()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_videoTracks)
</span><del>-        m_videoTracks = VideoTrackList::create(m_source-&gt;mediaElement(), ActiveDOMObject::scriptExecutionContext());
-
-    return m_videoTracks.get();
</del><ins>+        m_videoTracks = VideoTrackList::create(m_source-&gt;mediaElement(), scriptExecutionContext());
+    return *m_videoTracks;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-AudioTrackList* SourceBuffer::audioTracks()
</del><ins>+AudioTrackList&amp; SourceBuffer::audioTracks()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_audioTracks)
</span><del>-        m_audioTracks = AudioTrackList::create(m_source-&gt;mediaElement(), ActiveDOMObject::scriptExecutionContext());
-
-    return m_audioTracks.get();
</del><ins>+        m_audioTracks = AudioTrackList::create(m_source-&gt;mediaElement(), scriptExecutionContext());
+    return *m_audioTracks;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-TextTrackList* SourceBuffer::textTracks()
</del><ins>+TextTrackList&amp; SourceBuffer::textTracks()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_textTracks)
</span><del>-        m_textTracks = TextTrackList::create(m_source-&gt;mediaElement(), ActiveDOMObject::scriptExecutionContext());
-
-    return m_textTracks.get();
</del><ins>+        m_textTracks = TextTrackList::create(m_source-&gt;mediaElement(), scriptExecutionContext());
+    return *m_textTracks;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBuffer::setActive(bool active)
</span><span class="lines">@@ -987,7 +981,7 @@
</span><span class="cx">         m_source-&gt;sourceBufferDidChangeActiveState(*this, active);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment(SourceBufferPrivate*, const InitializationSegment&amp; segment)
</del><ins>+void SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment(const InitializationSegment&amp; segment)
</ins><span class="cx"> {
</span><span class="cx">     if (isRemoved())
</span><span class="cx">         return;
</span><span class="lines">@@ -1024,40 +1018,40 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         // 3.2 Add the appropriate track descriptions from this initialization segment to each of the track buffers.
</span><del>-        ASSERT(segment.audioTracks.size() == audioTracks()-&gt;length());
</del><ins>+        ASSERT(segment.audioTracks.size() == audioTracks().length());
</ins><span class="cx">         for (auto&amp; audioTrackInfo : segment.audioTracks) {
</span><del>-            if (audioTracks()-&gt;length() == 1) {
-                audioTracks()-&gt;item(0)-&gt;setPrivate(audioTrackInfo.track);
</del><ins>+            if (audioTracks().length() == 1) {
+                audioTracks().item(0)-&gt;setPrivate(*audioTrackInfo.track);
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            auto audioTrack = audioTracks()-&gt;getTrackById(audioTrackInfo.track-&gt;id());
</del><ins>+            auto audioTrack = audioTracks().getTrackById(audioTrackInfo.track-&gt;id());
</ins><span class="cx">             ASSERT(audioTrack);
</span><del>-            audioTrack-&gt;setPrivate(audioTrackInfo.track);
</del><ins>+            audioTrack-&gt;setPrivate(*audioTrackInfo.track);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        ASSERT(segment.videoTracks.size() == videoTracks()-&gt;length());
</del><ins>+        ASSERT(segment.videoTracks.size() == videoTracks().length());
</ins><span class="cx">         for (auto&amp; videoTrackInfo : segment.videoTracks) {
</span><del>-            if (videoTracks()-&gt;length() == 1) {
-                videoTracks()-&gt;item(0)-&gt;setPrivate(videoTrackInfo.track);
</del><ins>+            if (videoTracks().length() == 1) {
+                videoTracks().item(0)-&gt;setPrivate(*videoTrackInfo.track);
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            auto videoTrack = videoTracks()-&gt;getTrackById(videoTrackInfo.track-&gt;id());
</del><ins>+            auto videoTrack = videoTracks().getTrackById(videoTrackInfo.track-&gt;id());
</ins><span class="cx">             ASSERT(videoTrack);
</span><del>-            videoTrack-&gt;setPrivate(videoTrackInfo.track);
</del><ins>+            videoTrack-&gt;setPrivate(*videoTrackInfo.track);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        ASSERT(segment.textTracks.size() == textTracks()-&gt;length());
</del><ins>+        ASSERT(segment.textTracks.size() == textTracks().length());
</ins><span class="cx">         for (auto&amp; textTrackInfo : segment.textTracks) {
</span><del>-            if (textTracks()-&gt;length() == 1) {
-                downcast&lt;InbandTextTrack&gt;(*textTracks()-&gt;item(0)).setPrivate(textTrackInfo.track);
</del><ins>+            if (textTracks().length() == 1) {
+                downcast&lt;InbandTextTrack&gt;(*textTracks().item(0)).setPrivate(*textTrackInfo.track);
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            auto textTrack = textTracks()-&gt;getTrackById(textTrackInfo.track-&gt;id());
</del><ins>+            auto textTrack = textTracks().getTrackById(textTrackInfo.track-&gt;id());
</ins><span class="cx">             ASSERT(textTrack);
</span><del>-            downcast&lt;InbandTextTrack&gt;(*textTrack).setPrivate(textTrackInfo.track);
</del><ins>+            downcast&lt;InbandTextTrack&gt;(*textTrack).setPrivate(*textTrackInfo.track);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // 3.3 Set the need random access point flag on all track buffers to true.
</span><span class="lines">@@ -1076,16 +1070,14 @@
</span><span class="cx"> 
</span><span class="cx">         // 5.2 For each audio track in the initialization segment, run following steps:
</span><span class="cx">         for (auto&amp; audioTrackInfo : segment.audioTracks) {
</span><del>-            AudioTrackPrivate* audioTrackPrivate = audioTrackInfo.track.get();
-
</del><span class="cx">             // FIXME: Implement steps 5.2.1-5.2.8.1 as per Editor's Draft 09 January 2015, and reorder this
</span><span class="cx">             // 5.2.1 Let new audio track be a new AudioTrack object.
</span><span class="cx">             // 5.2.2 Generate a unique ID and assign it to the id property on new video track.
</span><del>-            auto newAudioTrack = AudioTrack::create(this, audioTrackPrivate);
</del><ins>+            auto newAudioTrack = AudioTrack::create(*this, *audioTrackInfo.track);
</ins><span class="cx">             newAudioTrack-&gt;setSourceBuffer(this);
</span><span class="cx"> 
</span><span class="cx">             // 5.2.3 If audioTracks.length equals 0, then run the following steps:
</span><del>-            if (!audioTracks()-&gt;length()) {
</del><ins>+            if (!audioTracks().length()) {
</ins><span class="cx">                 // 5.2.3.1 Set the enabled property on new audio track to true.
</span><span class="cx">                 newAudioTrack-&gt;setEnabled(true);
</span><span class="cx"> 
</span><span class="lines">@@ -1097,7 +1089,7 @@
</span><span class="cx">             // 5.2.5 Queue a task to fire a trusted event named addtrack, that does not bubble and is
</span><span class="cx">             // not cancelable, and that uses the TrackEvent interface, at the AudioTrackList object
</span><span class="cx">             // referenced by the audioTracks attribute on this SourceBuffer object.
</span><del>-            audioTracks()-&gt;append(newAudioTrack.copyRef());
</del><ins>+            audioTracks().append(newAudioTrack.copyRef());
</ins><span class="cx"> 
</span><span class="cx">             // 5.2.6 Add new audio track to the audioTracks attribute on the HTMLMediaElement.
</span><span class="cx">             // 5.2.7 Queue a task to fire a trusted event named addtrack, that does not bubble and is
</span><span class="lines">@@ -1107,7 +1099,7 @@
</span><span class="cx"> 
</span><span class="cx">             // 5.2.8 Create a new track buffer to store coded frames for this track.
</span><span class="cx">             ASSERT(!m_trackBufferMap.contains(newAudioTrack-&gt;id()));
</span><del>-            TrackBuffer&amp; trackBuffer = m_trackBufferMap.add(newAudioTrack-&gt;id(), TrackBuffer()).iterator-&gt;value;
</del><ins>+            auto&amp; trackBuffer = m_trackBufferMap.add(newAudioTrack-&gt;id(), TrackBuffer()).iterator-&gt;value;
</ins><span class="cx"> 
</span><span class="cx">             // 5.2.9 Add the track description for this track to the track buffer.
</span><span class="cx">             trackBuffer.description = audioTrackInfo.description;
</span><span class="lines">@@ -1117,16 +1109,14 @@
</span><span class="cx"> 
</span><span class="cx">         // 5.3 For each video track in the initialization segment, run following steps:
</span><span class="cx">         for (auto&amp; videoTrackInfo : segment.videoTracks) {
</span><del>-            VideoTrackPrivate* videoTrackPrivate = videoTrackInfo.track.get();
-
</del><span class="cx">             // FIXME: Implement steps 5.3.1-5.3.8.1 as per Editor's Draft 09 January 2015, and reorder this
</span><span class="cx">             // 5.3.1 Let new video track be a new VideoTrack object.
</span><span class="cx">             // 5.3.2 Generate a unique ID and assign it to the id property on new video track.
</span><del>-            auto newVideoTrack = VideoTrack::create(this, videoTrackPrivate);
</del><ins>+            auto newVideoTrack = VideoTrack::create(*this, *videoTrackInfo.track);
</ins><span class="cx">             newVideoTrack-&gt;setSourceBuffer(this);
</span><span class="cx"> 
</span><span class="cx">             // 5.3.3 If videoTracks.length equals 0, then run the following steps:
</span><del>-            if (!videoTracks()-&gt;length()) {
</del><ins>+            if (!videoTracks().length()) {
</ins><span class="cx">                 // 5.3.3.1 Set the selected property on new video track to true.
</span><span class="cx">                 newVideoTrack-&gt;setSelected(true);
</span><span class="cx"> 
</span><span class="lines">@@ -1138,7 +1128,7 @@
</span><span class="cx">             // 5.3.5 Queue a task to fire a trusted event named addtrack, that does not bubble and is
</span><span class="cx">             // not cancelable, and that uses the TrackEvent interface, at the VideoTrackList object
</span><span class="cx">             // referenced by the videoTracks attribute on this SourceBuffer object.
</span><del>-            videoTracks()-&gt;append(newVideoTrack.copyRef());
</del><ins>+            videoTracks().append(newVideoTrack.copyRef());
</ins><span class="cx"> 
</span><span class="cx">             // 5.3.6 Add new video track to the videoTracks attribute on the HTMLMediaElement.
</span><span class="cx">             // 5.3.7 Queue a task to fire a trusted event named addtrack, that does not bubble and is
</span><span class="lines">@@ -1148,7 +1138,7 @@
</span><span class="cx"> 
</span><span class="cx">             // 5.3.8 Create a new track buffer to store coded frames for this track.
</span><span class="cx">             ASSERT(!m_trackBufferMap.contains(newVideoTrack-&gt;id()));
</span><del>-            TrackBuffer&amp; trackBuffer = m_trackBufferMap.add(newVideoTrack-&gt;id(), TrackBuffer()).iterator-&gt;value;
</del><ins>+            auto&amp; trackBuffer = m_trackBufferMap.add(newVideoTrack-&gt;id(), TrackBuffer()).iterator-&gt;value;
</ins><span class="cx"> 
</span><span class="cx">             // 5.3.9 Add the track description for this track to the track buffer.
</span><span class="cx">             trackBuffer.description = videoTrackInfo.description;
</span><span class="lines">@@ -1158,16 +1148,16 @@
</span><span class="cx"> 
</span><span class="cx">         // 5.4 For each text track in the initialization segment, run following steps:
</span><span class="cx">         for (auto&amp; textTrackInfo : segment.textTracks) {
</span><del>-            InbandTextTrackPrivate* textTrackPrivate = textTrackInfo.track.get();
</del><ins>+            auto&amp; textTrackPrivate = *textTrackInfo.track;
</ins><span class="cx"> 
</span><span class="cx">             // FIXME: Implement steps 5.4.1-5.4.8.1 as per Editor's Draft 09 January 2015, and reorder this
</span><span class="cx">             // 5.4.1 Let new text track be a new TextTrack object with its properties populated with the
</span><span class="cx">             // appropriate information from the initialization segment.
</span><del>-            RefPtr&lt;InbandTextTrack&gt; newTextTrack = InbandTextTrack::create(scriptExecutionContext(), this, textTrackPrivate);
</del><ins>+            auto newTextTrack = InbandTextTrack::create(*scriptExecutionContext(), *this, textTrackPrivate);
</ins><span class="cx"> 
</span><span class="cx">             // 5.4.2 If the mode property on new text track equals &quot;showing&quot; or &quot;hidden&quot;, then set active
</span><span class="cx">             // track flag to true.
</span><del>-            if (textTrackPrivate-&gt;mode() != InbandTextTrackPrivate::Disabled)
</del><ins>+            if (textTrackPrivate.mode() != InbandTextTrackPrivate::Disabled)
</ins><span class="cx">                 activeTrackFlag = true;
</span><span class="cx"> 
</span><span class="cx">             // 5.4.3 Add new text track to the textTracks attribute on this SourceBuffer object.
</span><span class="lines">@@ -1174,17 +1164,17 @@
</span><span class="cx">             // 5.4.4 Queue a task to fire a trusted event named addtrack, that does not bubble and is
</span><span class="cx">             // not cancelable, and that uses the TrackEvent interface, at textTracks attribute on this
</span><span class="cx">             // SourceBuffer object.
</span><del>-            textTracks()-&gt;append(*newTextTrack);
</del><ins>+            textTracks().append(newTextTrack.get());
</ins><span class="cx"> 
</span><span class="cx">             // 5.4.5 Add new text track to the textTracks attribute on the HTMLMediaElement.
</span><span class="cx">             // 5.4.6 Queue a task to fire a trusted event named addtrack, that does not bubble and is
</span><span class="cx">             // not cancelable, and that uses the TrackEvent interface, at the TextTrackList object
</span><span class="cx">             // referenced by the textTracks attribute on the HTMLMediaElement.
</span><del>-            m_source-&gt;mediaElement()-&gt;textTracks().append(newTextTrack.releaseNonNull());
</del><ins>+            m_source-&gt;mediaElement()-&gt;textTracks().append(WTFMove(newTextTrack));
</ins><span class="cx"> 
</span><span class="cx">             // 5.4.7 Create a new track buffer to store coded frames for this track.
</span><del>-            ASSERT(!m_trackBufferMap.contains(textTrackPrivate-&gt;id()));
-            TrackBuffer&amp; trackBuffer = m_trackBufferMap.add(textTrackPrivate-&gt;id(), TrackBuffer()).iterator-&gt;value;
</del><ins>+            ASSERT(!m_trackBufferMap.contains(textTrackPrivate.id()));
+            auto&amp; trackBuffer = m_trackBufferMap.add(textTrackPrivate.id(), TrackBuffer()).iterator-&gt;value;
</ins><span class="cx"> 
</span><span class="cx">             // 5.4.8 Add the track description for this track to the track buffer.
</span><span class="cx">             trackBuffer.description = textTrackInfo.description;
</span><span class="lines">@@ -1231,9 +1221,9 @@
</span><span class="cx"> 
</span><span class="cx">     // Note: those are checks from step 3.1
</span><span class="cx">     //   * The number of audio, video, and text tracks match what was in the first initialization segment.
</span><del>-    if (segment.audioTracks.size() != audioTracks()-&gt;length()
-        || segment.videoTracks.size() != videoTracks()-&gt;length()
-        || segment.textTracks.size() != textTracks()-&gt;length())
</del><ins>+    if (segment.audioTracks.size() != audioTracks().length()
+        || segment.videoTracks.size() != videoTracks().length()
+        || segment.textTracks.size() != textTracks().length())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     //   * The codecs for each track, match what was specified in the first initialization segment.
</span><span class="lines">@@ -1319,7 +1309,7 @@
</span><span class="cx">         m_source-&gt;streamEndedWithError(MediaSource::EndOfStreamError::Decode);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, MediaSample&amp; sample)
</del><ins>+void SourceBuffer::sourceBufferPrivateDidReceiveSample(MediaSample&amp; sample)
</ins><span class="cx"> {
</span><span class="cx">     if (isRemoved())
</span><span class="cx">         return;
</span><span class="lines">@@ -1666,23 +1656,23 @@
</span><span class="cx">     return m_videoTracks &amp;&amp; m_videoTracks-&gt;length();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SourceBuffer::sourceBufferPrivateHasAudio(const SourceBufferPrivate*) const
</del><ins>+bool SourceBuffer::sourceBufferPrivateHasAudio() const
</ins><span class="cx"> {
</span><span class="cx">     return hasAudio();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SourceBuffer::sourceBufferPrivateHasVideo(const SourceBufferPrivate*) const
</del><ins>+bool SourceBuffer::sourceBufferPrivateHasVideo() const
</ins><span class="cx"> {
</span><span class="cx">     return hasVideo();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::videoTrackSelectedChanged(VideoTrack* track)
</del><ins>+void SourceBuffer::videoTrackSelectedChanged(VideoTrack&amp; track)
</ins><span class="cx"> {
</span><span class="cx">     // 2.4.5 Changes to selected/enabled track state
</span><span class="cx">     // If the selected video track changes, then run the following steps:
</span><span class="cx">     // 1. If the SourceBuffer associated with the previously selected video track is not associated with
</span><span class="cx">     // any other enabled tracks, run the following steps:
</span><del>-    if (!track-&gt;selected()
</del><ins>+    if (!track.selected()
</ins><span class="cx">         &amp;&amp; (!m_videoTracks || !m_videoTracks-&gt;isAnyTrackEnabled())
</span><span class="cx">         &amp;&amp; (!m_audioTracks || !m_audioTracks-&gt;isAnyTrackEnabled())
</span><span class="cx">         &amp;&amp; (!m_textTracks || !m_textTracks-&gt;isAnyTrackEnabled())) {
</span><span class="lines">@@ -1689,7 +1679,7 @@
</span><span class="cx">         // 1.1 Remove the SourceBuffer from activeSourceBuffers.
</span><span class="cx">         // 1.2 Queue a task to fire a simple event named removesourcebuffer at activeSourceBuffers
</span><span class="cx">         setActive(false);
</span><del>-    } else if (track-&gt;selected()) {
</del><ins>+    } else if (track.selected()) {
</ins><span class="cx">         // 2. If the SourceBuffer associated with the newly selected video track is not already in activeSourceBuffers,
</span><span class="cx">         // run the following steps:
</span><span class="cx">         // 2.1 Add the SourceBuffer to activeSourceBuffers.
</span><span class="lines">@@ -1697,7 +1687,7 @@
</span><span class="cx">         setActive(true);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_videoTracks &amp;&amp; m_videoTracks-&gt;contains(*track))
</del><ins>+    if (m_videoTracks &amp;&amp; m_videoTracks-&gt;contains(track))
</ins><span class="cx">         m_videoTracks-&gt;scheduleChangeEvent();
</span><span class="cx"> 
</span><span class="cx">     if (!isRemoved())
</span><span class="lines">@@ -1704,12 +1694,12 @@
</span><span class="cx">         m_source-&gt;mediaElement()-&gt;videoTrackSelectedChanged(track);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::audioTrackEnabledChanged(AudioTrack* track)
</del><ins>+void SourceBuffer::audioTrackEnabledChanged(AudioTrack&amp; track)
</ins><span class="cx"> {
</span><span class="cx">     // 2.4.5 Changes to selected/enabled track state
</span><span class="cx">     // If an audio track becomes disabled and the SourceBuffer associated with this track is not
</span><span class="cx">     // associated with any other enabled or selected track, then run the following steps:
</span><del>-    if (!track-&gt;enabled()
</del><ins>+    if (!track.enabled()
</ins><span class="cx">         &amp;&amp; (!m_videoTracks || !m_videoTracks-&gt;isAnyTrackEnabled())
</span><span class="cx">         &amp;&amp; (!m_audioTracks || !m_audioTracks-&gt;isAnyTrackEnabled())
</span><span class="cx">         &amp;&amp; (!m_textTracks || !m_textTracks-&gt;isAnyTrackEnabled())) {
</span><span class="lines">@@ -1716,7 +1706,7 @@
</span><span class="cx">         // 1. Remove the SourceBuffer associated with the audio track from activeSourceBuffers
</span><span class="cx">         // 2. Queue a task to fire a simple event named removesourcebuffer at activeSourceBuffers
</span><span class="cx">         setActive(false);
</span><del>-    } else if (track-&gt;enabled()) {
</del><ins>+    } else if (track.enabled()) {
</ins><span class="cx">         // If an audio track becomes enabled and the SourceBuffer associated with this track is
</span><span class="cx">         // not already in activeSourceBuffers, then run the following steps:
</span><span class="cx">         // 1. Add the SourceBuffer associated with the audio track to activeSourceBuffers
</span><span class="lines">@@ -1724,7 +1714,7 @@
</span><span class="cx">         setActive(true);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_audioTracks &amp;&amp; m_audioTracks-&gt;contains(*track))
</del><ins>+    if (m_audioTracks &amp;&amp; m_audioTracks-&gt;contains(track))
</ins><span class="cx">         m_audioTracks-&gt;scheduleChangeEvent();
</span><span class="cx"> 
</span><span class="cx">     if (!isRemoved())
</span><span class="lines">@@ -1731,12 +1721,12 @@
</span><span class="cx">         m_source-&gt;mediaElement()-&gt;audioTrackEnabledChanged(track);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::textTrackModeChanged(TextTrack* track)
</del><ins>+void SourceBuffer::textTrackModeChanged(TextTrack&amp; track)
</ins><span class="cx"> {
</span><span class="cx">     // 2.4.5 Changes to selected/enabled track state
</span><span class="cx">     // If a text track mode becomes &quot;disabled&quot; and the SourceBuffer associated with this track is not
</span><span class="cx">     // associated with any other enabled or selected track, then run the following steps:
</span><del>-    if (track-&gt;mode() == TextTrack::Mode::Disabled
</del><ins>+    if (track.mode() == TextTrack::Mode::Disabled
</ins><span class="cx">         &amp;&amp; (!m_videoTracks || !m_videoTracks-&gt;isAnyTrackEnabled())
</span><span class="cx">         &amp;&amp; (!m_audioTracks || !m_audioTracks-&gt;isAnyTrackEnabled())
</span><span class="cx">         &amp;&amp; (!m_textTracks || !m_textTracks-&gt;isAnyTrackEnabled())) {
</span><span class="lines">@@ -1751,7 +1741,7 @@
</span><span class="cx">         setActive(true);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_textTracks &amp;&amp; m_textTracks-&gt;contains(*track))
</del><ins>+    if (m_textTracks &amp;&amp; m_textTracks-&gt;contains(track))
</ins><span class="cx">         m_textTracks-&gt;scheduleChangeEvent();
</span><span class="cx"> 
</span><span class="cx">     if (!isRemoved())
</span><span class="lines">@@ -1758,37 +1748,37 @@
</span><span class="cx">         m_source-&gt;mediaElement()-&gt;textTrackModeChanged(track);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::textTrackAddCue(TextTrack* track, TextTrackCue&amp; cue)
</del><ins>+void SourceBuffer::textTrackAddCue(TextTrack&amp; track, TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><span class="cx">     if (!isRemoved())
</span><span class="cx">         m_source-&gt;mediaElement()-&gt;textTrackAddCue(track, cue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::textTrackAddCues(TextTrack* track, TextTrackCueList const* cueList)
</del><ins>+void SourceBuffer::textTrackAddCues(TextTrack&amp; track, const TextTrackCueList&amp; cueList)
</ins><span class="cx"> {
</span><span class="cx">     if (!isRemoved())
</span><span class="cx">         m_source-&gt;mediaElement()-&gt;textTrackAddCues(track, cueList);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::textTrackRemoveCue(TextTrack* track, TextTrackCue&amp; cue)
</del><ins>+void SourceBuffer::textTrackRemoveCue(TextTrack&amp; track, TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><span class="cx">     if (!isRemoved())
</span><span class="cx">         m_source-&gt;mediaElement()-&gt;textTrackRemoveCue(track, cue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::textTrackRemoveCues(TextTrack* track, TextTrackCueList const* cueList)
</del><ins>+void SourceBuffer::textTrackRemoveCues(TextTrack&amp; track, const TextTrackCueList&amp; cueList)
</ins><span class="cx"> {
</span><span class="cx">     if (!isRemoved())
</span><span class="cx">         m_source-&gt;mediaElement()-&gt;textTrackRemoveCues(track, cueList);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::textTrackKindChanged(TextTrack* track)
</del><ins>+void SourceBuffer::textTrackKindChanged(TextTrack&amp; track)
</ins><span class="cx"> {
</span><span class="cx">     if (!isRemoved())
</span><span class="cx">         m_source-&gt;mediaElement()-&gt;textTrackKindChanged(track);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples(SourceBufferPrivate*, AtomicString trackID)
</del><ins>+void SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples(const AtomicString&amp; trackID)
</ins><span class="cx"> {
</span><span class="cx">     LOG(MediaSource, &quot;SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples(%p)&quot;, this);
</span><span class="cx">     auto it = m_trackBufferMap.find(trackID);
</span><span class="lines">@@ -1795,12 +1785,12 @@
</span><span class="cx">     if (it == m_trackBufferMap.end())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    TrackBuffer&amp; trackBuffer = it-&gt;value;
</del><ins>+    auto&amp; trackBuffer = it-&gt;value;
</ins><span class="cx">     if (!trackBuffer.needsReenqueueing &amp;&amp; !m_source-&gt;isSeeking())
</span><span class="cx">         provideMediaData(trackBuffer, trackID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::provideMediaData(TrackBuffer&amp; trackBuffer, AtomicString trackID)
</del><ins>+void SourceBuffer::provideMediaData(TrackBuffer&amp; trackBuffer, const AtomicString&amp; trackID)
</ins><span class="cx"> {
</span><span class="cx">     if (m_source-&gt;isSeeking())
</span><span class="cx">         return;
</span><span class="lines">@@ -1834,7 +1824,7 @@
</span><span class="cx"> 
</span><span class="cx">         trackBuffer.lastEnqueuedPresentationTime = sample-&gt;presentationTime();
</span><span class="cx">         trackBuffer.lastEnqueuedDecodeEndTime = sample-&gt;decodeTime() + sample-&gt;duration();
</span><del>-        m_private-&gt;enqueueSample(WTFMove(sample), trackID);
</del><ins>+        m_private-&gt;enqueueSample(sample.releaseNonNull(), trackID);
</ins><span class="cx"> #if !LOG_DISABLED
</span><span class="cx">         ++enqueuedSamples;
</span><span class="cx"> #endif
</span><span class="lines">@@ -1843,7 +1833,7 @@
</span><span class="cx">     LOG(MediaSource, &quot;SourceBuffer::provideMediaData(%p) - Enqueued %u samples&quot;, this, enqueuedSamples);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBuffer::reenqueueMediaForTime(TrackBuffer&amp; trackBuffer, AtomicString trackID, const MediaTime&amp; time)
</del><ins>+void SourceBuffer::reenqueueMediaForTime(TrackBuffer&amp; trackBuffer, const AtomicString&amp; trackID, const MediaTime&amp; time)
</ins><span class="cx"> {
</span><span class="cx">     m_private-&gt;flush(trackID);
</span><span class="cx">     trackBuffer.decodeQueue.clear();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceSourceBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2013 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> class BufferSource;
</span><span class="cx"> class MediaSource;
</span><span class="cx"> class PlatformTimeRanges;
</span><ins>+class SourceBufferPrivate;
</ins><span class="cx"> class TextTrackList;
</span><span class="cx"> class TimeRanges;
</span><span class="cx"> class VideoTrackList;
</span><span class="lines">@@ -64,9 +65,9 @@
</span><span class="cx">     ExceptionOr&lt;void&gt; setTimestampOffset(double);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><del>-    VideoTrackList* videoTracks();
-    AudioTrackList* audioTracks();
-    TextTrackList* textTracks();
</del><ins>+    VideoTrackList&amp; videoTracks();
+    AudioTrackList&amp; audioTracks();
+    TextTrackList&amp; textTracks();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     double appendWindowStart() const;
</span><span class="lines">@@ -124,26 +125,25 @@
</span><span class="cx">     const char* activeDOMObjectName() const final;
</span><span class="cx">     bool canSuspendForDocumentSuspension() const final;
</span><span class="cx"> 
</span><del>-    void sourceBufferPrivateDidReceiveInitializationSegment(SourceBufferPrivate*, const InitializationSegment&amp;) final;
-    void sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, MediaSample&amp;) final;
-    bool sourceBufferPrivateHasAudio(const SourceBufferPrivate*) const final;
-    bool sourceBufferPrivateHasVideo(const SourceBufferPrivate*) const final;
-    void sourceBufferPrivateDidBecomeReadyForMoreSamples(SourceBufferPrivate*, AtomicString trackID) final;
-    MediaTime sourceBufferPrivateFastSeekTimeForMediaTime(SourceBufferPrivate*, const MediaTime&amp;, const MediaTime&amp; negativeThreshold, const MediaTime&amp; positiveThreshold) final;
-    void sourceBufferPrivateAppendComplete(SourceBufferPrivate*, AppendResult) final;
-    void sourceBufferPrivateDidReceiveRenderingError(SourceBufferPrivate*, int errorCode) final;
</del><ins>+    void sourceBufferPrivateDidReceiveInitializationSegment(const InitializationSegment&amp;) final;
+    void sourceBufferPrivateDidReceiveSample(MediaSample&amp;) final;
+    bool sourceBufferPrivateHasAudio() const final;
+    bool sourceBufferPrivateHasVideo() const final;
+    void sourceBufferPrivateDidBecomeReadyForMoreSamples(const AtomicString&amp; trackID) final;
+    MediaTime sourceBufferPrivateFastSeekTimeForMediaTime(const MediaTime&amp;, const MediaTime&amp; negativeThreshold, const MediaTime&amp; positiveThreshold) final;
+    void sourceBufferPrivateAppendComplete(AppendResult) final;
+    void sourceBufferPrivateDidReceiveRenderingError(int errorCode) final;
</ins><span class="cx"> 
</span><del>-    void audioTrackEnabledChanged(AudioTrack*) final;
</del><ins>+    void audioTrackEnabledChanged(AudioTrack&amp;) final;
+    void videoTrackSelectedChanged(VideoTrack&amp;) final;
</ins><span class="cx"> 
</span><del>-    void videoTrackSelectedChanged(VideoTrack*) final;
</del><ins>+    void textTrackKindChanged(TextTrack&amp;) final;
+    void textTrackModeChanged(TextTrack&amp;) final;
+    void textTrackAddCues(TextTrack&amp;, const TextTrackCueList&amp;) final;
+    void textTrackRemoveCues(TextTrack&amp;, const TextTrackCueList&amp;) final;
+    void textTrackAddCue(TextTrack&amp;, TextTrackCue&amp;) final;
+    void textTrackRemoveCue(TextTrack&amp;, TextTrackCue&amp;) final;
</ins><span class="cx"> 
</span><del>-    void textTrackKindChanged(TextTrack*) final;
-    void textTrackModeChanged(TextTrack*) final;
-    void textTrackAddCues(TextTrack*, const TextTrackCueList*) final;
-    void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) final;
-    void textTrackAddCue(TextTrack*, TextTrackCue&amp;) final;
-    void textTrackRemoveCue(TextTrack*, TextTrackCue&amp;) final;
-
</del><span class="cx">     EventTargetInterface eventTargetInterface() const final { return SourceBufferEventTargetInterfaceType; }
</span><span class="cx"> 
</span><span class="cx">     bool isRemoved() const;
</span><span class="lines">@@ -157,8 +157,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool validateInitializationSegment(const InitializationSegment&amp;);
</span><span class="cx"> 
</span><del>-    void reenqueueMediaForTime(TrackBuffer&amp;, AtomicString trackID, const MediaTime&amp;);
-    void provideMediaData(TrackBuffer&amp;, AtomicString trackID);
</del><ins>+    void reenqueueMediaForTime(TrackBuffer&amp;, const AtomicString&amp; trackID, const MediaTime&amp;);
+    void provideMediaData(TrackBuffer&amp;, const AtomicString&amp; trackID);
</ins><span class="cx">     void didDropSample();
</span><span class="cx">     void evictCodedFrames(size_t newDataSize);
</span><span class="cx">     size_t maximumBufferSize() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2612,8 +2612,8 @@
</span><span class="cx">                 6E3FAE8E14733FDB00E42307 /* WebGLDepthTexture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E3FAE8C14733FDB00E42307 /* WebGLDepthTexture.cpp */; };
</span><span class="cx">                 6E3FAE8F14733FDB00E42306 /* WebGLCompressedTextureS3TC.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E3FAE8D14733FDB00E42306 /* WebGLCompressedTextureS3TC.h */; };
</span><span class="cx">                 6E3FAE8F14733FDB00E42307 /* WebGLDepthTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E3FAE8D14733FDB00E42307 /* WebGLDepthTexture.h */; };
</span><del>-                6E47E66010B7944B00B186C8 /* WebGLGetInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E47E65E10B7944B00B186C8 /* WebGLGetInfo.cpp */; };
-                6E47E66110B7944B00B186C8 /* WebGLGetInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E47E65F10B7944B00B186C8 /* WebGLGetInfo.h */; };
</del><ins>+                6E47E66010B7944B00B186C8 /* WebGLAny.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E47E65E10B7944B00B186C8 /* WebGLAny.cpp */; };
+                6E47E66110B7944B00B186C8 /* WebGLAny.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E47E65F10B7944B00B186C8 /* WebGLAny.h */; };
</ins><span class="cx">                 6E4ABCD4138EA0B70071D291 /* JSHTMLUnknownElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6E4ABCD2138EA0B70071D291 /* JSHTMLUnknownElement.cpp */; };
</span><span class="cx">                 6E4ABCD5138EA0B70071D291 /* JSHTMLUnknownElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */; };
</span><span class="cx">                 6E4E91AF10F7FB3100A2779C /* WebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6E4E91AA10F7FB3100A2779C /* WebGLContextAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -9902,8 +9902,8 @@
</span><span class="cx">                 6E3FAE8D14733FDB00E42307 /* WebGLDepthTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLDepthTexture.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6E3FAE9014733FEA00E42306 /* WebGLCompressedTextureS3TC.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLCompressedTextureS3TC.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6E3FAE9014733FEA00E42307 /* WebGLDepthTexture.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebGLDepthTexture.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                6E47E65E10B7944B00B186C8 /* WebGLGetInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLGetInfo.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                6E47E65F10B7944B00B186C8 /* WebGLGetInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLGetInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                6E47E65E10B7944B00B186C8 /* WebGLAny.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGLAny.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                6E47E65F10B7944B00B186C8 /* WebGLAny.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLAny.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 6E4ABCD2138EA0B70071D291 /* JSHTMLUnknownElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLUnknownElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6E4ABCD3138EA0B70071D291 /* JSHTMLUnknownElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLUnknownElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 6E4E91AA10F7FB3100A2779C /* WebGLContextAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLContextAttributes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16916,8 +16916,8 @@
</span><span class="cx">                                 49C7B9AE1042D32E0009D447 /* WebGLFramebuffer.cpp */,
</span><span class="cx">                                 49C7B9AF1042D32E0009D447 /* WebGLFramebuffer.h */,
</span><span class="cx">                                 49C7B9B01042D32E0009D447 /* WebGLFramebuffer.idl */,
</span><del>-                                6E47E65E10B7944B00B186C8 /* WebGLGetInfo.cpp */,
-                                6E47E65F10B7944B00B186C8 /* WebGLGetInfo.h */,
</del><ins>+                                6E47E65E10B7944B00B186C8 /* WebGLAny.cpp */,
+                                6E47E65F10B7944B00B186C8 /* WebGLAny.h */,
</ins><span class="cx">                                 93F1D5B712D532C400832BEC /* WebGLLoseContext.cpp */,
</span><span class="cx">                                 93F1D5B812D532C400832BEC /* WebGLLoseContext.h */,
</span><span class="cx">                                 93F1D5B912D532C400832BEC /* WebGLLoseContext.idl */,
</span><span class="lines">@@ -28230,7 +28230,7 @@
</span><span class="cx">                                 5B30695E18B3D3450099D5E8 /* WebGLDrawBuffers.h in Headers */,
</span><span class="cx">                                 6EBF0E5512A8929800DB1709 /* WebGLExtension.h in Headers */,
</span><span class="cx">                                 49C7B9CF1042D32F0009D447 /* WebGLFramebuffer.h in Headers */,
</span><del>-                                6E47E66110B7944B00B186C8 /* WebGLGetInfo.h in Headers */,
</del><ins>+                                6E47E66110B7944B00B186C8 /* WebGLAny.h in Headers */,
</ins><span class="cx">                                 49FFBF3F11C93EE3006A7118 /* WebGLLayer.h in Headers */,
</span><span class="cx">                                 93F1D5BB12D532C400832BEC /* WebGLLoseContext.h in Headers */,
</span><span class="cx">                                 49C7B9D51042D32F0009D447 /* WebGLObject.h in Headers */,
</span><span class="lines">@@ -31718,7 +31718,7 @@
</span><span class="cx">                                 5B30695D18B3D3450099D5E8 /* WebGLDrawBuffers.cpp in Sources */,
</span><span class="cx">                                 6EBF0E5412A8929800DB1709 /* WebGLExtension.cpp in Sources */,
</span><span class="cx">                                 49C7B9CE1042D32F0009D447 /* WebGLFramebuffer.cpp in Sources */,
</span><del>-                                6E47E66010B7944B00B186C8 /* WebGLGetInfo.cpp in Sources */,
</del><ins>+                                6E47E66010B7944B00B186C8 /* WebGLAny.cpp in Sources */,
</ins><span class="cx">                                 49FFBF4011C93EE3006A7118 /* WebGLLayer.mm in Sources */,
</span><span class="cx">                                 93F1D5BA12D532C400832BEC /* WebGLLoseContext.cpp in Sources */,
</span><span class="cx">                                 49C7B9D41042D32F0009D447 /* WebGLObject.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCanvasRenderingContext2DCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -65,9 +65,9 @@
</span><span class="cx">         return CanvasStyle();
</span><span class="cx">     JSObject* object = asObject(value);
</span><span class="cx">     if (object-&gt;inherits(JSCanvasGradient::info()))
</span><del>-        return CanvasStyle(&amp;jsCast&lt;JSCanvasGradient*&gt;(object)-&gt;wrapped());
</del><ins>+        return jsCast&lt;JSCanvasGradient*&gt;(object)-&gt;wrapped();
</ins><span class="cx">     if (object-&gt;inherits(JSCanvasPattern::info()))
</span><del>-        return CanvasStyle(&amp;jsCast&lt;JSCanvasPattern*&gt;(object)-&gt;wrapped());
</del><ins>+        return jsCast&lt;JSCanvasPattern*&gt;(object)-&gt;wrapped();
</ins><span class="cx">     return CanvasStyle();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSPluginElementFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  *  Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
</span><del>- *  Copyright (C) 2004-2008, 2016 Apple Inc. All rights reserved.
</del><ins>+ *  Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  *  This library is free software; you can redistribute it and/or
</span><span class="cx">  *  modify it under the terms of the GNU Lesser General Public
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx">     // The plugin element holds an owning reference, so we don't have to.
</span><span class="cx">     if (!is&lt;HTMLPlugInElement&gt;(element))
</span><span class="cx">         return nullptr;
</span><del>-    Instance* instance = downcast&lt;HTMLPlugInElement&gt;(element).getInstance().get();
</del><ins>+    auto* instance = downcast&lt;HTMLPlugInElement&gt;(element).bindingsInstance();
</ins><span class="cx">     if (!instance || !instance-&gt;rootObject())
</span><span class="cx">         return nullptr;
</span><span class="cx">     return instance;
</span><span class="lines">@@ -71,23 +71,23 @@
</span><span class="cx">     if (!is&lt;HTMLPlugInElement&gt;(element))
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    HTMLPlugInElement&amp; pluginElement = downcast&lt;HTMLPlugInElement&gt;(element);
</del><ins>+    auto&amp; pluginElement = downcast&lt;HTMLPlugInElement&gt;(element);
</ins><span class="cx"> 
</span><span class="cx">     // Choke point for script/plugin interaction; notify DOMTimer of the event.
</span><span class="cx">     DOMTimer::scriptDidInteractWithPlugin(pluginElement);
</span><span class="cx"> 
</span><span class="cx">     // First, see if the element has a plug-in replacement with a script.
</span><del>-    if (JSObject* scriptObject = pluginElement.scriptObjectForPluginReplacement())
</del><ins>+    if (auto* scriptObject = pluginElement.scriptObjectForPluginReplacement())
</ins><span class="cx">         return scriptObject;
</span><span class="cx">     
</span><span class="cx">     // Next, see if we can ask the plug-in view for its script object.
</span><del>-    if (JSObject* scriptObject = pluginScriptObjectFromPluginViewBase(pluginElement, jsHTMLElement-&gt;globalObject()))
</del><ins>+    if (auto* scriptObject = pluginScriptObjectFromPluginViewBase(pluginElement, jsHTMLElement-&gt;globalObject()))
</ins><span class="cx">         return scriptObject;
</span><span class="cx"> 
</span><span class="cx">     // Otherwise, fall back to getting the object from the instance.
</span><span class="cx"> 
</span><span class="cx">     // The plugin element holds an owning reference, so we don't have to.
</span><del>-    Instance* instance = pluginElement.getInstance().get();
</del><ins>+    auto* instance = pluginElement.bindingsInstance();
</ins><span class="cx">     if (!instance || !instance-&gt;rootObject())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebGL2RenderingContextCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -36,37 +36,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-// FIXME: There is a duplicate version of this function in JSWebGLRenderingContextBaseCustom.cpp,
-// but it is not exactly the same! We should merge these.
-static JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, const WebGLGetInfo&amp; info)
-{
-    switch (info.getType()) {
-    case WebGLGetInfo::kTypeBool:
-        return jsBoolean(info.getBool());
-    case WebGLGetInfo::kTypeBoolArray: {
-        MarkedArgumentBuffer list;
-        for (auto&amp; value : info.getBoolArray())
-            list.append(jsBoolean(value));
-        return constructArray(state, 0, globalObject, list);
-    }
-    case WebGLGetInfo::kTypeFloat:
-        return jsNumber(info.getFloat());
-    case WebGLGetInfo::kTypeInt:
-        return jsNumber(info.getInt());
-    case WebGLGetInfo::kTypeNull:
-        return jsNull();
-    case WebGLGetInfo::kTypeString:
-        return jsStringWithCache(state, info.getString());
-    case WebGLGetInfo::kTypeUnsignedInt:
-        return jsNumber(info.getUnsignedInt());
-    case WebGLGetInfo::kTypeInt64:
-        return jsNumber(info.getInt64());
-    default:
-        notImplemented();
-        return jsUndefined();
-    }
-}
-
</del><span class="cx"> void JSWebGL2RenderingContext::visitAdditionalChildren(SlotVisitor&amp; visitor)
</span><span class="cx"> {
</span><span class="cx">     visitor.addOpaqueRoot(&amp;wrapped());
</span><span class="lines">@@ -104,7 +73,7 @@
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">     unsigned index = state.uncheckedArgument(1).toInt32(&amp;state);
</span><span class="cx">     RETURN_IF_EXCEPTION(scope, JSValue());
</span><del>-    return toJS(&amp;state, globalObject(), wrapped().getIndexedParameter(pname, index));
</del><ins>+    return toJS(state, *globalObject(), wrapped().getIndexedParameter(pname, index));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGL2RenderingContext::getActiveUniformBlockParameter(ExecState&amp;)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebGLRenderingContextBaseCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -27,9 +27,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> 
</span><del>-#include &quot;JSWebGLRenderingContextBase.h&quot;
-
-#include &quot;ANGLEInstancedArrays.h&quot;
</del><span class="cx"> #include &quot;EXTBlendMinMax.h&quot;
</span><span class="cx"> #include &quot;EXTFragDepth.h&quot;
</span><span class="cx"> #include &quot;EXTShaderTextureLOD.h&quot;
</span><span class="lines">@@ -36,8 +33,6 @@
</span><span class="cx"> #include &quot;EXTTextureFilterAnisotropic.h&quot;
</span><span class="cx"> #include &quot;EXTsRGB.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><del>-#include &quot;HTMLCanvasElement.h&quot;
-#include &quot;HTMLImageElement.h&quot;
</del><span class="cx"> #include &quot;JSANGLEInstancedArrays.h&quot;
</span><span class="cx"> #include &quot;JSEXTBlendMinMax.h&quot;
</span><span class="cx"> #include &quot;JSEXTFragDepth.h&quot;
</span><span class="lines">@@ -73,7 +68,6 @@
</span><span class="cx"> #include &quot;JSWebGLVertexArrayObject.h&quot;
</span><span class="cx"> #include &quot;JSWebGLVertexArrayObjectOES.h&quot;
</span><span class="cx"> #include &quot;JSWebKitCSSMatrix.h&quot;
</span><del>-#include &quot;NotImplemented.h&quot;
</del><span class="cx"> #include &quot;OESElementIndexUint.h&quot;
</span><span class="cx"> #include &quot;OESStandardDerivatives.h&quot;
</span><span class="cx"> #include &quot;OESTextureFloat.h&quot;
</span><span class="lines">@@ -91,7 +85,6 @@
</span><span class="cx"> #include &quot;WebGLDrawBuffers.h&quot;
</span><span class="cx"> #include &quot;WebGLExtension.h&quot;
</span><span class="cx"> #include &quot;WebGLFramebuffer.h&quot;
</span><del>-#include &quot;WebGLGetInfo.h&quot;
</del><span class="cx"> #include &quot;WebGLLoseContext.h&quot;
</span><span class="cx"> #include &quot;WebGLProgram.h&quot;
</span><span class="cx"> #include &quot;WebGLRenderingContextBase.h&quot;
</span><span class="lines">@@ -105,7 +98,6 @@
</span><span class="cx"> #include &lt;wtf/FastMalloc.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-#include &quot;HTMLVideoElement.h&quot;
</del><span class="cx"> #include &quot;JSHTMLVideoElement.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -117,7 +109,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;WebGLRenderingContextBase&gt;&amp;&amp; object)
</del><ins>+JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;WebGLRenderingContextBase&gt;&amp;&amp; object)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(WEBGL2)
</span><span class="cx">     if (is&lt;WebGL2RenderingContext&gt;(object))
</span><span class="lines">@@ -131,65 +123,8 @@
</span><span class="cx">     return wrap(state, globalObject, object);
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-// FIXME: There is a duplicate version of this function in JSWebGL2RenderingContextCustom.cpp,
-// but it is not exactly the same! We should merge these.
-static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, const WebGLGetInfo&amp; info)
</del><ins>+static JSValue objectParameter(JSWebGLRenderingContextBase&amp; context, ExecState&amp; state, WebGLAny (WebGLRenderingContextBase::*getter)(GC3Denum target, GC3Denum pname))
</ins><span class="cx"> {
</span><del>-    switch (info.getType()) {
-    case WebGLGetInfo::kTypeBool:
-        return jsBoolean(info.getBool());
-    case WebGLGetInfo::kTypeBoolArray: {
-        MarkedArgumentBuffer list;
-        for (auto&amp; value : info.getBoolArray())
-            list.append(jsBoolean(value));
-        return constructArray(exec, 0, globalObject, list);
-    }
-    case WebGLGetInfo::kTypeFloat:
-        return jsNumber(info.getFloat());
-    case WebGLGetInfo::kTypeInt:
-        return jsNumber(info.getInt());
-    case WebGLGetInfo::kTypeNull:
-        return jsNull();
-    case WebGLGetInfo::kTypeString:
-        return jsStringWithCache(exec, info.getString());
-    case WebGLGetInfo::kTypeUnsignedInt:
-        return jsNumber(info.getUnsignedInt());
-    case WebGLGetInfo::kTypeWebGLBuffer:
-        return toJS(exec, globalObject, info.getWebGLBuffer());
-    case WebGLGetInfo::kTypeWebGLFloatArray:
-        return toJS(exec, globalObject, info.getWebGLFloatArray());
-    case WebGLGetInfo::kTypeWebGLFramebuffer:
-        return toJS(exec, globalObject, info.getWebGLFramebuffer());
-    case WebGLGetInfo::kTypeWebGLIntArray:
-        return toJS(exec, globalObject, info.getWebGLIntArray());
-        // FIXME: implement WebGLObjectArray
-        // case WebGLGetInfo::kTypeWebGLObjectArray:
-    case WebGLGetInfo::kTypeWebGLProgram:
-        return toJS(exec, globalObject, info.getWebGLProgram());
-    case WebGLGetInfo::kTypeWebGLRenderbuffer:
-        return toJS(exec, globalObject, info.getWebGLRenderbuffer());
-    case WebGLGetInfo::kTypeWebGLTexture:
-        return toJS(exec, globalObject, info.getWebGLTexture());
-    case WebGLGetInfo::kTypeWebGLUnsignedByteArray:
-        return toJS(exec, globalObject, info.getWebGLUnsignedByteArray());
-    case WebGLGetInfo::kTypeWebGLUnsignedIntArray:
-        return toJS(exec, globalObject, info.getWebGLUnsignedIntArray());
-#if ENABLE(WEBGL2)
-    case WebGLGetInfo::kTypeWebGLVertexArrayObject:
-        return toJS(exec, globalObject, info.getWebGLVertexArrayObject());
-#endif
-    case WebGLGetInfo::kTypeWebGLVertexArrayObjectOES:
-        return toJS(exec, globalObject, info.getWebGLVertexArrayObjectOES());
-    default:
-        notImplemented();
-        return jsUndefined();
-    }
-}
-
-enum ObjectType { kBuffer, kRenderbuffer, kTexture, kVertexAttrib };
-
-static JSValue getObjectParameter(JSWebGLRenderingContextBase* obj, ExecState&amp; state, ObjectType objectType)
-{
</del><span class="cx">     VM&amp; vm = state.vm();
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="lines">@@ -196,90 +131,66 @@
</span><span class="cx">     if (state.argumentCount() != 2)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    WebGLRenderingContextBase&amp; context = obj-&gt;wrapped();
-    unsigned target = state.uncheckedArgument(0).toInt32(&amp;state);
-    RETURN_IF_EXCEPTION(scope, JSValue());
-    unsigned pname = state.uncheckedArgument(1).toInt32(&amp;state);
-    RETURN_IF_EXCEPTION(scope, JSValue());
-    WebGLGetInfo info;
-    switch (objectType) {
-    case kBuffer:
-        info = context.getBufferParameter(target, pname);
-        break;
-    case kRenderbuffer:
-        info = context.getRenderbufferParameter(target, pname);
-        break;
-    case kTexture:
-        info = context.getTexParameter(target, pname);
-        break;
-    case kVertexAttrib:
-        // target =&gt; index
-        info = context.getVertexAttrib(target, pname);
-        break;
-    default:
-        notImplemented();
-        break;
-    }
-    return toJS(&amp;state, obj-&gt;globalObject(), info);
</del><ins>+    auto target = state.uncheckedArgument(0).toInt32(&amp;state);
+    RETURN_IF_EXCEPTION(scope, { });
+    auto pname = state.uncheckedArgument(1).toInt32(&amp;state);
+    RETURN_IF_EXCEPTION(scope, { });
+    return toJS(state, *context.globalObject(), (context.wrapped().*getter)(target, pname));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-enum WhichProgramCall {
-    kProgramParameter, kUniform
-};
-
-static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, WebGLExtension* extension)
</del><ins>+static JSValue toJS(ExecState&amp; state, JSDOMGlobalObject&amp; globalObject, WebGLExtension* extension)
</ins><span class="cx"> {
</span><span class="cx">     if (!extension)
</span><span class="cx">         return jsNull();
</span><span class="cx">     switch (extension-&gt;getName()) {
</span><span class="cx">     case WebGLExtension::WebGLLoseContextName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;WebGLLoseContext*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;WebGLLoseContext*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::EXTShaderTextureLODName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;EXTShaderTextureLOD*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;EXTShaderTextureLOD*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::EXTTextureFilterAnisotropicName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;EXTTextureFilterAnisotropic*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;EXTTextureFilterAnisotropic*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::EXTsRGBName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;EXTsRGB*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;EXTsRGB*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::EXTFragDepthName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;EXTFragDepth*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;EXTFragDepth*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::EXTBlendMinMaxName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;EXTBlendMinMax*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;EXTBlendMinMax*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::OESStandardDerivativesName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;OESStandardDerivatives*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;OESStandardDerivatives*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::OESTextureFloatName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;OESTextureFloat*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;OESTextureFloat*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::OESTextureFloatLinearName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;OESTextureFloatLinear*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;OESTextureFloatLinear*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::OESTextureHalfFloatName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;OESTextureHalfFloat*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;OESTextureHalfFloat*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::OESTextureHalfFloatLinearName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;OESTextureHalfFloatLinear*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;OESTextureHalfFloatLinear*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::OESVertexArrayObjectName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;OESVertexArrayObject*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;OESVertexArrayObject*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::OESElementIndexUintName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;OESElementIndexUint*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;OESElementIndexUint*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::WebGLDebugRendererInfoName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;WebGLDebugRendererInfo*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;WebGLDebugRendererInfo*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::WebGLDebugShadersName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;WebGLDebugShaders*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;WebGLDebugShaders*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::WebGLCompressedTextureATCName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;WebGLCompressedTextureATC*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;WebGLCompressedTextureATC*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::WebGLCompressedTexturePVRTCName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;WebGLCompressedTexturePVRTC*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;WebGLCompressedTexturePVRTC*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::WebGLCompressedTextureS3TCName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;WebGLCompressedTextureS3TC*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;WebGLCompressedTextureS3TC*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::WebGLDepthTextureName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;WebGLDepthTexture*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;WebGLDepthTexture*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::WebGLDrawBuffersName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;WebGLDrawBuffers*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;WebGLDrawBuffers*&gt;(extension));
</ins><span class="cx">     case WebGLExtension::ANGLEInstancedArraysName:
</span><del>-        return toJS(exec, globalObject, static_cast&lt;ANGLEInstancedArrays*&gt;(extension));
</del><ins>+        return toJS(&amp;state, &amp;globalObject, static_cast&lt;ANGLEInstancedArrays*&gt;(extension));
</ins><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return jsNull();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool JSWebGLRenderingContextBaseOwner::isReachableFromOpaqueRoots(JSC::Handle&lt;JSC::Unknown&gt; handle, void*, SlotVisitor&amp; visitor)
</del><ins>+bool JSWebGLRenderingContextBaseOwner::isReachableFromOpaqueRoots(Handle&lt;Unknown&gt; handle, void*, SlotVisitor&amp; visitor)
</ins><span class="cx"> {
</span><span class="cx">     JSWebGLRenderingContextBase* jsWebGLRenderingContext = jsCast&lt;JSWebGLRenderingContextBase*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     void* root = WebCore::root(jsWebGLRenderingContext-&gt;wrapped().canvas());
</span><span class="lines">@@ -306,9 +217,9 @@
</span><span class="cx">     Vector&lt;RefPtr&lt;WebGLShader&gt;&gt; shaders;
</span><span class="cx">     if (!context.getAttachedShaders(program, shaders))
</span><span class="cx">         return jsNull();
</span><del>-    JSC::MarkedArgumentBuffer list;
-    for (size_t ii = 0; ii &lt; shaders.size(); ++ii)
-        list.append(toJS(&amp;state, globalObject(), shaders[ii].get()));
</del><ins>+    MarkedArgumentBuffer list;
+    for (auto&amp; shader : shaders)
+        list.append(toJS(&amp;state, globalObject(), shader.get()));
</ins><span class="cx">     return constructArray(&amp;state, 0, globalObject(), list);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -320,14 +231,14 @@
</span><span class="cx">     if (state.argumentCount() &lt; 1)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    String name = state.uncheckedArgument(0).toWTFString(&amp;state);
-    RETURN_IF_EXCEPTION(scope, JSValue());
-    return toJS(&amp;state, globalObject(), wrapped().getExtension(name));
</del><ins>+    auto name = state.uncheckedArgument(0).toWTFString(&amp;state);
+    RETURN_IF_EXCEPTION(scope, { });
+    return toJS(state, *globalObject(), wrapped().getExtension(name));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getBufferParameter(ExecState&amp; state)
</span><span class="cx"> {
</span><del>-    return getObjectParameter(this, state, kBuffer);
</del><ins>+    return objectParameter(*this, state, &amp;WebGLRenderingContextBase::getBufferParameter);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getFramebufferAttachmentParameter(ExecState&amp; state)
</span><span class="lines">@@ -338,13 +249,13 @@
</span><span class="cx">     if (state.argumentCount() != 3)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    unsigned target = state.uncheckedArgument(0).toInt32(&amp;state);
-    RETURN_IF_EXCEPTION(scope, JSValue());
-    unsigned attachment = state.uncheckedArgument(1).toInt32(&amp;state);
-    RETURN_IF_EXCEPTION(scope, JSValue());
-    unsigned pname = state.uncheckedArgument(2).toInt32(&amp;state);
-    RETURN_IF_EXCEPTION(scope, JSValue());
-    return toJS(&amp;state, globalObject(), wrapped().getFramebufferAttachmentParameter(target, attachment, pname));
</del><ins>+    auto target = state.uncheckedArgument(0).toInt32(&amp;state);
+    RETURN_IF_EXCEPTION(scope, { });
+    auto attachment = state.uncheckedArgument(1).toInt32(&amp;state);
+    RETURN_IF_EXCEPTION(scope, { });
+    auto pname = state.uncheckedArgument(2).toInt32(&amp;state);
+    RETURN_IF_EXCEPTION(scope, { });
+    return toJS(state, *globalObject(), wrapped().getFramebufferAttachmentParameter(target, attachment, pname));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getParameter(ExecState&amp; state)
</span><span class="lines">@@ -355,9 +266,9 @@
</span><span class="cx">     if (state.argumentCount() != 1)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    unsigned pname = state.uncheckedArgument(0).toInt32(&amp;state);
-    RETURN_IF_EXCEPTION(scope, JSValue());
-    return toJS(&amp;state, globalObject(), wrapped().getParameter(pname));
</del><ins>+    auto pname = state.uncheckedArgument(0).toInt32(&amp;state);
+    RETURN_IF_EXCEPTION(scope, { });
+    return toJS(state, *globalObject(), wrapped().getParameter(pname));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getProgramParameter(ExecState&amp; state)
</span><span class="lines">@@ -368,17 +279,17 @@
</span><span class="cx">     if (state.argumentCount() != 2)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    WebGLProgram* program = JSWebGLProgram::toWrapped(state.uncheckedArgument(0));
</del><ins>+    auto* program = JSWebGLProgram::toWrapped(state.uncheckedArgument(0));
</ins><span class="cx">     if (!program &amp;&amp; !state.uncheckedArgument(0).isUndefinedOrNull())
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><del>-    unsigned pname = state.uncheckedArgument(1).toInt32(&amp;state);
-    RETURN_IF_EXCEPTION(scope, JSValue());
-    return toJS(&amp;state, globalObject(), wrapped().getProgramParameter(program, pname));
</del><ins>+    auto pname = state.uncheckedArgument(1).toInt32(&amp;state);
+    RETURN_IF_EXCEPTION(scope, { });
+    return toJS(state, *globalObject(), wrapped().getProgramParameter(program, pname));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getRenderbufferParameter(ExecState&amp; state)
</span><span class="cx"> {
</span><del>-    return getObjectParameter(this, state, kRenderbuffer);
</del><ins>+    return objectParameter(*this, state, &amp;WebGLRenderingContextBase::getRenderbufferParameter);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getShaderParameter(ExecState&amp; state)
</span><span class="lines">@@ -393,8 +304,8 @@
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><span class="cx">     WebGLShader* shader = JSWebGLShader::toWrapped(state.uncheckedArgument(0));
</span><span class="cx">     unsigned pname = state.uncheckedArgument(1).toInt32(&amp;state);
</span><del>-    RETURN_IF_EXCEPTION(scope, JSValue());
-    return toJS(&amp;state, globalObject(), wrapped().getShaderParameter(shader, pname));
</del><ins>+    RETURN_IF_EXCEPTION(scope, { });
+    return toJS(state, *globalObject(), wrapped().getShaderParameter(shader, pname));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getSupportedExtensions(ExecState&amp; state)
</span><span class="lines">@@ -410,7 +321,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getTexParameter(ExecState&amp; state)
</span><span class="cx"> {
</span><del>-    return getObjectParameter(this, state, kTexture);
</del><ins>+    return objectParameter(*this, state, &amp;WebGLRenderingContextBase::getTexParameter);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getUniform(ExecState&amp; state)
</span><span class="lines">@@ -427,16 +338,15 @@
</span><span class="cx">     WebGLUniformLocation* location = JSWebGLUniformLocation::toWrapped(state.uncheckedArgument(1));
</span><span class="cx">     if (!location &amp;&amp; !state.uncheckedArgument(1).isUndefinedOrNull())
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><del>-    return toJS(&amp;state, globalObject(), wrapped().getUniform(program, location));
</del><ins>+    return toJS(state, *globalObject(), wrapped().getUniform(program, location));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWebGLRenderingContextBase::getVertexAttrib(ExecState&amp; state)
</span><span class="cx"> {
</span><del>-    return getObjectParameter(this, state, kVertexAttrib);
</del><ins>+    return objectParameter(*this, state, &amp;WebGLRenderingContextBase::getVertexAttrib);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename T, size_t inlineCapacity&gt;
-bool toVector(JSC::ExecState&amp; state, JSC::JSValue value, Vector&lt;T, inlineCapacity&gt;&amp; vector)
</del><ins>+template&lt;typename VectorType&gt; bool toNumberVector(ExecState&amp; state, JSValue value, VectorType&amp; vector)
</ins><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state.vm();
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="lines">@@ -443,20 +353,20 @@
</span><span class="cx"> 
</span><span class="cx">     if (!value.isObject())
</span><span class="cx">         return false;
</span><del>-    
-    JSC::JSObject* object = asObject(value);
-    int32_t length = object-&gt;get(&amp;state, state.vm().propertyNames-&gt;length).toInt32(&amp;state);
-    
</del><ins>+
+    auto&amp; object = *asObject(value);
+    int32_t length = object.get(&amp;state, state.vm().propertyNames-&gt;length).toInt32(&amp;state);
+
</ins><span class="cx">     if (!vector.tryReserveCapacity(length))
</span><span class="cx">         return false;
</span><del>-    vector.resize(length);
-    
</del><ins>+
</ins><span class="cx">     for (int32_t i = 0; i &lt; length; ++i) {
</span><del>-        JSC::JSValue v = object-&gt;get(&amp;state, i);
</del><ins>+        auto value = object.get(&amp;state, i);
</ins><span class="cx">         RETURN_IF_EXCEPTION(scope, false);
</span><del>-        vector[i] = static_cast&lt;T&gt;(v.toNumber(&amp;state));
</del><ins>+        vector.uncheckedAppend(value.toNumber(&amp;state));
+        RETURN_IF_EXCEPTION(scope, false);
</ins><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -469,7 +379,7 @@
</span><span class="cx">     f_uniformMatrix2fv, f_uniformMatrix3fv, f_uniformMatrix4fv
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static bool functionForUniform(DataFunctionToCall f)
</del><ins>+static inline bool functionForUniform(DataFunctionToCall f)
</ins><span class="cx"> {
</span><span class="cx">     switch (f) {
</span><span class="cx">     case f_uniform1v:
</span><span class="lines">@@ -477,12 +387,12 @@
</span><span class="cx">     case f_uniform3v:
</span><span class="cx">     case f_uniform4v:
</span><span class="cx">         return true;
</span><del>-    default: break;
</del><ins>+    default:
+        return false;
</ins><span class="cx">     }
</span><del>-    return false;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSC::JSValue dataFunctionf(DataFunctionToCall f, JSC::ExecState&amp; state, WebGLRenderingContextBase&amp; context)
</del><ins>+static JSValue dataFunctionf(DataFunctionToCall f, ExecState&amp; state, WebGLRenderingContextBase&amp; context)
</ins><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state.vm();
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="lines">@@ -490,22 +400,19 @@
</span><span class="cx">     if (state.argumentCount() != 2)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     
</span><del>-    WebGLUniformLocation* location = 0;
-    long index = -1;
-    
</del><ins>+    WebGLUniformLocation* location = nullptr;
+    GLuint index = -1;
+
</ins><span class="cx">     if (functionForUniform(f)) {
</span><span class="cx">         location = JSWebGLUniformLocation::toWrapped(state.uncheckedArgument(0));
</span><span class="cx">         if (!location &amp;&amp; !state.uncheckedArgument(0).isUndefinedOrNull())
</span><span class="cx">             return throwTypeError(&amp;state, scope);
</span><del>-    } else
</del><ins>+    } else {
</ins><span class="cx">         index = state.uncheckedArgument(0).toInt32(&amp;state);
</span><del>-    
-    RETURN_IF_EXCEPTION(scope, JSValue());
-    
-    RefPtr&lt;Float32Array&gt; webGLArray = toUnsharedFloat32Array(state.uncheckedArgument(1));
-    RETURN_IF_EXCEPTION(scope, JSValue());
-    
-    if (webGLArray) {
</del><ins>+        RETURN_IF_EXCEPTION(scope, { });
+    }
+
+    if (auto webGLArray = toUnsharedFloat32Array(state.uncheckedArgument(1))) {
</ins><span class="cx">         switch (f) {
</span><span class="cx">         case f_uniform1v:
</span><span class="cx">             context.uniform1fv(location, *webGLArray);
</span><span class="lines">@@ -532,14 +439,13 @@
</span><span class="cx">             context.vertexAttrib4fv(index, *webGLArray);
</span><span class="cx">             break;
</span><span class="cx">         }
</span><del>-        
</del><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx">     Vector&lt;float, 64&gt; array;
</span><del>-    if (!toVector(state, state.uncheckedArgument(1), array))
</del><ins>+    if (!toNumberVector(state, state.uncheckedArgument(1), array))
</ins><span class="cx">         return throwTypeError(&amp;state, scope);
</span><del>-    
</del><ins>+
</ins><span class="cx">     switch (f) {
</span><span class="cx">     case f_uniform1v:
</span><span class="cx">         context.uniform1fv(location, array.data(), array.size());
</span><span class="lines">@@ -566,11 +472,10 @@
</span><span class="cx">         context.vertexAttrib4fv(index, array.data(), array.size());
</span><span class="cx">         break;
</span><span class="cx">     }
</span><del>-    
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSC::JSValue dataFunctioni(DataFunctionToCall f, JSC::ExecState&amp; state, WebGLRenderingContextBase&amp; context)
</del><ins>+static JSValue dataFunctioni(DataFunctionToCall f, ExecState&amp; state, WebGLRenderingContextBase&amp; context)
</ins><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state.vm();
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="lines">@@ -577,14 +482,12 @@
</span><span class="cx"> 
</span><span class="cx">     if (state.argumentCount() != 2)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><del>-    
-    WebGLUniformLocation* location = JSWebGLUniformLocation::toWrapped(state.uncheckedArgument(0));
</del><ins>+
+    auto* location = JSWebGLUniformLocation::toWrapped(state.uncheckedArgument(0));
</ins><span class="cx">     if (!location &amp;&amp; !state.uncheckedArgument(0).isUndefinedOrNull())
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><del>-    
-    RefPtr&lt;Int32Array&gt; webGLArray = toUnsharedInt32Array(state.uncheckedArgument(1));
-    
-    if (webGLArray) {
</del><ins>+
+    if (auto webGLArray = toUnsharedInt32Array(state.uncheckedArgument(1))) {
</ins><span class="cx">         switch (f) {
</span><span class="cx">         case f_uniform1v:
</span><span class="cx">             context.uniform1iv(location, *webGLArray);
</span><span class="lines">@@ -601,15 +504,13 @@
</span><span class="cx">         default:
</span><span class="cx">             break;
</span><span class="cx">         }
</span><del>-        
</del><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><del>-    
-    
</del><ins>+
</ins><span class="cx">     Vector&lt;int, 64&gt; array;
</span><del>-    if (!toVector(state, state.uncheckedArgument(1), array))
</del><ins>+    if (!toNumberVector(state, state.uncheckedArgument(1), array))
</ins><span class="cx">         return throwTypeError(&amp;state, scope);
</span><del>-    
</del><ins>+
</ins><span class="cx">     switch (f) {
</span><span class="cx">     case f_uniform1v:
</span><span class="cx">         context.uniform1iv(location, array.data(), array.size());
</span><span class="lines">@@ -626,11 +527,10 @@
</span><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="cx">     }
</span><del>-    
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static JSC::JSValue dataFunctionMatrix(DataFunctionMatrixToCall f, JSC::ExecState&amp; state, WebGLRenderingContextBase&amp; context)
</del><ins>+static JSValue dataFunctionMatrix(DataFunctionMatrixToCall f, ExecState&amp; state, WebGLRenderingContextBase&amp; context)
</ins><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state.vm();
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="lines">@@ -637,17 +537,15 @@
</span><span class="cx"> 
</span><span class="cx">     if (state.argumentCount() != 3)
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><del>-    
-    WebGLUniformLocation* location = JSWebGLUniformLocation::toWrapped(state.uncheckedArgument(0));
</del><ins>+
+    auto* location = JSWebGLUniformLocation::toWrapped(state.uncheckedArgument(0));
</ins><span class="cx">     if (!location &amp;&amp; !state.uncheckedArgument(0).isUndefinedOrNull())
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><del>-    
</del><ins>+
</ins><span class="cx">     bool transpose = state.uncheckedArgument(1).toBoolean(&amp;state);
</span><del>-    RETURN_IF_EXCEPTION(scope, JSValue());
-    
-    RefPtr&lt;Float32Array&gt; webGLArray = toUnsharedFloat32Array(state.uncheckedArgument(2));
</del><ins>+    RETURN_IF_EXCEPTION(scope, { });
</ins><span class="cx"> 
</span><del>-    if (webGLArray) {
</del><ins>+    if (auto webGLArray = toUnsharedFloat32Array(state.uncheckedArgument(2))) {
</ins><span class="cx">         switch (f) {
</span><span class="cx">         case f_uniformMatrix2fv:
</span><span class="cx">             context.uniformMatrix2fv(location, transpose, *webGLArray);
</span><span class="lines">@@ -659,14 +557,13 @@
</span><span class="cx">             context.uniformMatrix4fv(location, transpose, *webGLArray);
</span><span class="cx">             break;
</span><span class="cx">         }
</span><del>-
</del><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx">     Vector&lt;float, 64&gt; array;
</span><del>-    if (!toVector(state, state.uncheckedArgument(2), array))
</del><ins>+    if (!toNumberVector(state, state.uncheckedArgument(2), array))
</ins><span class="cx">         return throwTypeError(&amp;state, scope);
</span><del>-    
</del><ins>+
</ins><span class="cx">     switch (f) {
</span><span class="cx">     case f_uniformMatrix2fv:
</span><span class="cx">         context.uniformMatrix2fv(location, transpose, array.data(), array.size());
</span><span class="lines">@@ -678,81 +575,80 @@
</span><span class="cx">         context.uniformMatrix4fv(location, transpose, array.data(), array.size());
</span><span class="cx">         break;
</span><span class="cx">     }
</span><del>-
</del><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::uniform1fv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::uniform1fv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctionf(f_uniform1v, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::uniform1iv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::uniform1iv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctioni(f_uniform1v, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::uniform2fv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::uniform2fv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctionf(f_uniform2v, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::uniform2iv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::uniform2iv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctioni(f_uniform2v, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::uniform3fv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::uniform3fv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctionf(f_uniform3v, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::uniform3iv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::uniform3iv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctioni(f_uniform3v, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::uniform4fv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::uniform4fv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctionf(f_uniform4v, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::uniform4iv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::uniform4iv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctioni(f_uniform4v, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::uniformMatrix2fv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::uniformMatrix2fv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctionMatrix(f_uniformMatrix2fv, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::uniformMatrix3fv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::uniformMatrix3fv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctionMatrix(f_uniformMatrix3fv, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::uniformMatrix4fv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::uniformMatrix4fv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctionMatrix(f_uniformMatrix4fv, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::vertexAttrib1fv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::vertexAttrib1fv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctionf(f_vertexAttrib1v, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::vertexAttrib2fv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::vertexAttrib2fv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctionf(f_vertexAttrib2v, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::vertexAttrib3fv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::vertexAttrib3fv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctionf(f_vertexAttrib3v, state, wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue JSWebGLRenderingContextBase::vertexAttrib4fv(JSC::ExecState&amp; state)
</del><ins>+JSValue JSWebGLRenderingContextBase::vertexAttrib4fv(ExecState&amp; state)
</ins><span class="cx"> {
</span><span class="cx">     return dataFunctionf(f_vertexAttrib4v, state, wrapped());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptModuleLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScriptModuleLoader.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptModuleLoader.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/bindings/js/ScriptModuleLoader.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -135,6 +135,10 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSInternalPromise* ScriptModuleLoader::fetch(JSC::JSGlobalObject* jsGlobalObject, JSC::ExecState* exec, JSC::JSModuleLoader*, JSC::JSValue moduleKeyValue, JSC::JSValue initiator)
</span><span class="cx"> {
</span><ins>+    // FIXME: What guarantees these are true? Why don't we need to check?
+    ASSERT(JSC::jsDynamicCast&lt;JSElement*&gt;(initiator));
+    ASSERT(isScriptElement(JSC::jsDynamicCast&lt;JSElement*&gt;(initiator)-&gt;wrapped()));
+
</ins><span class="cx">     auto&amp; globalObject = *JSC::jsCast&lt;JSDOMGlobalObject*&gt;(jsGlobalObject);
</span><span class="cx">     auto&amp; jsPromise = *JSC::JSInternalPromiseDeferred::create(exec, &amp;globalObject);
</span><span class="cx">     auto deferred = DeferredPromise::create(globalObject, jsPromise);
</span><span class="lines">@@ -156,17 +160,12 @@
</span><span class="cx">         return jsPromise.promise();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ASSERT_WITH_MESSAGE(JSC::jsDynamicCast&lt;JSElement*&gt;(initiator), &quot;Initiator should be an JSElement&quot;);
-    auto* scriptElement = toScriptElementIfPossible(&amp;JSC::jsCast&lt;JSElement*&gt;(initiator)-&gt;wrapped());
-    ASSERT_WITH_MESSAGE(scriptElement, &quot;Initiator should be ScriptElement.&quot;);
-
</del><span class="cx">     if (auto* frame = m_document.frame()) {
</span><span class="cx">         auto loader = CachedModuleScriptLoader::create(*this, deferred.get());
</span><span class="cx">         m_loaders.add(loader.copyRef());
</span><del>-        if (!loader-&gt;load(*scriptElement, completedURL)) {
</del><ins>+        if (!loader-&gt;load(downcastScriptElement(JSC::jsCast&lt;JSElement*&gt;(initiator)-&gt;wrapped()), completedURL)) {
</ins><span class="cx">             loader-&gt;clearClient();
</span><span class="cx">             m_loaders.remove(WTFMove(loader));
</span><del>-
</del><span class="cx">             deferred-&gt;reject(frame-&gt;script().moduleLoaderAlreadyReportedErrorSymbol());
</span><span class="cx">             return jsPromise.promise();
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/dom/Document.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@webkit.org)
</span><del>- * Copyright (C) 2004-2010, 2012-2013, 2015, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><span class="lines">@@ -66,9 +66,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> class ExecState;
</span><del>-#if ENABLE(WEB_REPLAY)
</del><span class="cx"> class InputCursor;
</span><del>-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -99,8 +97,8 @@
</span><span class="cx"> class DocumentSharedObjectPool;
</span><span class="cx"> class DocumentType;
</span><span class="cx"> class ExtensionStyleSheets;
</span><ins>+class FloatQuad;
</ins><span class="cx"> class FloatRect;
</span><del>-class FloatQuad;
</del><span class="cx"> class FormController;
</span><span class="cx"> class Frame;
</span><span class="cx"> class FrameView;
</span><span class="lines">@@ -121,11 +119,10 @@
</span><span class="cx"> class HitTestRequest;
</span><span class="cx"> class HitTestResult;
</span><span class="cx"> class IntPoint;
</span><ins>+class JSNode;
</ins><span class="cx"> class LayoutPoint;
</span><span class="cx"> class LayoutRect;
</span><span class="cx"> class LiveNodeList;
</span><del>-class ScriptModuleLoader;
-class JSNode;
</del><span class="cx"> class Locale;
</span><span class="cx"> class Location;
</span><span class="cx"> class MediaCanStartListener;
</span><span class="lines">@@ -133,7 +130,6 @@
</span><span class="cx"> class MediaPlaybackTargetClient;
</span><span class="cx"> class MediaQueryList;
</span><span class="cx"> class MediaQueryMatcher;
</span><del>-class ScriptModuleLoader;
</del><span class="cx"> class MouseEventWithHitTestResults;
</span><span class="cx"> class NamedFlowCollection;
</span><span class="cx"> class NodeFilter;
</span><span class="lines">@@ -143,23 +139,24 @@
</span><span class="cx"> class ProcessingInstruction;
</span><span class="cx"> class QualifiedName;
</span><span class="cx"> class Range;
</span><ins>+class RenderFullScreen;
</ins><span class="cx"> class RenderView;
</span><del>-class RenderFullScreen;
-class ScriptableDocumentParser;
</del><ins>+class SVGDocumentExtensions;
+class SVGSVGElement;
</ins><span class="cx"> class ScriptElementData;
</span><ins>+class ScriptModuleLoader;
</ins><span class="cx"> class ScriptRunner;
</span><ins>+class ScriptableDocumentParser;
</ins><span class="cx"> class SecurityOrigin;
</span><ins>+class SegmentedString;
</ins><span class="cx"> class SelectorQuery;
</span><span class="cx"> class SelectorQueryCache;
</span><span class="cx"> class SerializedScriptValue;
</span><del>-class SegmentedString;
</del><span class="cx"> class Settings;
</span><span class="cx"> class StyleResolver;
</span><span class="cx"> class StyleSheet;
</span><span class="cx"> class StyleSheetContents;
</span><span class="cx"> class StyleSheetList;
</span><del>-class SVGDocumentExtensions;
-class SVGSVGElement;
</del><span class="cx"> class Text;
</span><span class="cx"> class TextResourceDecoder;
</span><span class="cx"> class TreeWalker;
</span></span></pre></div>
<a id="trunkSourceWebCoredomPendingScriptcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PendingScript.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PendingScript.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/dom/PendingScript.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google, Inc. All Rights Reserved.
</span><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,30 +27,30 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;PendingScript.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;Element.h&quot;
</del><span class="cx"> #include &quot;PendingScriptClient.h&quot;
</span><ins>+#include &quot;ScriptElement.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-Ref&lt;PendingScript&gt; PendingScript::create(Element&amp; element, LoadableScript&amp; loadableScript)
</del><ins>+Ref&lt;PendingScript&gt; PendingScript::create(ScriptElement&amp; element, LoadableScript&amp; loadableScript)
</ins><span class="cx"> {
</span><del>-    Ref&lt;PendingScript&gt; pendingScript = adoptRef(*new PendingScript(element, loadableScript));
</del><ins>+    auto pendingScript = adoptRef(*new PendingScript(element, loadableScript));
</ins><span class="cx">     loadableScript.addClient(pendingScript.get());
</span><span class="cx">     return pendingScript;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;PendingScript&gt; PendingScript::create(Element&amp; element, TextPosition scriptStartPosition)
</del><ins>+Ref&lt;PendingScript&gt; PendingScript::create(ScriptElement&amp; element, TextPosition scriptStartPosition)
</ins><span class="cx"> {
</span><span class="cx">     return adoptRef(*new PendingScript(element, scriptStartPosition));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PendingScript::PendingScript(Element&amp; element, TextPosition startingPosition)
</del><ins>+PendingScript::PendingScript(ScriptElement&amp; element, TextPosition startingPosition)
</ins><span class="cx">     : m_element(element)
</span><span class="cx">     , m_startingPosition(startingPosition)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PendingScript::PendingScript(Element&amp; element, LoadableScript&amp; loadableScript)
</del><ins>+PendingScript::PendingScript(ScriptElement&amp; element, LoadableScript&amp; loadableScript)
</ins><span class="cx">     : m_element(element)
</span><span class="cx">     , m_loadableScript(&amp;loadableScript)
</span><span class="cx"> {
</span><span class="lines">@@ -61,11 +62,6 @@
</span><span class="cx">         m_loadableScript-&gt;removeClient(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LoadableScript* PendingScript::loadableScript() const
-{
-    return m_loadableScript.get();
-}
-
</del><span class="cx"> void PendingScript::notifyClientFinished()
</span><span class="cx"> {
</span><span class="cx">     Ref&lt;PendingScript&gt; protectedThis(*this);
</span><span class="lines">@@ -88,10 +84,10 @@
</span><span class="cx">     return m_loadableScript &amp;&amp; m_loadableScript-&gt;error();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PendingScript::setClient(PendingScriptClient* client)
</del><ins>+void PendingScript::setClient(PendingScriptClient&amp; client)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!m_client);
</span><del>-    m_client = client;
</del><ins>+    m_client = &amp;client;
</ins><span class="cx">     if (isLoaded())
</span><span class="cx">         notifyClientFinished();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomPendingScripth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PendingScript.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PendingScript.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/dom/PendingScript.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -34,15 +34,15 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CachedScript;
</span><del>-class Element;
</del><span class="cx"> class PendingScriptClient;
</span><ins>+class ScriptElement;
</ins><span class="cx"> 
</span><span class="cx"> // A container for scripts which may be loaded and executed.
</span><span class="cx"> // This can hold LoadableScript and non external inline script.
</span><span class="cx"> class PendingScript final : public RefCounted&lt;PendingScript&gt;, public LoadableScriptClient {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;PendingScript&gt; create(Element&amp;, LoadableScript&amp;);
-    static Ref&lt;PendingScript&gt; create(Element&amp;, TextPosition scriptStartPosition);
</del><ins>+    static Ref&lt;PendingScript&gt; create(ScriptElement&amp;, LoadableScript&amp;);
+    static Ref&lt;PendingScript&gt; create(ScriptElement&amp;, TextPosition scriptStartPosition);
</ins><span class="cx"> 
</span><span class="cx">     virtual ~PendingScript();
</span><span class="cx"> 
</span><span class="lines">@@ -51,8 +51,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool watchingForLoad() const { return needsLoading() &amp;&amp; m_client; }
</span><span class="cx"> 
</span><del>-    Element&amp; element() { return m_element.get(); }
-    const Element&amp; element() const { return m_element.get(); }
</del><ins>+    ScriptElement&amp; element() { return m_element.get(); }
+    const ScriptElement&amp; element() const { return m_element.get(); }
</ins><span class="cx"> 
</span><span class="cx">     LoadableScript* loadableScript() const;
</span><span class="cx">     bool needsLoading() const { return loadableScript(); }
</span><span class="lines">@@ -62,19 +62,24 @@
</span><span class="cx"> 
</span><span class="cx">     void notifyFinished(LoadableScript&amp;) override;
</span><span class="cx"> 
</span><del>-    void setClient(PendingScriptClient*);
</del><ins>+    void setClient(PendingScriptClient&amp;);
</ins><span class="cx">     void clearClient();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    PendingScript(Element&amp;, LoadableScript&amp;);
-    PendingScript(Element&amp;, TextPosition startingPosition);
</del><ins>+    PendingScript(ScriptElement&amp;, LoadableScript&amp;);
+    PendingScript(ScriptElement&amp;, TextPosition startingPosition);
</ins><span class="cx"> 
</span><span class="cx">     void notifyClientFinished();
</span><span class="cx"> 
</span><del>-    Ref&lt;Element&gt; m_element;
</del><ins>+    Ref&lt;ScriptElement&gt; m_element;
</ins><span class="cx">     TextPosition m_startingPosition; // Only used for inline script tags.
</span><span class="cx">     RefPtr&lt;LoadableScript&gt; m_loadableScript;
</span><span class="cx">     PendingScriptClient* m_client { nullptr };
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline LoadableScript* PendingScript::loadableScript() const
+{
+    return m_loadableScript.get();
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoredomScriptElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/dom/ScriptElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2003-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 Nikolas Zimmermann &lt;zimmermann@kde.org&gt;
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -263,11 +263,11 @@
</span><span class="cx">     } else if ((isClassicExternalScript || scriptType == ScriptType::Module) &amp;&amp; !asyncAttributeValue() &amp;&amp; !m_forceAsync) {
</span><span class="cx">         m_willExecuteInOrder = true;
</span><span class="cx">         ASSERT(m_loadableScript);
</span><del>-        document.scriptRunner()-&gt;queueScriptForExecution(this, *m_loadableScript, ScriptRunner::IN_ORDER_EXECUTION);
</del><ins>+        document.scriptRunner()-&gt;queueScriptForExecution(*this, *m_loadableScript, ScriptRunner::IN_ORDER_EXECUTION);
</ins><span class="cx">     } else if (hasSourceAttribute() || scriptType == ScriptType::Module) {
</span><span class="cx">         ASSERT(m_loadableScript);
</span><span class="cx">         ASSERT(asyncAttributeValue() || m_forceAsync);
</span><del>-        document.scriptRunner()-&gt;queueScriptForExecution(this, *m_loadableScript, ScriptRunner::ASYNC_EXECUTION);
</del><ins>+        document.scriptRunner()-&gt;queueScriptForExecution(*this, *m_loadableScript, ScriptRunner::ASYNC_EXECUTION);
</ins><span class="cx">     } else if (!hasSourceAttribute() &amp;&amp; m_parserInserted &amp;&amp; !document.haveStylesheetsLoaded()) {
</span><span class="cx">         ASSERT(scriptType == ScriptType::Classic);
</span><span class="cx">         m_willBeParserExecuted = true;
</span><span class="lines">@@ -487,15 +487,26 @@
</span><span class="cx">     return result.toString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ScriptElement* toScriptElementIfPossible(Element* element)
</del><ins>+void ScriptElement::ref()
</ins><span class="cx"> {
</span><del>-    if (is&lt;HTMLScriptElement&gt;(*element))
-        return downcast&lt;HTMLScriptElement&gt;(element);
</del><ins>+    m_element.ref();
+}
</ins><span class="cx"> 
</span><del>-    if (is&lt;SVGScriptElement&gt;(*element))
-        return downcast&lt;SVGScriptElement&gt;(element);
</del><ins>+void ScriptElement::deref()
+{
+    m_element.deref();
+}
</ins><span class="cx"> 
</span><del>-    return nullptr;
</del><ins>+bool isScriptElement(Element&amp; element)
+{
+    return is&lt;HTMLScriptElement&gt;(element) || is&lt;SVGScriptElement&gt;(element);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ScriptElement&amp; downcastScriptElement(Element&amp; element)
+{
+    if (is&lt;HTMLScriptElement&gt;(element))
+        return downcast&lt;HTMLScriptElement&gt;(element);
+    return downcast&lt;SVGScriptElement&gt;(element);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoredomScriptElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/dom/ScriptElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2008 Nikolas Zimmermann &lt;zimmermann@kde.org&gt;
</span><ins>+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -25,19 +26,17 @@
</span><span class="cx"> #include &quot;LoadableScript.h&quot;
</span><span class="cx"> #include &quot;LoadableScriptClient.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><del>-#include &quot;URL.h&quot;
</del><span class="cx"> #include &lt;wtf/text/TextPosition.h&gt;
</span><del>-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class CachedModuleScript;
</ins><span class="cx"> class CachedScript;
</span><span class="cx"> class ContainerNode;
</span><span class="cx"> class Element;
</span><span class="cx"> class PendingScript;
</span><del>-class ScriptElement;
</del><span class="cx"> class ScriptSourceCode;
</span><del>-class CachedModuleScript;
</del><ins>+class URL;
</ins><span class="cx"> 
</span><span class="cx"> class ScriptElement {
</span><span class="cx"> public:
</span><span class="lines">@@ -73,6 +72,9 @@
</span><span class="cx">     enum class ScriptType { Classic, Module };
</span><span class="cx">     ScriptType scriptType() const { return m_isModuleScript ? ScriptType::Module : ScriptType::Classic; }
</span><span class="cx"> 
</span><ins>+    void ref();
+    void deref();
+
</ins><span class="cx"> protected:
</span><span class="cx">     ScriptElement(Element&amp;, bool createdByParser, bool isEvaluated);
</span><span class="cx"> 
</span><span class="lines">@@ -127,7 +129,8 @@
</span><span class="cx">     RefPtr&lt;LoadableScript&gt; m_loadableScript;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-// FIXME: replace with downcast&lt;ScriptElement&gt;.
-ScriptElement* toScriptElementIfPossible(Element*);
</del><ins>+// FIXME: replace with is/downcast&lt;ScriptElement&gt;.
+bool isScriptElement(Element&amp;);
+ScriptElement&amp; downcastScriptElement(Element&amp;);
</ins><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptRunner.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptRunner.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/dom/ScriptRunner.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google, Inc. All Rights Reserved.
</span><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -56,26 +57,22 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScriptRunner::queueScriptForExecution(ScriptElement* scriptElement, LoadableScript&amp; loadableScript, ExecutionType executionType)
</del><ins>+void ScriptRunner::queueScriptForExecution(ScriptElement&amp; scriptElement, LoadableScript&amp; loadableScript, ExecutionType executionType)
</ins><span class="cx"> {
</span><del>-    ASSERT(scriptElement);
</del><ins>+    ASSERT(scriptElement.element().inDocument());
</ins><span class="cx"> 
</span><del>-    Element&amp; element = scriptElement-&gt;element();
-    ASSERT(element.inDocument());
-
</del><span class="cx">     m_document.incrementLoadEventDelayCount();
</span><span class="cx"> 
</span><del>-    Ref&lt;PendingScript&gt; pendingScript = PendingScript::create(element, loadableScript);
</del><ins>+    auto pendingScript = PendingScript::create(scriptElement, loadableScript);
</ins><span class="cx">     switch (executionType) {
</span><span class="cx">     case ASYNC_EXECUTION:
</span><span class="cx">         m_pendingAsyncScripts.add(pendingScript.copyRef());
</span><span class="cx">         break;
</span><del>-
</del><span class="cx">     case IN_ORDER_EXECUTION:
</span><span class="cx">         m_scriptsToExecuteInOrder.append(pendingScript.copyRef());
</span><span class="cx">         break;
</span><span class="cx">     }
</span><del>-    pendingScript-&gt;setClient(this);
</del><ins>+    pendingScript-&gt;setClient(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScriptRunner::suspend()
</span><span class="lines">@@ -91,9 +88,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ScriptRunner::notifyFinished(PendingScript&amp; pendingScript)
</span><span class="cx"> {
</span><del>-    auto* scriptElement = toScriptElementIfPossible(&amp;pendingScript.element());
-    ASSERT(scriptElement);
-    if (scriptElement-&gt;willExecuteInOrder())
</del><ins>+    if (pendingScript.element().willExecuteInOrder())
</ins><span class="cx">         ASSERT(!m_scriptsToExecuteInOrder.isEmpty());
</span><span class="cx">     else {
</span><span class="cx">         ASSERT(m_pendingAsyncScripts.contains(pendingScript));
</span><span class="lines">@@ -122,10 +117,8 @@
</span><span class="cx">         // Paper over https://bugs.webkit.org/show_bug.cgi?id=144050
</span><span class="cx">         if (!script)
</span><span class="cx">             continue;
</span><del>-        auto* scriptElement = toScriptElementIfPossible(&amp;script-&gt;element());
-        ASSERT(scriptElement);
</del><span class="cx">         ASSERT(script-&gt;needsLoading());
</span><del>-        scriptElement-&gt;executePendingScript(*script);
</del><ins>+        script-&gt;element().executePendingScript(*script);
</ins><span class="cx">         m_document.decrementLoadEventDelayCount();
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptRunner.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptRunner.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/dom/ScriptRunner.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google, Inc. All Rights Reserved.
</span><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,13 +29,11 @@
</span><span class="cx"> #include &quot;PendingScriptClient.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><del>-#include &lt;wtf/Noncopyable.h&gt;
</del><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Document;
</span><del>-class PendingScript;
</del><span class="cx"> class ScriptElement;
</span><span class="cx"> class LoadableScript;
</span><span class="cx"> 
</span><span class="lines">@@ -45,7 +44,7 @@
</span><span class="cx">     ~ScriptRunner();
</span><span class="cx"> 
</span><span class="cx">     enum ExecutionType { ASYNC_EXECUTION, IN_ORDER_EXECUTION };
</span><del>-    void queueScriptForExecution(ScriptElement*, LoadableScript&amp;, ExecutionType);
</del><ins>+    void queueScriptForExecution(ScriptElement&amp;, LoadableScript&amp;, ExecutionType);
</ins><span class="cx">     bool hasPendingScripts() const { return !m_scriptsToExecuteSoon.isEmpty() || !m_scriptsToExecuteInOrder.isEmpty() || !m_pendingAsyncScripts.isEmpty(); }
</span><span class="cx">     void suspend();
</span><span class="cx">     void resume();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlFileInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/FileInputType.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/FileInputType.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/FileInputType.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -221,7 +221,7 @@
</span><span class="cx"> 
</span><span class="cx"> FileList* FileInputType::files()
</span><span class="cx"> {
</span><del>-    return m_fileList.get();
</del><ins>+    return m_fileList.ptr();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool FileInputType::canSetValue(const String&amp; value)
</span><span class="lines">@@ -258,12 +258,12 @@
</span><span class="cx">     element().invalidateStyleForSubtree();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;FileList&gt; FileInputType::createFileList(const Vector&lt;FileChooserFileInfo&gt;&amp; files) const
</del><ins>+Ref&lt;FileList&gt; FileInputType::createFileList(const Vector&lt;FileChooserFileInfo&gt;&amp; files)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;RefPtr&lt;File&gt;&gt; fileObjects;
</span><del>-    for (const FileChooserFileInfo&amp; info : files)
-        fileObjects.append(File::createWithName(info.path, info.displayName));
-
</del><ins>+    fileObjects.reserveInitialCapacity(files.size());
+    for (auto&amp; info : files)
+        fileObjects.uncheckedAppend(File::createWithName(info.path, info.displayName));
</ins><span class="cx">     return FileList::create(WTFMove(fileObjects));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -302,29 +302,32 @@
</span><span class="cx">         button-&gt;setValue(element().multiple() ? fileButtonChooseMultipleFilesLabel() : fileButtonChooseFileLabel());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> void FileInputType::requestIcon(const Vector&lt;String&gt;&amp; paths)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
-    UNUSED_PARAM(paths);
-#else
</del><span class="cx">     if (!paths.size()) {
</span><del>-        updateRendering(nullptr);
</del><ins>+        iconLoaded(nullptr);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Chrome* chrome = this-&gt;chrome();
-    if (!chrome)
</del><ins>+    auto* chrome = this-&gt;chrome();
+    if (!chrome) {
+        iconLoaded(nullptr);
</ins><span class="cx">         return;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     if (m_fileIconLoader)
</span><span class="cx">         m_fileIconLoader-&gt;invalidate();
</span><span class="cx"> 
</span><del>-    m_fileIconLoader = std::make_unique&lt;FileIconLoader&gt;(static_cast&lt;FileIconLoaderClient&amp;&gt;(*this));
</del><ins>+    FileIconLoaderClient&amp; client = *this;
+    m_fileIconLoader = std::make_unique&lt;FileIconLoader&gt;(client);
</ins><span class="cx"> 
</span><del>-    chrome-&gt;loadIconForFiles(paths, m_fileIconLoader.get());
-#endif
</del><ins>+    chrome-&gt;loadIconForFiles(paths, *m_fileIconLoader);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#endif
+
</ins><span class="cx"> void FileInputType::applyFileChooserSettings(const FileChooserSettings&amp; settings)
</span><span class="cx"> {
</span><span class="cx">     if (m_fileChooser)
</span><span class="lines">@@ -333,7 +336,7 @@
</span><span class="cx">     m_fileChooser = FileChooser::create(this, settings);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FileInputType::setFiles(PassRefPtr&lt;FileList&gt; files)
</del><ins>+void FileInputType::setFiles(RefPtr&lt;FileList&gt;&amp;&amp; files)
</ins><span class="cx"> {
</span><span class="cx">     if (!files)
</span><span class="cx">         return;
</span><span class="lines">@@ -340,11 +343,13 @@
</span><span class="cx"> 
</span><span class="cx">     Ref&lt;HTMLInputElement&gt; input(element());
</span><span class="cx"> 
</span><ins>+    unsigned length = files-&gt;length();
+
</ins><span class="cx">     bool pathsChanged = false;
</span><del>-    if (files-&gt;length() != m_fileList-&gt;length())
</del><ins>+    if (length != m_fileList-&gt;length())
</ins><span class="cx">         pathsChanged = true;
</span><span class="cx">     else {
</span><del>-        for (unsigned i = 0; i &lt; files-&gt;length(); ++i) {
</del><ins>+        for (unsigned i = 0; i &lt; length; ++i) {
</ins><span class="cx">             if (files-&gt;item(i)-&gt;path() != m_fileList-&gt;item(i)-&gt;path()) {
</span><span class="cx">                 pathsChanged = true;
</span><span class="cx">                 break;
</span><span class="lines">@@ -352,15 +357,18 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_fileList = files;
</del><ins>+    m_fileList = files.releaseNonNull();
</ins><span class="cx"> 
</span><span class="cx">     input-&gt;setFormControlValueMatchesRenderer(true);
</span><span class="cx">     input-&gt;updateValidity();
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     Vector&lt;String&gt; paths;
</span><del>-    for (unsigned i = 0; i &lt; m_fileList-&gt;length(); ++i)
-        paths.append(m_fileList-&gt;item(i)-&gt;path());
</del><ins>+    paths.reserveInitialCapacity(length);
+    for (unsigned i = 0; i &lt; length; ++i)
+        paths.uncheckedAppend(m_fileList-&gt;item(i)-&gt;path());
</ins><span class="cx">     requestIcon(paths);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (input-&gt;renderer())
</span><span class="cx">         input-&gt;renderer()-&gt;repaint();
</span><span class="lines">@@ -374,11 +382,12 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+
</ins><span class="cx"> void FileInputType::filesChosen(const Vector&lt;FileChooserFileInfo&gt;&amp; paths, const String&amp; displayString, Icon* icon)
</span><span class="cx"> {
</span><span class="cx">     m_displayString = displayString;
</span><span class="cx">     filesChosen(paths);
</span><del>-    updateRendering(icon);
</del><ins>+    iconLoaded(icon);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String FileInputType::displayString() const
</span><span class="lines">@@ -385,6 +394,7 @@
</span><span class="cx"> {
</span><span class="cx">     return m_displayString;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void FileInputType::filesChosen(const Vector&lt;FileChooserFileInfo&gt;&amp; files)
</span><span class="lines">@@ -392,12 +402,12 @@
</span><span class="cx">     setFiles(createFileList(files));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FileInputType::updateRendering(PassRefPtr&lt;Icon&gt; icon)
</del><ins>+void FileInputType::iconLoaded(RefPtr&lt;Icon&gt;&amp;&amp; icon)
</ins><span class="cx"> {
</span><span class="cx">     if (m_icon == icon)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_icon = icon;
</del><ins>+    m_icon = WTFMove(icon);
</ins><span class="cx">     if (element().renderer())
</span><span class="cx">         element().renderer()-&gt;repaint();
</span><span class="cx"> }
</span><span class="lines">@@ -434,8 +444,7 @@
</span><span class="cx"> 
</span><span class="cx"> String FileInputType::defaultToolTip() const
</span><span class="cx"> {
</span><del>-    FileList* fileList = m_fileList.get();
-    unsigned listSize = fileList-&gt;length();
</del><ins>+    unsigned listSize = m_fileList-&gt;length();
</ins><span class="cx">     if (!listSize) {
</span><span class="cx">         if (element().multiple())
</span><span class="cx">             return fileButtonNoFilesSelectedLabel();
</span><span class="lines">@@ -443,8 +452,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     StringBuilder names;
</span><del>-    for (size_t i = 0; i &lt; listSize; ++i) {
-        names.append(fileList-&gt;item(i)-&gt;name());
</del><ins>+    for (unsigned i = 0; i &lt; listSize; ++i) {
+        names.append(m_fileList-&gt;item(i)-&gt;name());
</ins><span class="cx">         if (i != listSize - 1)
</span><span class="cx">             names.append('\n');
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlFileInputTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/FileInputType.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/FileInputType.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/FileInputType.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -50,45 +50,45 @@
</span><span class="cx">     static Vector&lt;FileChooserFileInfo&gt; filesFromFormControlState(const FormControlState&amp;);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    const AtomicString&amp; formControlType() const override;
-    FormControlState saveFormControlState() const override;
-    void restoreFormControlState(const FormControlState&amp;) override;
-    bool appendFormData(FormDataList&amp;, bool) const override;
-    bool valueMissing(const String&amp;) const override;
-    String valueMissingText() const override;
-    void handleDOMActivateEvent(Event&amp;) override;
-    RenderPtr&lt;RenderElement&gt; createInputRenderer(RenderStyle&amp;&amp;) override;
-    bool canSetStringValue() const override;
-    FileList* files() override;
-    void setFiles(PassRefPtr&lt;FileList&gt;) override;
</del><ins>+    const AtomicString&amp; formControlType() const final;
+    FormControlState saveFormControlState() const final;
+    void restoreFormControlState(const FormControlState&amp;) final;
+    bool appendFormData(FormDataList&amp;, bool) const final;
+    bool valueMissing(const String&amp;) const final;
+    String valueMissingText() const final;
+    void handleDOMActivateEvent(Event&amp;) final;
+    RenderPtr&lt;RenderElement&gt; createInputRenderer(RenderStyle&amp;&amp;) final;
+    bool canSetStringValue() const final;
+    FileList* files() final;
+    void setFiles(RefPtr&lt;FileList&gt;&amp;&amp;) final;
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>-    String displayString() const override;
</del><ins>+    String displayString() const final;
</ins><span class="cx"> #endif
</span><del>-    bool canSetValue(const String&amp;) override;
-    bool getTypeSpecificValue(String&amp;) override; // Checked first, before internal storage or the value attribute.
-    void setValue(const String&amp;, bool valueChanged, TextFieldEventBehavior) override;
</del><ins>+    bool canSetValue(const String&amp;) final;
+    bool getTypeSpecificValue(String&amp;) final; // Checked first, before internal storage or the value attribute.
+    void setValue(const String&amp;, bool valueChanged, TextFieldEventBehavior) final;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><del>-    bool receiveDroppedFiles(const DragData&amp;) override;
</del><ins>+    bool receiveDroppedFiles(const DragData&amp;) final;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    Icon* icon() const override;
-    bool isFileUpload() const override;
-    void createShadowSubtree() override;
-    void disabledAttributeChanged() override;
-    void multipleAttributeChanged() override;
-    String defaultToolTip() const override;
</del><ins>+    Icon* icon() const final;
+    bool isFileUpload() const final;
+    void createShadowSubtree() final;
+    void disabledAttributeChanged() final;
+    void multipleAttributeChanged() final;
+    String defaultToolTip() const final;
</ins><span class="cx"> 
</span><span class="cx">     // FileChooserClient implementation.
</span><del>-    void filesChosen(const Vector&lt;FileChooserFileInfo&gt;&amp;) override;
</del><ins>+    void filesChosen(const Vector&lt;FileChooserFileInfo&gt;&amp;) final;
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>-    void filesChosen(const Vector&lt;FileChooserFileInfo&gt;&amp;, const String&amp; displayString, Icon*) override;
</del><ins>+    void filesChosen(const Vector&lt;FileChooserFileInfo&gt;&amp;, const String&amp; displayString, Icon*) final;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     // FileIconLoaderClient implementation.
</span><del>-    void updateRendering(PassRefPtr&lt;Icon&gt;) override;
</del><ins>+    void iconLoaded(RefPtr&lt;Icon&gt;&amp;&amp;) final;
</ins><span class="cx"> 
</span><del>-    PassRefPtr&lt;FileList&gt; createFileList(const Vector&lt;FileChooserFileInfo&gt;&amp; files) const;
</del><ins>+    static Ref&lt;FileList&gt; createFileList(const Vector&lt;FileChooserFileInfo&gt;&amp;);
</ins><span class="cx">     void requestIcon(const Vector&lt;String&gt;&amp;);
</span><span class="cx"> 
</span><span class="cx">     void applyFileChooserSettings(const FileChooserSettings&amp;);
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">     std::unique_ptr&lt;FileIconLoader&gt; m_fileIconLoader;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    RefPtr&lt;FileList&gt; m_fileList;
</del><ins>+    Ref&lt;FileList&gt; m_fileList;
</ins><span class="cx">     RefPtr&lt;Icon&gt; m_icon;
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     String m_displayString;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx">  * Copyright (C) 2011 Motorola Mobility. All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -752,7 +752,7 @@
</span><span class="cx">     return RenderElement::createFor(*this, WTFMove(style));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HTMLFormElement* HTMLElement::virtualForm() const
</del><ins>+HTMLFormElement* HTMLElement::form() const
</ins><span class="cx"> {
</span><span class="cx">     return HTMLFormElement::findClosestFormAncestor(*this);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><del>- * Copyright (C) 2004-2009, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">     bool rendererIsNeeded(const RenderStyle&amp;) override;
</span><span class="cx">     RenderPtr&lt;RenderElement&gt; createElementRenderer(RenderStyle&amp;&amp;, const RenderTreePosition&amp;) override;
</span><span class="cx"> 
</span><del>-    HTMLFormElement* form() const { return virtualForm(); }
</del><ins>+    WEBCORE_EXPORT virtual HTMLFormElement* form() const;
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT const AtomicString&amp; dir() const;
</span><span class="cx">     WEBCORE_EXPORT void setDir(const AtomicString&amp;);
</span><span class="lines">@@ -133,8 +133,6 @@
</span><span class="cx"> 
</span><span class="cx">     void mapLanguageAttributeToLocale(const AtomicString&amp;, MutableStyleProperties&amp;);
</span><span class="cx"> 
</span><del>-    virtual HTMLFormElement* virtualForm() const;
-
</del><span class="cx">     ExceptionOr&lt;Ref&lt;DocumentFragment&gt;&gt; textToFragment(const String&amp;);
</span><span class="cx"> 
</span><span class="cx">     void dirAttributeChanged(const AtomicString&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -593,11 +593,6 @@
</span><span class="cx">     hideVisibleValidationMessage();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HTMLFormElement* HTMLFormControlElement::virtualForm() const
-{
-    return FormAssociatedElement::form();
-}
-
</del><span class="cx"> #if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
</span><span class="cx"> 
</span><span class="cx"> // FIXME: We should look to share this code with class HTMLFormElement instead of duplicating the logic.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLFormControlElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLFormControlElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLFormControlElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLFormControlElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2000 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> public:
</span><span class="cx">     virtual ~HTMLFormControlElement();
</span><span class="cx"> 
</span><del>-    HTMLFormElement* form() const { return FormAssociatedElement::form(); }
</del><ins>+    HTMLFormElement* form() const final { return FormAssociatedElement::form(); }
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT String formEnctype() const;
</span><span class="cx">     WEBCORE_EXPORT void setFormEnctype(const String&amp;);
</span><span class="lines">@@ -169,7 +169,6 @@
</span><span class="cx"> 
</span><span class="cx">     int tabIndex() const final;
</span><span class="cx"> 
</span><del>-    HTMLFormElement* virtualForm() const override;
</del><span class="cx">     bool isValidFormControlElement() const;
</span><span class="cx"> 
</span><span class="cx">     bool computeIsDisabledByFieldsetAncestor() const;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
</span><span class="cx">  * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
</span><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><span class="lines">@@ -1184,10 +1184,9 @@
</span><span class="cx">         if (wasChangedSinceLastFormControlChangeEvent())
</span><span class="cx">             dispatchFormControlChangeEvent();
</span><span class="cx"> 
</span><del>-        RefPtr&lt;HTMLFormElement&gt; formForSubmission = m_inputType-&gt;formForSubmission();
</del><span class="cx">         // Form may never have been present, or may have been destroyed by code responding to the change event.
</span><del>-        if (formForSubmission)
-            formForSubmission-&gt;submitImplicitly(event, canTriggerImplicitSubmission());
</del><ins>+        if (auto* formElement = form())
+            formElement-&gt;submitImplicitly(event, canTriggerImplicitSubmission());
</ins><span class="cx"> 
</span><span class="cx">         event.setDefaultHandled();
</span><span class="cx">         return;
</span><span class="lines">@@ -1342,9 +1341,9 @@
</span><span class="cx">     return m_inputType-&gt;files();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLInputElement::setFiles(PassRefPtr&lt;FileList&gt; files)
</del><ins>+void HTMLInputElement::setFiles(RefPtr&lt;FileList&gt;&amp;&amp; files)
</ins><span class="cx"> {
</span><del>-    m_inputType-&gt;setFiles(files);
</del><ins>+    m_inputType-&gt;setFiles(WTFMove(files));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="lines">@@ -1869,7 +1868,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!isRadioButton())
</span><span class="cx">         return nullptr;
</span><del>-    if (HTMLFormElement* formElement = form())
</del><ins>+    if (auto* formElement = form())
</ins><span class="cx">         return &amp;formElement-&gt;radioButtonGroups();
</span><span class="cx">     if (inDocument())
</span><span class="cx">         return &amp;document().formController().radioButtonGroups();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLInputElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2000 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2012 Samsung Electronics. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -43,8 +43,8 @@
</span><span class="cx"> class InputType;
</span><span class="cx"> class ListAttributeTargetObserver;
</span><span class="cx"> class RadioButtonGroups;
</span><del>-class TextControlInnerTextElement;
</del><span class="cx"> class URL;
</span><ins>+
</ins><span class="cx"> struct DateTimeChooserParameters;
</span><span class="cx"> 
</span><span class="cx"> struct InputElementClickState {
</span><span class="lines">@@ -238,7 +238,7 @@
</span><span class="cx">     WEBCORE_EXPORT void setShowAutoFillButton(AutoFillButtonType);
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT FileList* files();
</span><del>-    WEBCORE_EXPORT void setFiles(PassRefPtr&lt;FileList&gt;);
</del><ins>+    WEBCORE_EXPORT void setFiles(RefPtr&lt;FileList&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx">     // Returns true if the given DragData has more than one dropped files.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLabelElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLabelElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLabelElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLLabelElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -58,9 +58,9 @@
</span><span class="cx">     return adoptRef(*new HTMLLabelElement(tagName, document));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LabelableElement* HTMLLabelElement::control()
</del><ins>+LabelableElement* HTMLLabelElement::control() const
</ins><span class="cx"> {
</span><del>-    const AtomicString&amp; controlId = attributeWithoutSynchronization(forAttr);
</del><ins>+    auto&amp; controlId = attributeWithoutSynchronization(forAttr);
</ins><span class="cx">     if (controlId.isNull()) {
</span><span class="cx">         // Search the children and descendants of the label element for a form element.
</span><span class="cx">         // per http://dev.w3.org/html5/spec/Overview.html#the-label-element
</span><span class="lines">@@ -67,21 +67,19 @@
</span><span class="cx">         // the form element must be &quot;labelable form-associated element&quot;.
</span><span class="cx">         for (auto&amp; labelableElement : descendantsOfType&lt;LabelableElement&gt;(*this)) {
</span><span class="cx">             if (labelableElement.supportLabels())
</span><del>-                return &amp;labelableElement;
</del><ins>+                return const_cast&lt;LabelableElement*&gt;(&amp;labelableElement);
</ins><span class="cx">         }
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><del>-    
</del><span class="cx">     return inDocument() ? firstElementWithIdIfLabelable(treeScope(), controlId) : nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HTMLFormElement* HTMLLabelElement::form()
</del><ins>+HTMLFormElement* HTMLLabelElement::form() const
</ins><span class="cx"> {
</span><del>-    auto* labeledControl = control();
-    if (!labeledControl)
</del><ins>+    auto* control = this-&gt;control();
+    if (!is&lt;HTMLFormControlElement&gt;(control))
</ins><span class="cx">         return nullptr;
</span><del>-
-    return is&lt;HTMLFormControlElement&gt;(*labeledControl) ? downcast&lt;HTMLFormControlElement&gt;(*labeledControl).form() : nullptr;
</del><ins>+    return downcast&lt;HTMLFormControlElement&gt;(*control).form();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLLabelElement::setActive(bool down, bool pause)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLabelElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLabelElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLabelElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLLabelElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2000 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -31,8 +31,8 @@
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;HTMLLabelElement&gt; create(const QualifiedName&amp;, Document&amp;);
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT LabelableElement* control();
-    WEBCORE_EXPORT HTMLFormElement* form();
</del><ins>+    WEBCORE_EXPORT LabelableElement* control() const;
+    WEBCORE_EXPORT HTMLFormElement* form() const final;
</ins><span class="cx"> 
</span><span class="cx">     bool willRespondToMouseClickEvents() final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLegendElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLegendElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLegendElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLLegendElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -31,13 +31,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-using namespace HTMLNames;
-
-
</del><span class="cx"> inline HTMLLegendElement::HTMLLegendElement(const QualifiedName&amp; tagName, Document&amp; document)
</span><span class="cx">     : HTMLElement(tagName, document)
</span><span class="cx"> {
</span><del>-    ASSERT(hasTagName(legendTag));
</del><ins>+    ASSERT(hasTagName(HTMLNames::legendTag));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;HTMLLegendElement&gt; HTMLLegendElement::create(const QualifiedName&amp; tagName, Document&amp; document)
</span><span class="lines">@@ -59,7 +56,6 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLLegendElement::focus(bool restorePreviousSelection, FocusDirection direction)
</span><span class="cx"> {
</span><del>-    // To match other browsers' behavior, never restore previous selection.
</del><span class="cx">     if (document().haveStylesheetsLoaded()) {
</span><span class="cx">         document().updateLayoutIgnorePendingStylesheets();
</span><span class="cx">         if (isFocusable()) {
</span><span class="lines">@@ -67,6 +63,8 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+
+    // To match other browsers' behavior, never restore previous selection.
</ins><span class="cx">     if (auto* control = associatedControl())
</span><span class="cx">         control-&gt;focus(false, direction);
</span><span class="cx"> }
</span><span class="lines">@@ -73,19 +71,18 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLLegendElement::accessKeyAction(bool sendMouseEvents)
</span><span class="cx"> {
</span><del>-    if (HTMLFormControlElement* control = associatedControl())
</del><ins>+    if (auto* control = associatedControl())
</ins><span class="cx">         control-&gt;accessKeyAction(sendMouseEvents);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HTMLFormElement* HTMLLegendElement::virtualForm() const
</del><ins>+HTMLFormElement* HTMLLegendElement::form() const
</ins><span class="cx"> {
</span><span class="cx">     // According to the specification, If the legend has a fieldset element as
</span><span class="cx">     // its parent, then the form attribute must return the same value as the
</span><span class="cx">     // form attribute on that fieldset element. Otherwise, it must return null.
</span><del>-    ContainerNode* fieldset = parentNode();
</del><ins>+    auto* fieldset = parentNode();
</ins><span class="cx">     if (!is&lt;HTMLFieldSetElement&gt;(fieldset))
</span><span class="cx">         return nullptr;
</span><del>-
</del><span class="cx">     return downcast&lt;HTMLFieldSetElement&gt;(*fieldset).form();
</span><span class="cx"> }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLegendElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLegendElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLegendElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLLegendElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2000 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2018 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -33,15 +33,16 @@
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;HTMLLegendElement&gt; create(const QualifiedName&amp;, Document&amp;);
</span><span class="cx"> 
</span><ins>+    WEBCORE_EXPORT HTMLFormElement* form() const final;
+
</ins><span class="cx"> private:
</span><span class="cx">     HTMLLegendElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx"> 
</span><del>-    // Control in the legend's fieldset that gets focus and access key.
</del><ins>+    // Control in the legend's field set that gets focus and access key.
</ins><span class="cx">     HTMLFormControlElement* associatedControl();
</span><span class="cx"> 
</span><span class="cx">     void accessKeyAction(bool sendMouseEvents) final;
</span><span class="cx">     void focus(bool restorePreviousSelection, FocusDirection) final;
</span><del>-    HTMLFormElement* virtualForm() const final;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007-2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,11 +24,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;HTMLMediaElement.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx"> 
</span><del>-#include &quot;HTMLMediaElement.h&quot;
-
</del><span class="cx"> #include &quot;ApplicationCacheHost.h&quot;
</span><span class="cx"> #include &quot;ApplicationCacheResource.h&quot;
</span><span class="cx"> #include &quot;Attribute.h&quot;
</span><span class="lines">@@ -269,22 +268,23 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><ins>+
</ins><span class="cx"> class TrackDisplayUpdateScope {
</span><span class="cx"> public:
</span><del>-    TrackDisplayUpdateScope(HTMLMediaElement* mediaElement)
</del><ins>+    TrackDisplayUpdateScope(HTMLMediaElement&amp; element)
+        : m_element(element)
</ins><span class="cx">     {
</span><del>-        m_mediaElement = mediaElement;
-        m_mediaElement-&gt;beginIgnoringTrackDisplayUpdateRequests();
</del><ins>+        m_element.beginIgnoringTrackDisplayUpdateRequests();
</ins><span class="cx">     }
</span><span class="cx">     ~TrackDisplayUpdateScope()
</span><span class="cx">     {
</span><del>-        ASSERT(m_mediaElement);
-        m_mediaElement-&gt;endIgnoringTrackDisplayUpdateRequests();
</del><ins>+        m_element.endIgnoringTrackDisplayUpdateRequests();
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx"> private:
</span><del>-    HTMLMediaElement* m_mediaElement;
</del><ins>+    HTMLMediaElement&amp; m_element;
</ins><span class="cx"> };
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> struct HTMLMediaElement::TrackGroup {
</span><span class="lines">@@ -1554,7 +1554,7 @@
</span><span class="cx">     // 12 - Further sort tasks in events that have the same time by the
</span><span class="cx">     // relative text track cue order of the text track cues associated
</span><span class="cx">     // with these tasks.
</span><del>-    return a.second-&gt;cueIndex() - b.second-&gt;cueIndex() &lt; 0;
</del><ins>+    return a.second-&gt;isOrderedBefore(b.second);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool compareCueInterval(const CueInterval&amp; one, const CueInterval&amp; two)
</span><span class="lines">@@ -1817,22 +1817,21 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::audioTrackEnabledChanged(AudioTrack* track)
</del><ins>+void HTMLMediaElement::audioTrackEnabledChanged(AudioTrack&amp; track)
</ins><span class="cx"> {
</span><del>-    ASSERT(track);
-    if (m_audioTracks &amp;&amp; m_audioTracks-&gt;contains(*track))
</del><ins>+    if (m_audioTracks &amp;&amp; m_audioTracks-&gt;contains(track))
</ins><span class="cx">         m_audioTracks-&gt;scheduleChangeEvent();
</span><span class="cx">     if (ScriptController::processingUserGestureForMedia())
</span><span class="cx">         removeBehaviorsRestrictionsAfterFirstUserGesture(MediaElementSession::AllRestrictions &amp; ~MediaElementSession::RequireUserGestureToControlControlsManager);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::textTrackModeChanged(TextTrack* track)
</del><ins>+void HTMLMediaElement::textTrackModeChanged(TextTrack&amp; track)
</ins><span class="cx"> {
</span><span class="cx">     bool trackIsLoaded = true;
</span><del>-    if (track-&gt;trackType() == TextTrack::TrackElement) {
</del><ins>+    if (track.trackType() == TextTrack::TrackElement) {
</ins><span class="cx">         trackIsLoaded = false;
</span><span class="cx">         for (auto&amp; trackElement : childrenOfType&lt;HTMLTrackElement&gt;(*this)) {
</span><del>-            if (&amp;trackElement.track() == track) {
</del><ins>+            if (&amp;trackElement.track() == &amp;track) {
</ins><span class="cx">                 if (trackElement.readyState() == HTMLTrackElement::LOADING || trackElement.readyState() == HTMLTrackElement::LOADED)
</span><span class="cx">                     trackIsLoaded = true;
</span><span class="cx">                 break;
</span><span class="lines">@@ -1845,33 +1844,32 @@
</span><span class="cx">         m_textTracks = TextTrackList::create(this, ActiveDOMObject::scriptExecutionContext());
</span><span class="cx">     
</span><span class="cx">     // Mark this track as &quot;configured&quot; so configureTextTracks won't change the mode again.
</span><del>-    track-&gt;setHasBeenConfigured(true);
</del><ins>+    track.setHasBeenConfigured(true);
</ins><span class="cx">     
</span><del>-    if (track-&gt;mode() != TextTrack::Mode::Disabled &amp;&amp; trackIsLoaded)
-        textTrackAddCues(track, track-&gt;cues());
</del><ins>+    if (track.mode() != TextTrack::Mode::Disabled &amp;&amp; trackIsLoaded)
+        textTrackAddCues(track, *track.cues());
</ins><span class="cx"> 
</span><span class="cx">     configureTextTrackDisplay(AssumeTextTrackVisibilityChanged);
</span><span class="cx"> 
</span><del>-    if (m_textTracks &amp;&amp; m_textTracks-&gt;contains(*track))
</del><ins>+    if (m_textTracks &amp;&amp; m_textTracks-&gt;contains(track))
</ins><span class="cx">         m_textTracks-&gt;scheduleChangeEvent();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(AVF_CAPTIONS)
</span><del>-    if (track-&gt;trackType() == TextTrack::TrackElement &amp;&amp; m_player)
</del><ins>+    if (track.trackType() == TextTrack::TrackElement &amp;&amp; m_player)
</ins><span class="cx">         m_player-&gt;notifyTrackModeChanged();
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::videoTrackSelectedChanged(VideoTrack* track)
</del><ins>+void HTMLMediaElement::videoTrackSelectedChanged(VideoTrack&amp; track)
</ins><span class="cx"> {
</span><del>-    ASSERT(track);
-    if (m_videoTracks &amp;&amp; m_videoTracks-&gt;contains(*track))
</del><ins>+    if (m_videoTracks &amp;&amp; m_videoTracks-&gt;contains(track))
</ins><span class="cx">         m_videoTracks-&gt;scheduleChangeEvent();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::textTrackKindChanged(TextTrack* track)
</del><ins>+void HTMLMediaElement::textTrackKindChanged(TextTrack&amp; track)
</ins><span class="cx"> {
</span><del>-    if (track-&gt;kind() != TextTrack::Kind::Captions &amp;&amp; track-&gt;kind() != TextTrack::Kind::Subtitles &amp;&amp; track-&gt;mode() == TextTrack::Mode::Showing)
-        track-&gt;setMode(TextTrack::Mode::Hidden);
</del><ins>+    if (track.kind() != TextTrack::Kind::Captions &amp;&amp; track.kind() != TextTrack::Kind::Subtitles &amp;&amp; track.mode() == TextTrack::Mode::Showing)
+        track.setMode(TextTrack::Mode::Hidden);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLMediaElement::beginIgnoringTrackDisplayUpdateRequests()
</span><span class="lines">@@ -1887,26 +1885,28 @@
</span><span class="cx">         updateActiveTextTrackCues(currentMediaTime());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::textTrackAddCues(TextTrack* track, const TextTrackCueList* cues) 
</del><ins>+void HTMLMediaElement::textTrackAddCues(TextTrack&amp; track, const TextTrackCueList&amp; cues)
</ins><span class="cx"> {
</span><del>-    if (track-&gt;mode() == TextTrack::Mode::Disabled)
</del><ins>+    if (track.mode() == TextTrack::Mode::Disabled)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    TrackDisplayUpdateScope scope(this);
-    for (size_t i = 0; i &lt; cues-&gt;length(); ++i)
-        textTrackAddCue(track, *cues-&gt;item(i));
</del><ins>+    TrackDisplayUpdateScope scope { *this };
+    for (unsigned i = 0; i &lt; cues.length(); ++i)
+        textTrackAddCue(track, *cues.item(i));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::textTrackRemoveCues(TextTrack*, const TextTrackCueList* cues)
</del><ins>+void HTMLMediaElement::textTrackRemoveCues(TextTrack&amp;, const TextTrackCueList&amp; cues)
</ins><span class="cx"> {
</span><del>-    TrackDisplayUpdateScope scope(this);
-    for (size_t i = 0; i &lt; cues-&gt;length(); ++i)
-        textTrackRemoveCue(cues-&gt;item(i)-&gt;track(), *cues-&gt;item(i));
</del><ins>+    TrackDisplayUpdateScope scope { *this };
+    for (unsigned i = 0; i &lt; cues.length(); ++i) {
+        auto&amp; cue = *cues.item(i);
+        textTrackRemoveCue(*cue.track(), cue);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::textTrackAddCue(TextTrack* track, TextTrackCue&amp; cue)
</del><ins>+void HTMLMediaElement::textTrackAddCue(TextTrack&amp; track, TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><del>-    if (track-&gt;mode() == TextTrack::Mode::Disabled)
</del><ins>+    if (track.mode() == TextTrack::Mode::Disabled)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Negative duration cues need be treated in the interval tree as
</span><span class="lines">@@ -1919,7 +1919,7 @@
</span><span class="cx">     updateActiveTextTrackCues(currentMediaTime());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::textTrackRemoveCue(TextTrack*, TextTrackCue&amp; cue)
</del><ins>+void HTMLMediaElement::textTrackRemoveCue(TextTrack&amp;, TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><span class="cx">     // Negative duration cues need to be treated in the interval tree as
</span><span class="cx">     // zero-length cues.
</span><span class="lines">@@ -3212,6 +3212,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><ins>+
</ins><span class="cx"> void HTMLMediaElement::detachMediaSource()
</span><span class="cx"> {
</span><span class="cx">     if (!m_mediaSource)
</span><span class="lines">@@ -3220,6 +3221,7 @@
</span><span class="cx">     m_mediaSource-&gt;detachFromElement(*this);
</span><span class="cx">     m_mediaSource = nullptr;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> bool HTMLMediaElement::loop() const
</span><span class="lines">@@ -3508,7 +3510,7 @@
</span><span class="cx">     if (isPlaying() &amp;&amp; !m_mediaSession-&gt;playbackPermitted(*this))
</span><span class="cx">         pauseInternal();
</span><span class="cx"> 
</span><del>-    addAudioTrack(AudioTrack::create(this, &amp;track));
</del><ins>+    addAudioTrack(AudioTrack::create(*this, track));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLMediaElement::mediaPlayerDidAddTextTrack(InbandTextTrackPrivate&amp; track)
</span><span class="lines">@@ -3515,7 +3517,7 @@
</span><span class="cx"> {
</span><span class="cx">     // 4.8.10.12.2 Sourcing in-band text tracks
</span><span class="cx">     // 1. Associate the relevant data with a new text track and its corresponding new TextTrack object.
</span><del>-    RefPtr&lt;InbandTextTrack&gt; textTrack = InbandTextTrack::create(ActiveDOMObject::scriptExecutionContext(), this, &amp;track);
</del><ins>+    auto textTrack = InbandTextTrack::create(*ActiveDOMObject::scriptExecutionContext(), *this, track);
</ins><span class="cx">     textTrack-&gt;setMediaElement(this);
</span><span class="cx">     
</span><span class="cx">     // 2. Set the new text track's kind, label, and language based on the semantics of the relevant data,
</span><span class="lines">@@ -3541,12 +3543,12 @@
</span><span class="cx">     // 9. Fire an event with the name addtrack, that does not bubble and is not cancelable, and that uses the TrackEvent
</span><span class="cx">     // interface, with the track attribute initialized to the text track's TextTrack object, at the media element's
</span><span class="cx">     // textTracks attribute's TextTrackList object.
</span><del>-    addTextTrack(textTrack.releaseNonNull());
</del><ins>+    addTextTrack(WTFMove(textTrack));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLMediaElement::mediaPlayerDidAddVideoTrack(VideoTrackPrivate&amp; track)
</span><span class="cx"> {
</span><del>-    addVideoTrack(VideoTrack::create(this, &amp;track));
</del><ins>+    addVideoTrack(VideoTrack::create(*this, track));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLMediaElement::mediaPlayerDidRemoveAudioTrack(AudioTrackPrivate&amp; track)
</span><span class="lines">@@ -3603,9 +3605,9 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLMediaElement::removeTextTrack(TextTrack&amp; track, bool scheduleEvent)
</span><span class="cx"> {
</span><del>-    TrackDisplayUpdateScope scope(this);
-    if (TextTrackCueList* cues = track.cues())
-        textTrackRemoveCues(&amp;track, cues);
</del><ins>+    TrackDisplayUpdateScope scope { *this };
+    if (auto* cues = track.cues())
+        textTrackRemoveCues(track, *cues);
</ins><span class="cx">     track.clearClient();
</span><span class="cx">     if (m_textTracks)
</span><span class="cx">         m_textTracks-&gt;remove(track, scheduleEvent);
</span><span class="lines">@@ -3625,7 +3627,7 @@
</span><span class="cx">         removeAudioTrack(*m_audioTracks-&gt;lastItem());
</span><span class="cx"> 
</span><span class="cx">     if (m_textTracks) {
</span><del>-        TrackDisplayUpdateScope scope(this);
</del><ins>+        TrackDisplayUpdateScope scope { *this };
</ins><span class="cx">         for (int i = m_textTracks-&gt;length() - 1; i &gt;= 0; --i) {
</span><span class="cx">             auto&amp; track = *m_textTracks-&gt;item(i);
</span><span class="cx">             if (track.trackType() == TextTrack::InBand)
</span><span class="lines">@@ -6078,12 +6080,12 @@
</span><span class="cx">     return m_mediaController.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaElement::setController(PassRefPtr&lt;MediaController&gt; controller)
</del><ins>+void HTMLMediaElement::setController(RefPtr&lt;MediaController&gt;&amp;&amp; controller)
</ins><span class="cx"> {
</span><span class="cx">     if (m_mediaController)
</span><span class="cx">         m_mediaController-&gt;removeMediaElement(*this);
</span><span class="cx"> 
</span><del>-    m_mediaController = controller;
</del><ins>+    m_mediaController = WTFMove(controller);
</ins><span class="cx"> 
</span><span class="cx">     if (m_mediaController)
</span><span class="cx">         m_mediaController-&gt;addMediaElement(*this);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -27,10 +27,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx"> 
</span><del>-#include &quot;HTMLElement.h&quot;
</del><span class="cx"> #include &quot;ActiveDOMObject.h&quot;
</span><span class="cx"> #include &quot;GenericEventQueue.h&quot;
</span><span class="cx"> #include &quot;GenericTaskQueue.h&quot;
</span><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLMediaElementEnums.h&quot;
</span><span class="cx"> #include &quot;MediaCanStartListener.h&quot;
</span><span class="cx"> #include &quot;MediaControllerInterface.h&quot;
</span><span class="lines">@@ -69,9 +69,7 @@
</span><span class="cx"> class MediaControlsHost;
</span><span class="cx"> class MediaElementAudioSourceNode;
</span><span class="cx"> class MediaError;
</span><del>-#if ENABLE(ENCRYPTED_MEDIA)
</del><span class="cx"> class MediaKeys;
</span><del>-#endif
</del><span class="cx"> class MediaPlayer;
</span><span class="cx"> class MediaSession;
</span><span class="cx"> class MediaSource;
</span><span class="lines">@@ -81,7 +79,6 @@
</span><span class="cx"> class SourceBuffer;
</span><span class="cx"> class TextTrackList;
</span><span class="cx"> class TimeRanges;
</span><del>-class URL;
</del><span class="cx"> class VideoPlaybackQuality;
</span><span class="cx"> class VideoTrackList;
</span><span class="cx"> class VideoTrackPrivate;
</span><span class="lines">@@ -331,20 +328,20 @@
</span><span class="cx">     void updateTextTrackDisplay();
</span><span class="cx"> 
</span><span class="cx">     // AudioTrackClient
</span><del>-    void audioTrackEnabledChanged(AudioTrack*) override;
</del><ins>+    void audioTrackEnabledChanged(AudioTrack&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     void textTrackReadyStateChanged(TextTrack*);
</span><span class="cx"> 
</span><span class="cx">     // TextTrackClient
</span><del>-    void textTrackKindChanged(TextTrack*) override;
-    void textTrackModeChanged(TextTrack*) override;
-    void textTrackAddCues(TextTrack*, const TextTrackCueList*) override;
-    void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) override;
-    void textTrackAddCue(TextTrack*, TextTrackCue&amp;) override;
-    void textTrackRemoveCue(TextTrack*, TextTrackCue&amp;) override;
</del><ins>+    void textTrackKindChanged(TextTrack&amp;) override;
+    void textTrackModeChanged(TextTrack&amp;) override;
+    void textTrackAddCues(TextTrack&amp;, const TextTrackCueList&amp;) override;
+    void textTrackRemoveCues(TextTrack&amp;, const TextTrackCueList&amp;) override;
+    void textTrackAddCue(TextTrack&amp;, TextTrackCue&amp;) override;
+    void textTrackRemoveCue(TextTrack&amp;, TextTrackCue&amp;) override;
</ins><span class="cx"> 
</span><span class="cx">     // VideoTrackClient
</span><del>-    void videoTrackSelectedChanged(VideoTrack*) override;
</del><ins>+    void videoTrackSelectedChanged(VideoTrack&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     bool requiresTextTrackRepresentation() const;
</span><span class="cx">     void setTextTrackRepresentation(TextTrackRepresentation*);
</span><span class="lines">@@ -422,7 +419,7 @@
</span><span class="cx">     void setMediaGroup(const String&amp;);
</span><span class="cx"> 
</span><span class="cx">     MediaController* controller() const;
</span><del>-    void setController(PassRefPtr&lt;MediaController&gt;);
</del><ins>+    void setController(RefPtr&lt;MediaController&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void enteredOrExitedFullscreen() { configureMediaControls(); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2000 Stefan Schimanski (1Stein@gmx.de)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -519,11 +519,6 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HTMLFormElement* HTMLObjectElement::virtualForm() const
-{
-    return FormAssociatedElement::form();
-}
-
</del><span class="cx"> bool HTMLObjectElement::canContainRangeEndPoint() const
</span><span class="cx"> {
</span><span class="cx">     // Call through to HTMLElement because we need to skip HTMLPlugInElement
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLObjectElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><del>- * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">     using HTMLPlugInImageElement::ref;
</span><span class="cx">     using HTMLPlugInImageElement::deref;
</span><span class="cx"> 
</span><del>-    using FormAssociatedElement::form;
</del><ins>+    HTMLFormElement* form() const final { return FormAssociatedElement::form(); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     HTMLObjectElement(const QualifiedName&amp;, Document&amp;, HTMLFormElement*, bool createdByParser);
</span><span class="lines">@@ -91,7 +91,6 @@
</span><span class="cx"> 
</span><span class="cx">     void refFormAssociatedElement() final { ref(); }
</span><span class="cx">     void derefFormAssociatedElement() final { deref(); }
</span><del>-    HTMLFormElement* virtualForm() const final;
</del><span class="cx"> 
</span><span class="cx">     FormNamedItem* asFormNamedItem() final { return this; }
</span><span class="cx">     HTMLObjectElement&amp; asHTMLElement() final { return *this; }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLOptionElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLOptionElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLOptionElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLOptionElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2010, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2011 Motorola Mobility, Inc.  All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -334,7 +334,7 @@
</span><span class="cx">         if (is&lt;Text&gt;(*node))
</span><span class="cx">             text.append(node-&gt;nodeValue());
</span><span class="cx">         // Text nodes inside script elements are not part of the option text.
</span><del>-        if (is&lt;Element&gt;(*node) &amp;&amp; toScriptElementIfPossible(downcast&lt;Element&gt;(node)))
</del><ins>+        if (is&lt;Element&gt;(*node) &amp;&amp; isScriptElement(downcast&lt;Element&gt;(*node)))
</ins><span class="cx">             node = NodeTraversal::nextSkippingChildren(*node, this);
</span><span class="cx">         else
</span><span class="cx">             node = NodeTraversal::next(*node, this);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><del>-/**
</del><ins>+/*
</ins><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2000 Stefan Schimanski (1Stein@gmx.de)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2014 Apple Inc.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -108,21 +108,20 @@
</span><span class="cx">     m_instance = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;JSC::Bindings::Instance&gt; HTMLPlugInElement::getInstance()
</del><ins>+JSC::Bindings::Instance* HTMLPlugInElement::bindingsInstance()
</ins><span class="cx"> {
</span><del>-    Frame* frame = document().frame();
</del><ins>+    auto* frame = document().frame();
</ins><span class="cx">     if (!frame)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     // If the host dynamically turns off JavaScript (or Java) we will still return
</span><span class="cx">     // the cached allocated Bindings::Instance.  Not supporting this edge-case is OK.
</span><del>-    if (m_instance)
-        return m_instance;
</del><span class="cx"> 
</span><del>-    if (Widget* widget = pluginWidget())
-        m_instance = frame-&gt;script().createScriptInstanceForWidget(widget);
-
-    return m_instance;
</del><ins>+    if (!m_instance) {
+        if (auto* widget = pluginWidget())
+            m_instance = frame-&gt;script().createScriptInstanceForWidget(widget);
+    }
+    return m_instance.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool HTMLPlugInElement::guardedDispatchBeforeLoadEvent(const String&amp; sourceURL)
</span><span class="lines">@@ -199,7 +198,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (is&lt;RenderSnapshottedPlugIn&gt;(*renderer) &amp;&amp; displayState() &lt; Restarting) {
</span><del>-            downcast&lt;RenderSnapshottedPlugIn&gt;(*renderer).handleEvent(&amp;event);
</del><ins>+            downcast&lt;RenderSnapshottedPlugIn&gt;(*renderer).handleEvent(event);
</ins><span class="cx">             HTMLFrameOwnerElement::defaultEventHandler(event);
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><del>- * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> 
</span><span class="cx">     void resetInstance();
</span><span class="cx"> 
</span><del>-    PassRefPtr&lt;JSC::Bindings::Instance&gt; getInstance();
</del><ins>+    JSC::Bindings::Instance* bindingsInstance();
</ins><span class="cx"> 
</span><span class="cx">     enum class PluginLoadingPolicy { DoNotLoad, Load };
</span><span class="cx">     WEBCORE_EXPORT Widget* pluginWidget(PluginLoadingPolicy = PluginLoadingPolicy::Load) const;
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     };
</span><span class="cx">     DisplayState displayState() const { return m_displayState; }
</span><span class="cx">     virtual void setDisplayState(DisplayState);
</span><del>-    virtual void updateSnapshot(PassRefPtr&lt;Image&gt;) { }
</del><ins>+    virtual void updateSnapshot(Image*) { }
</ins><span class="cx">     virtual void dispatchPendingMouseClick() { }
</span><span class="cx">     virtual bool isRestartedPlugin() const { return false; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (displayState() == DisplayingSnapshot) {
</span><span class="cx">         auto renderSnapshottedPlugIn = createRenderer&lt;RenderSnapshottedPlugIn&gt;(*this, WTFMove(style));
</span><del>-        renderSnapshottedPlugIn-&gt;updateSnapshot(m_snapshotImage);
</del><ins>+        renderSnapshottedPlugIn-&gt;updateSnapshot(m_snapshotImage.get());
</ins><span class="cx">         return WTFMove(renderSnapshottedPlugIn);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -301,7 +301,7 @@
</span><span class="cx">     m_imageLoader-&gt;updateFromElement();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLPlugInImageElement::updateSnapshot(PassRefPtr&lt;Image&gt; image)
</del><ins>+void HTMLPlugInImageElement::updateSnapshot(Image* image)
</ins><span class="cx"> {
</span><span class="cx">     if (displayState() &gt; DisplayingSnapshot)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">     void defaultEventHandler(Event&amp;) final;
</span><span class="cx">     void dispatchPendingMouseClick() final;
</span><span class="cx"> 
</span><del>-    void updateSnapshot(PassRefPtr&lt;Image&gt;) final;
</del><ins>+    void updateSnapshot(Image*) final;
</ins><span class="cx"> 
</span><span class="cx">     void startLoadingImage();
</span><span class="cx">     void updateWidgetIfNecessary();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLScriptElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLScriptElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLScriptElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLScriptElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLScriptElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLScriptElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLScriptElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLScriptElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><del>- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2003-2017 Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 Nikolas Zimmermann &lt;zimmermann@kde.org&gt;
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -43,6 +43,9 @@
</span><span class="cx">     WEBCORE_EXPORT void setCrossOrigin(const AtomicString&amp;);
</span><span class="cx">     WEBCORE_EXPORT String crossOrigin() const;
</span><span class="cx"> 
</span><ins>+    using HTMLElement::ref;
+    using HTMLElement::deref;
+
</ins><span class="cx"> private:
</span><span class="cx">     HTMLScriptElement(const QualifiedName&amp;, Document&amp;, bool wasInsertedByParser, bool alreadyStarted);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextFormControlElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -427,7 +427,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;Range&gt; HTMLTextFormControlElement::selection() const
</del><ins>+RefPtr&lt;Range&gt; HTMLTextFormControlElement::selection() const
</ins><span class="cx"> {
</span><span class="cx">     if (!renderer() || !isTextFormControl() || !hasCachedSelection())
</span><span class="cx">         return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextFormControlElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextFormControlElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2000 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">     WEBCORE_EXPORT virtual ExceptionOr&lt;void&gt; setRangeText(const String&amp; replacement, unsigned start, unsigned end, const String&amp; selectionMode);
</span><span class="cx">     void setSelectionRange(int start, int end, const String&amp; direction, const AXTextStateChangeIntent&amp; = AXTextStateChangeIntent());
</span><span class="cx">     WEBCORE_EXPORT void setSelectionRange(int start, int end, TextFieldSelectionDirection = SelectionHasNoDirection, const AXTextStateChangeIntent&amp; = AXTextStateChangeIntent());
</span><del>-    PassRefPtr&lt;Range&gt; selection() const;
</del><ins>+    RefPtr&lt;Range&gt; selection() const;
</ins><span class="cx">     String selectedText() const;
</span><span class="cx"> 
</span><span class="cx">     void dispatchFormControlChangeEvent() final;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTrackElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTrackElement.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTrackElement.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLTrackElement.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011, 2013 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -42,6 +43,7 @@
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><span class="cx"> #if !LOG_DISABLED
</span><ins>+
</ins><span class="cx"> static String urlForLoggingTrack(const URL&amp; url)
</span><span class="cx"> {
</span><span class="cx">     static const unsigned maximumURLLengthForLogging = 128;
</span><span class="lines">@@ -50,6 +52,7 @@
</span><span class="cx">         return url.string();
</span><span class="cx">     return url.string().substring(0, maximumURLLengthForLogging) + &quot;...&quot;;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx"> inline HTMLTrackElement::HTMLTrackElement(const QualifiedName&amp; tagName, Document&amp; document)
</span><span class="lines">@@ -279,43 +282,43 @@
</span><span class="cx">     return nullAtom;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLTrackElement::textTrackKindChanged(TextTrack* track)
</del><ins>+void HTMLTrackElement::textTrackKindChanged(TextTrack&amp; track)
</ins><span class="cx"> {
</span><del>-    if (HTMLMediaElement* parent = mediaElement())
</del><ins>+    if (auto* parent = mediaElement())
</ins><span class="cx">         parent-&gt;textTrackKindChanged(track);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLTrackElement::textTrackModeChanged(TextTrack* track)
</del><ins>+void HTMLTrackElement::textTrackModeChanged(TextTrack&amp; track)
</ins><span class="cx"> {
</span><span class="cx">     // Since we've moved to a new parent, we may now be able to load.
</span><span class="cx">     if (readyState() == HTMLTrackElement::NONE)
</span><span class="cx">         scheduleLoad();
</span><span class="cx"> 
</span><del>-    if (HTMLMediaElement* parent = mediaElement())
</del><ins>+    if (auto* parent = mediaElement())
</ins><span class="cx">         parent-&gt;textTrackModeChanged(track);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLTrackElement::textTrackAddCues(TextTrack* track, const TextTrackCueList* cues)
</del><ins>+void HTMLTrackElement::textTrackAddCues(TextTrack&amp; track, const TextTrackCueList&amp; cues)
</ins><span class="cx"> {
</span><del>-    if (HTMLMediaElement* parent = mediaElement())
</del><ins>+    if (auto* parent = mediaElement())
</ins><span class="cx">         parent-&gt;textTrackAddCues(track, cues);
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-void HTMLTrackElement::textTrackRemoveCues(TextTrack* track, const TextTrackCueList* cues)
</del><ins>+void HTMLTrackElement::textTrackRemoveCues(TextTrack&amp; track, const TextTrackCueList&amp; cues)
</ins><span class="cx"> {
</span><del>-    if (HTMLMediaElement* parent = mediaElement())
</del><ins>+    if (auto* parent = mediaElement())
</ins><span class="cx">         parent-&gt;textTrackRemoveCues(track, cues);
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-void HTMLTrackElement::textTrackAddCue(TextTrack* track, TextTrackCue&amp; cue)
</del><ins>+void HTMLTrackElement::textTrackAddCue(TextTrack&amp; track, TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><del>-    if (HTMLMediaElement* parent = mediaElement())
</del><ins>+    if (auto* parent = mediaElement())
</ins><span class="cx">         parent-&gt;textTrackAddCue(track, cue);
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-void HTMLTrackElement::textTrackRemoveCue(TextTrack* track, TextTrackCue&amp; cue)
</del><ins>+void HTMLTrackElement::textTrackRemoveCue(TextTrack&amp; track, TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><del>-    if (HTMLMediaElement* parent = mediaElement())
</del><ins>+    if (auto* parent = mediaElement())
</ins><span class="cx">         parent-&gt;textTrackRemoveCue(track, cue);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTrackElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTrackElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTrackElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/HTMLTrackElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -74,12 +75,12 @@
</span><span class="cx">     HTMLMediaElement* mediaElement() const;
</span><span class="cx"> 
</span><span class="cx">     // TextTrackClient
</span><del>-    void textTrackModeChanged(TextTrack*) final;
-    void textTrackKindChanged(TextTrack*) final;
-    void textTrackAddCues(TextTrack*, const TextTrackCueList*) final;
-    void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) final;
-    void textTrackAddCue(TextTrack*, TextTrackCue&amp;) final;
-    void textTrackRemoveCue(TextTrack*, TextTrackCue&amp;) final;
</del><ins>+    void textTrackModeChanged(TextTrack&amp;) final;
+    void textTrackKindChanged(TextTrack&amp;) final;
+    void textTrackAddCues(TextTrack&amp;, const TextTrackCueList&amp;) final;
+    void textTrackRemoveCues(TextTrack&amp;, const TextTrackCueList&amp;) final;
+    void textTrackAddCue(TextTrack&amp;, TextTrackCue&amp;) final;
+    void textTrackRemoveCue(TextTrack&amp;, TextTrackCue&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     bool canLoadURL(const URL&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/InputType.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/InputType.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/InputType.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@nypop.com)
</span><span class="cx">  * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
</span><span class="cx">  * Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved.
</span><span class="lines">@@ -482,11 +482,6 @@
</span><span class="cx">     return is&lt;KeyboardEvent&gt;(event) &amp;&amp; event.type() == eventNames().keypressEvent &amp;&amp; downcast&lt;KeyboardEvent&gt;(event).charCode() == '\r';
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;HTMLFormElement&gt; InputType::formForSubmission() const
-{
-    return element().form();
-}
-
</del><span class="cx"> RenderPtr&lt;RenderElement&gt; InputType::createInputRenderer(RenderStyle&amp;&amp; style)
</span><span class="cx"> {
</span><span class="cx">     return RenderPtr&lt;RenderElement&gt;(RenderElement::createFor(element(), WTFMove(style)));
</span><span class="lines">@@ -551,7 +546,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (Page* page = element().document().page())
</span><span class="cx">         return &amp;page-&gt;chrome();
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool InputType::canSetStringValue() const
</span><span class="lines">@@ -636,7 +631,7 @@
</span><span class="cx"> 
</span><span class="cx"> HTMLElement* InputType::placeholderElement() const
</span><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool InputType::rendererIsNeeded()
</span><span class="lines">@@ -646,10 +641,10 @@
</span><span class="cx"> 
</span><span class="cx"> FileList* InputType::files()
</span><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InputType::setFiles(PassRefPtr&lt;FileList&gt;)
</del><ins>+void InputType::setFiles(RefPtr&lt;FileList&gt;&amp;&amp;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -731,25 +726,29 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><ins>+
</ins><span class="cx"> bool InputType::receiveDroppedFiles(const DragData&amp;)
</span><span class="cx"> {
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> Icon* InputType::icon() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+
</ins><span class="cx"> String InputType::displayString() const
</span><span class="cx"> {
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return String();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> bool InputType::shouldResetOnDocumentActivation()
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlInputTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/InputType.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/InputType.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/InputType.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2011, 2014-2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2012 Samsung Electronics. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -192,7 +192,6 @@
</span><span class="cx">     // Helpers for event handlers.
</span><span class="cx"> 
</span><span class="cx">     virtual bool shouldSubmitImplicitly(Event&amp;);
</span><del>-    virtual PassRefPtr&lt;HTMLFormElement&gt; formForSubmission() const;
</del><span class="cx">     virtual bool hasCustomFocusLogic() const;
</span><span class="cx">     virtual bool isKeyboardFocusable(KeyboardEvent&amp;) const;
</span><span class="cx">     virtual bool isMouseFocusable() const;
</span><span class="lines">@@ -239,7 +238,7 @@
</span><span class="cx">     virtual void maxResultsAttributeChanged();
</span><span class="cx">     virtual bool shouldRespectAlignAttribute();
</span><span class="cx">     virtual FileList* files();
</span><del>-    virtual void setFiles(PassRefPtr&lt;FileList&gt;);
</del><ins>+    virtual void setFiles(RefPtr&lt;FileList&gt;&amp;&amp;);
</ins><span class="cx">     virtual Icon* icon() const;
</span><span class="cx">     virtual bool shouldSendChangeEventAfterCheckedChanged();
</span><span class="cx">     virtual bool canSetValue(const String&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlPluginDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/PluginDocument.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/PluginDocument.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/PluginDocument.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2008, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -53,15 +53,13 @@
</span><span class="cx"> private:
</span><span class="cx">     PluginDocumentParser(Document&amp; document)
</span><span class="cx">         : RawDataDocumentParser(document)
</span><del>-        , m_embedElement(0)
</del><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void appendBytes(DocumentWriter&amp;, const char*, size_t) override;
-
</del><ins>+    void appendBytes(DocumentWriter&amp;, const char*, size_t) final;
</ins><span class="cx">     void createDocumentStructure();
</span><span class="cx"> 
</span><del>-    HTMLEmbedElement* m_embedElement;
</del><ins>+    HTMLEmbedElement* m_embedElement { nullptr };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> void PluginDocumentParser::createDocumentStructure()
</span><span class="lines">@@ -104,7 +102,7 @@
</span><span class="cx">     if (auto* loader = document.loader())
</span><span class="cx">         m_embedElement-&gt;setAttributeWithoutSynchronization(typeAttr, loader-&gt;writer().mimeType());
</span><span class="cx"> 
</span><del>-    document.setPluginElement(m_embedElement);
</del><ins>+    document.setPluginElement(*m_embedElement);
</ins><span class="cx"> 
</span><span class="cx">     body-&gt;appendChild(embedElement);
</span><span class="cx"> }
</span><span class="lines">@@ -116,7 +114,7 @@
</span><span class="cx"> 
</span><span class="cx">     createDocumentStructure();
</span><span class="cx"> 
</span><del>-    Frame* frame = document()-&gt;frame();
</del><ins>+    auto* frame = document()-&gt;frame();
</ins><span class="cx">     if (!frame)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -142,7 +140,6 @@
</span><span class="cx"> 
</span><span class="cx"> PluginDocument::PluginDocument(Frame* frame, const URL&amp; url)
</span><span class="cx">     : HTMLDocument(frame, url, PluginDocumentClass)
</span><del>-    , m_shouldLoadPluginManually(true)
</del><span class="cx"> {
</span><span class="cx">     setCompatibilityMode(DocumentCompatibilityMode::QuirksMode);
</span><span class="cx">     lockCompatibilityMode();
</span><span class="lines">@@ -155,14 +152,17 @@
</span><span class="cx"> 
</span><span class="cx"> Widget* PluginDocument::pluginWidget()
</span><span class="cx"> {
</span><del>-    if (m_pluginElement &amp;&amp; m_pluginElement-&gt;renderer())
-        return downcast&lt;RenderEmbeddedObject&gt;(*m_pluginElement-&gt;renderer()).widget();
-    return nullptr;
</del><ins>+    if (!m_pluginElement)
+        return nullptr;
+    auto* renderer = m_pluginElement-&gt;renderer();
+    if (!renderer)
+        return nullptr;
+    return downcast&lt;RenderEmbeddedObject&gt;(*m_pluginElement-&gt;renderer()).widget();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PluginDocument::setPluginElement(PassRefPtr&lt;HTMLPlugInElement&gt; element)
</del><ins>+void PluginDocument::setPluginElement(HTMLPlugInElement&amp; element)
</ins><span class="cx"> {
</span><del>-    m_pluginElement = element;
</del><ins>+    m_pluginElement = &amp;element;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PluginDocument::detachFromPluginElement()
</span><span class="lines">@@ -179,9 +179,10 @@
</span><span class="cx">     if (!shouldLoadPluginManually())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    DocumentLoader* documentLoader = frame()-&gt;loader().activeDocumentLoader();
-    documentLoader-&gt;cancelMainResourceLoad(frame()-&gt;loader().cancelledError(documentLoader-&gt;request()));
-    setShouldLoadPluginManually(false);
</del><ins>+    auto&amp; frameLoader = frame()-&gt;loader();
+    auto&amp; documentLoader = *frameLoader.activeDocumentLoader();
+    documentLoader.cancelMainResourceLoad(frameLoader.cancelledError(documentLoader.request()));
+    m_shouldLoadPluginManually = false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlPluginDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/PluginDocument.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/PluginDocument.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/PluginDocument.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2008, 2009, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -38,26 +38,23 @@
</span><span class="cx">         return adoptRef(*new PluginDocument(frame, url));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void setPluginElement(PassRefPtr&lt;HTMLPlugInElement&gt;);
-
</del><span class="cx">     WEBCORE_EXPORT Widget* pluginWidget();
</span><span class="cx">     HTMLPlugInElement* pluginElement() { return m_pluginElement.get(); }
</span><span class="cx"> 
</span><ins>+    void setPluginElement(HTMLPlugInElement&amp;);
</ins><span class="cx">     void detachFromPluginElement();
</span><span class="cx"> 
</span><span class="cx">     void cancelManualPluginLoad();
</span><span class="cx"> 
</span><del>-    bool shouldLoadPluginManually() { return m_shouldLoadPluginManually; }
</del><ins>+    bool shouldLoadPluginManually() const { return m_shouldLoadPluginManually; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     PluginDocument(Frame*, const URL&amp;);
</span><span class="cx"> 
</span><del>-    Ref&lt;DocumentParser&gt; createParser() override;
</del><ins>+    Ref&lt;DocumentParser&gt; createParser() final;
</ins><span class="cx"> 
</span><del>-    void setShouldLoadPluginManually(bool loadManually) { m_shouldLoadPluginManually = loadManually; }
-
-    bool m_shouldLoadPluginManually;
</del><span class="cx">     RefPtr&lt;HTMLPlugInElement&gt; m_pluginElement;
</span><ins>+    bool m_shouldLoadPluginManually { true };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  * Copyright (C) 2007 Alp Toker &lt;alp@atoker.com&gt;
</span><span class="cx">  * Copyright (C) 2008 Eric Seidel &lt;eric@webkit.org&gt;
</span><span class="lines">@@ -172,7 +172,7 @@
</span><span class="cx"> #if USE(IOSURFACE_CANVAS_BACKING_STORE) || ENABLE(ACCELERATED_2D_CANVAS)
</span><span class="cx">     if (!canvas().hasCreatedImageBuffer())
</span><span class="cx">         return false;
</span><del>-    GraphicsContext* context = drawingContext();
</del><ins>+    auto* context = drawingContext();
</ins><span class="cx">     return context &amp;&amp; context-&gt;isAcceleratedContext();
</span><span class="cx"> #else
</span><span class="cx">     return false;
</span><span class="lines">@@ -417,7 +417,7 @@
</span><span class="cx">     GraphicsContext* c = drawingContext();
</span><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><del>-    state.strokeStyle.applyStrokeColor(c);
</del><ins>+    state.strokeStyle.applyStrokeColor(*c);
</ins><span class="cx">     state.unparsedStrokeColor = String();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx">     GraphicsContext* c = drawingContext();
</span><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><del>-    state.fillStyle.applyFillColor(c);
</del><ins>+    state.fillStyle.applyFillColor(*c);
</ins><span class="cx">     state.unparsedFillColor = String();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -930,13 +930,13 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline void CanvasRenderingContext2D::clearPathForDashboardBackwardCompatibilityMode()
+{
</ins><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><del>-void CanvasRenderingContext2D::clearPathForDashboardBackwardCompatibilityMode()
-{
</del><span class="cx">     if (m_usesDashboardCompatibilityMode)
</span><span class="cx">         m_path.clear();
</span><ins>+#endif
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> static bool isFullCanvasCompositeMode(CompositeOperator op)
</span><span class="cx"> {
</span><span class="lines">@@ -954,28 +954,19 @@
</span><span class="cx"> void CanvasRenderingContext2D::fill(WindingRule windingRule)
</span><span class="cx"> {
</span><span class="cx">     fillInternal(m_path, windingRule);
</span><del>-
-#if ENABLE(DASHBOARD_SUPPORT)
</del><span class="cx">     clearPathForDashboardBackwardCompatibilityMode();
</span><del>-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::stroke()
</span><span class="cx"> {
</span><span class="cx">     strokeInternal(m_path);
</span><del>-
-#if ENABLE(DASHBOARD_SUPPORT)
</del><span class="cx">     clearPathForDashboardBackwardCompatibilityMode();
</span><del>-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::clip(WindingRule windingRule)
</span><span class="cx"> {
</span><span class="cx">     clipInternal(m_path, windingRule);
</span><del>-
-#if ENABLE(DASHBOARD_SUPPORT)
</del><span class="cx">     clearPathForDashboardBackwardCompatibilityMode();
</span><del>-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::fill(DOMPath&amp; path, WindingRule windingRule)
</span><span class="lines">@@ -995,7 +986,7 @@
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::fillInternal(const Path&amp; path, WindingRule windingRule)
</span><span class="cx"> {
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><span class="cx">     if (!state().hasInvertibleTransform)
</span><span class="lines">@@ -1002,12 +993,12 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // If gradient size is zero, then paint nothing.
</span><del>-    Gradient* gradient = c-&gt;fillGradient();
</del><ins>+    auto* gradient = c-&gt;fillGradient();
</ins><span class="cx">     if (gradient &amp;&amp; gradient-&gt;isZeroSize())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (!path.isEmpty()) {
</span><del>-        WindRule windRule = c-&gt;fillRule();
</del><ins>+        auto savedFillRule = c-&gt;fillRule();
</ins><span class="cx">         c-&gt;setFillRule(toWindRule(windingRule));
</span><span class="cx"> 
</span><span class="cx">         if (isFullCanvasCompositeMode(state().globalComposite)) {
</span><span class="lines">@@ -1024,13 +1015,13 @@
</span><span class="cx">             didDraw(path.fastBoundingRect());
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        c-&gt;setFillRule(windRule);
</del><ins>+        c-&gt;setFillRule(savedFillRule);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::strokeInternal(const Path&amp; path)
</span><span class="cx"> {
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><span class="cx">     if (!state().hasInvertibleTransform)
</span><span class="lines">@@ -1037,7 +1028,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // If gradient size is zero, then paint nothing.
</span><del>-    Gradient* gradient = c-&gt;strokeGradient();
</del><ins>+    auto* gradient = c-&gt;strokeGradient();
</ins><span class="cx">     if (gradient &amp;&amp; gradient-&gt;isZeroSize())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1062,7 +1053,7 @@
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::clipInternal(const Path&amp; path, WindingRule windingRule)
</span><span class="cx"> {
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><span class="cx">     if (!state().hasInvertibleTransform)
</span><span class="lines">@@ -1108,13 +1099,13 @@
</span><span class="cx"> 
</span><span class="cx"> bool CanvasRenderingContext2D::isPointInPathInternal(const Path&amp; path, float x, float y, WindingRule windingRule)
</span><span class="cx"> {
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return false;
</span><span class="cx">     if (!state().hasInvertibleTransform)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    FloatPoint transformedPoint = state().transform.inverse().value_or(AffineTransform()).mapPoint(FloatPoint(x, y));
</del><ins>+    auto transformedPoint = state().transform.inverse().value_or(AffineTransform()).mapPoint(FloatPoint(x, y));
</ins><span class="cx"> 
</span><span class="cx">     if (!std::isfinite(transformedPoint.x()) || !std::isfinite(transformedPoint.y()))
</span><span class="cx">         return false;
</span><span class="lines">@@ -1124,13 +1115,13 @@
</span><span class="cx"> 
</span><span class="cx"> bool CanvasRenderingContext2D::isPointInStrokeInternal(const Path&amp; path, float x, float y)
</span><span class="cx"> {
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return false;
</span><span class="cx">     if (!state().hasInvertibleTransform)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    FloatPoint transformedPoint = state().transform.inverse().value_or(AffineTransform()).mapPoint(FloatPoint(x, y));
</del><ins>+    auto transformedPoint = state().transform.inverse().value_or(AffineTransform()).mapPoint(FloatPoint(x, y));
</ins><span class="cx">     if (!std::isfinite(transformedPoint.x()) || !std::isfinite(transformedPoint.y()))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -1142,7 +1133,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!validateRectForCanvas(x, y, width, height))
</span><span class="cx">         return;
</span><del>-    GraphicsContext* context = drawingContext();
</del><ins>+    auto* context = drawingContext();
</ins><span class="cx">     if (!context)
</span><span class="cx">         return;
</span><span class="cx">     if (!state().hasInvertibleTransform)
</span><span class="lines">@@ -1180,7 +1171,7 @@
</span><span class="cx">     if (!validateRectForCanvas(x, y, width, height))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><span class="cx">     if (!state().hasInvertibleTransform)
</span><span class="lines">@@ -1189,7 +1180,7 @@
</span><span class="cx">     // from the HTML5 Canvas spec:
</span><span class="cx">     // If x0 = x1 and y0 = y1, then the linear gradient must paint nothing
</span><span class="cx">     // If x0 = x1 and y0 = y1 and r0 = r1, then the radial gradient must paint nothing
</span><del>-    Gradient* gradient = c-&gt;fillGradient();
</del><ins>+    auto* gradient = c-&gt;fillGradient();
</ins><span class="cx">     if (gradient &amp;&amp; gradient-&gt;isZeroSize())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1218,7 +1209,7 @@
</span><span class="cx">     if (!validateRectForCanvas(x, y, width, height))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><span class="cx">     if (!state().hasInvertibleTransform)
</span><span class="lines">@@ -1227,7 +1218,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // If gradient size is zero, then paint nothing.
</span><del>-    Gradient* gradient = c-&gt;strokeGradient();
</del><ins>+    auto* gradient = c-&gt;strokeGradient();
</ins><span class="cx">     if (gradient &amp;&amp; gradient-&gt;isZeroSize())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1251,11 +1242,12 @@
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::setShadow(float width, float height, float blur, const String&amp; colorString, std::optional&lt;float&gt; alpha)
</span><span class="cx"> {
</span><del>-    Color color = parseColorOrCurrentColor(colorString, &amp;canvas());
-    if (!colorString.isNull() &amp;&amp; !color.isValid())
-        return;
-    if (!color.isValid())
-        color = Color::transparent;
</del><ins>+    Color color = Color::transparent;
+    if (!colorString.isNull()) {
+        color = parseColorOrCurrentColor(colorString, &amp;canvas());
+        if (!color.isValid())
+            return;
+    }
</ins><span class="cx">     // FIXME: Should not use RGBA32 here.
</span><span class="cx">     setShadow(FloatSize(width, height), blur, colorWithOverrideAlpha(color.rgb(), alpha));
</span><span class="cx"> }
</span><span class="lines">@@ -1296,7 +1288,7 @@
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::applyShadow()
</span><span class="cx"> {
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1313,35 +1305,33 @@
</span><span class="cx">     return state().shadowColor.isVisible() &amp;&amp; (state().shadowBlur || !state().shadowOffset.isZero());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-enum ImageSizeType {
-    ImageSizeAfterDevicePixelRatio,
-    ImageSizeBeforeDevicePixelRatio
-};
-
-static LayoutSize size(HTMLImageElement&amp; imageElement, ImageSizeType sizeType = ImageSizeBeforeDevicePixelRatio)
</del><ins>+enum class ImageSizeType { AfterDevicePixelRatio, BeforeDevicePixelRatio };
+static LayoutSize size(HTMLImageElement&amp; element, ImageSizeType sizeType = ImageSizeType::BeforeDevicePixelRatio)
</ins><span class="cx"> {
</span><span class="cx">     LayoutSize size;
</span><del>-    if (CachedImage* cachedImage = imageElement.cachedImage()) {
-        size = cachedImage-&gt;imageSizeForRenderer(imageElement.renderer(), 1.0f); // FIXME: Not sure about this.
-
-        if (sizeType == ImageSizeAfterDevicePixelRatio &amp;&amp; is&lt;RenderImage&gt;(imageElement.renderer()) &amp;&amp; cachedImage-&gt;image() &amp;&amp; !cachedImage-&gt;image()-&gt;hasRelativeWidth())
-            size.scale(downcast&lt;RenderImage&gt;(*imageElement.renderer()).imageDevicePixelRatio());
</del><ins>+    if (auto* cachedImage = element.cachedImage()) {
+        size = cachedImage-&gt;imageSizeForRenderer(element.renderer(), 1.0f); // FIXME: Not sure about this.
+        if (sizeType == ImageSizeType::AfterDevicePixelRatio &amp;&amp; is&lt;RenderImage&gt;(element.renderer()) &amp;&amp; cachedImage-&gt;image() &amp;&amp; !cachedImage-&gt;image()-&gt;hasRelativeWidth())
+            size.scale(downcast&lt;RenderImage&gt;(*element.renderer()).imageDevicePixelRatio());
</ins><span class="cx">     }
</span><span class="cx">     return size;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static FloatSize size(HTMLCanvasElement&amp; canvasElement)
</del><ins>+static inline FloatSize size(HTMLCanvasElement&amp; canvasElement)
</ins><span class="cx"> {
</span><del>-    return FloatSize(canvasElement.size());
</del><ins>+    return canvasElement.size();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO)
</span><del>-static FloatSize size(HTMLVideoElement&amp; video)
</del><ins>+
+static inline FloatSize size(HTMLVideoElement&amp; video)
</ins><span class="cx"> {
</span><del>-    if (MediaPlayer* player = video.player())
-        return player-&gt;naturalSize();
-    return FloatSize();
</del><ins>+    auto* player = video.player();
+    if (!player)
+        return { };
+    return player-&gt;naturalSize();
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> static inline FloatRect normalizeRect(const FloatRect&amp; rect)
</span><span class="lines">@@ -1356,8 +1346,8 @@
</span><span class="cx"> {
</span><span class="cx">     return WTF::switchOn(image,
</span><span class="cx">         [&amp;] (RefPtr&lt;HTMLImageElement&gt;&amp; imageElement) -&gt; ExceptionOr&lt;void&gt; {
</span><del>-            LayoutSize destRectSize = size(*imageElement, ImageSizeAfterDevicePixelRatio);
-            LayoutSize sourceRectSize = size(*imageElement, ImageSizeBeforeDevicePixelRatio);
</del><ins>+            LayoutSize destRectSize = size(*imageElement, ImageSizeType::AfterDevicePixelRatio);
+            LayoutSize sourceRectSize = size(*imageElement, ImageSizeType::BeforeDevicePixelRatio);
</ins><span class="cx">             return this-&gt;drawImage(*imageElement, FloatRect { 0, 0, sourceRectSize.width(), sourceRectSize.height() }, FloatRect { dx, dy, destRectSize.width(), destRectSize.height() });
</span><span class="cx">         },
</span><span class="cx">         [&amp;] (auto&amp; element) -&gt; ExceptionOr&lt;void&gt; {
</span><span class="lines">@@ -1406,7 +1396,7 @@
</span><span class="cx">     FloatRect normalizedSrcRect = normalizeRect(srcRect);
</span><span class="cx">     FloatRect normalizedDstRect = normalizeRect(dstRect);
</span><span class="cx"> 
</span><del>-    FloatRect imageRect = FloatRect(FloatPoint(), size(imageElement, ImageSizeBeforeDevicePixelRatio));
</del><ins>+    FloatRect imageRect = FloatRect(FloatPoint(), size(imageElement, ImageSizeType::BeforeDevicePixelRatio));
</ins><span class="cx">     if (!srcRect.width() || !srcRect.height())
</span><span class="cx">         return Exception { INDEX_SIZE_ERR };
</span><span class="cx"> 
</span><span class="lines">@@ -1574,7 +1564,7 @@
</span><span class="cx"> void CanvasRenderingContext2D::drawImageFromRect(HTMLImageElement&amp; imageElement, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, const String&amp; compositeOperation)
</span><span class="cx"> {
</span><span class="cx">     CompositeOperator op;
</span><del>-    BlendMode blendOp = BlendModeNormal;
</del><ins>+    auto blendOp = BlendModeNormal;
</ins><span class="cx">     if (!parseCompositeAndBlendOperator(compositeOperation, op, blendOp) || blendOp != BlendModeNormal)
</span><span class="cx">         op = CompositeSourceOver;
</span><span class="cx">     drawImage(imageElement, FloatRect { sx, sy, sw, sh }, FloatRect { dx, dy, dw, dh }, op, BlendModeNormal);
</span><span class="lines">@@ -1592,14 +1582,13 @@
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::clearCanvas()
</span><span class="cx"> {
</span><del>-    FloatRect canvasRect(0, 0, canvas().width(), canvas().height());
-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     c-&gt;save();
</span><span class="cx">     c-&gt;setCTM(canvas().baseTransform());
</span><del>-    c-&gt;clearRect(canvasRect);
</del><ins>+    c-&gt;clearRect(FloatRect(0, 0, canvas().width(), canvas().height()));
</ins><span class="cx">     c-&gt;restore();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1648,7 +1637,7 @@
</span><span class="cx">     IntRect canvasRect(0, 0, canvas().width(), canvas().height());
</span><span class="cx">     canvasRect = canvas().baseTransform().mapRect(canvasRect);
</span><span class="cx"> 
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1679,17 +1668,17 @@
</span><span class="cx">     ASSERT(isFullCanvasCompositeMode(op));
</span><span class="cx"> 
</span><span class="cx">     IntSize croppedOffset;
</span><del>-    IntRect bufferRect = calculateCompositingBufferRect(dest, &amp;croppedOffset);
</del><ins>+    auto bufferRect = calculateCompositingBufferRect(dest, &amp;croppedOffset);
</ins><span class="cx">     if (bufferRect.isEmpty()) {
</span><span class="cx">         clearCanvas();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;ImageBuffer&gt; buffer = createCompositingBuffer(bufferRect);
</del><ins>+    auto buffer = createCompositingBuffer(bufferRect);
</ins><span class="cx">     if (!buffer)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1720,7 +1709,7 @@
</span><span class="cx">     if (!std::isfinite(x0) || !std::isfinite(y0) || !std::isfinite(x1) || !std::isfinite(y1))
</span><span class="cx">         return Exception { NOT_SUPPORTED_ERR };
</span><span class="cx"> 
</span><del>-    Ref&lt;CanvasGradient&gt; gradient = CanvasGradient::create(FloatPoint(x0, y0), FloatPoint(x1, y1));
</del><ins>+    auto gradient = CanvasGradient::create(FloatPoint(x0, y0), FloatPoint(x1, y1));
</ins><span class="cx">     prepareGradientForDashboard(gradient.get());
</span><span class="cx">     return WTFMove(gradient);
</span><span class="cx"> }
</span><span class="lines">@@ -1733,7 +1722,7 @@
</span><span class="cx">     if (r0 &lt; 0 || r1 &lt; 0)
</span><span class="cx">         return Exception { INDEX_SIZE_ERR };
</span><span class="cx"> 
</span><del>-    Ref&lt;CanvasGradient&gt; gradient = CanvasGradient::create(FloatPoint(x0, y0), r0, FloatPoint(x1, y1), r1);
</del><ins>+    auto gradient = CanvasGradient::create(FloatPoint(x0, y0), r0, FloatPoint(x1, y1), r1);
</ins><span class="cx">     prepareGradientForDashboard(gradient.get());
</span><span class="cx">     return WTFMove(gradient);
</span><span class="cx"> }
</span><span class="lines">@@ -1745,7 +1734,7 @@
</span><span class="cx">         return Exception { SYNTAX_ERR };
</span><span class="cx"> 
</span><span class="cx">     return WTF::switchOn(image,
</span><del>-        [&amp;](auto&amp; element) -&gt; ExceptionOr&lt;RefPtr&lt;CanvasPattern&gt;&gt; { return this-&gt;createPattern(*element, repeatX, repeatY); }
</del><ins>+        [&amp;] (auto&amp; element) -&gt; ExceptionOr&lt;RefPtr&lt;CanvasPattern&gt;&gt; { return this-&gt;createPattern(*element, repeatX, repeatY); }
</ins><span class="cx">     );
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1812,7 +1801,7 @@
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::didDraw(const FloatRect&amp; r, unsigned options)
</span><span class="cx"> {
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><span class="cx">     if (!state().hasInvertibleTransform)
</span><span class="lines">@@ -1866,19 +1855,17 @@
</span><span class="cx"> 
</span><span class="cx"> String CanvasRenderingContext2D::displayListAsText(DisplayList::AsTextFlags flags) const
</span><span class="cx"> {
</span><del>-    if (m_recordingContext)
-        return m_recordingContext-&gt;displayList.asText(flags);
-    
-    return String();
</del><ins>+    if (!m_recordingContext)
+        return { };
+    return m_recordingContext-&gt;displayList.asText(flags);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String CanvasRenderingContext2D::replayDisplayListAsText(DisplayList::AsTextFlags flags) const
</span><span class="cx"> {
</span><del>-    auto it = contextDisplayListMap().find(this);
-    if (it != contextDisplayListMap().end())
-        return it-&gt;value-&gt;asText(flags);
-
-    return String();
</del><ins>+    auto* displayList = contextDisplayListMap().get(this);
+    if (!displayList)
+        return { };
+    return displayList-&gt;asText(flags);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::paintRenderingResultsToCanvas()
</span><span class="lines">@@ -1886,7 +1873,7 @@
</span><span class="cx">     if (UNLIKELY(m_usesDisplayListDrawing)) {
</span><span class="cx">         if (!m_recordingContext)
</span><span class="cx">             return;
</span><del>-        
</del><ins>+
</ins><span class="cx">         FloatRect clip(FloatPoint::zero(), canvas().size());
</span><span class="cx">         DisplayList::Replayer replayer(*canvas().drawingContext(), m_recordingContext-&gt;displayList);
</span><span class="cx"> 
</span><span class="lines">@@ -1905,7 +1892,6 @@
</span><span class="cx">     if (UNLIKELY(m_usesDisplayListDrawing)) {
</span><span class="cx">         if (!m_recordingContext)
</span><span class="cx">             m_recordingContext = std::make_unique&lt;DisplayListDrawingContext&gt;(FloatRect(FloatPoint::zero(), canvas().size()));
</span><del>-
</del><span class="cx">         return &amp;m_recordingContext-&gt;context;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1914,12 +1900,10 @@
</span><span class="cx"> 
</span><span class="cx"> static RefPtr&lt;ImageData&gt; createEmptyImageData(const IntSize&amp; size)
</span><span class="cx"> {
</span><del>-    if (RefPtr&lt;ImageData&gt; data = ImageData::create(size)) {
</del><ins>+    auto data = ImageData::create(size);
+    if (data)
</ins><span class="cx">         data-&gt;data()-&gt;zeroFill();
</span><del>-        return data;
-    }
-
-    return nullptr;
</del><ins>+    return data;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;RefPtr&lt;ImageData&gt;&gt; CanvasRenderingContext2D::createImageData(ImageData* imageData) const
</span><span class="lines">@@ -2038,11 +2022,9 @@
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::drawFocusIfNeededInternal(const Path&amp; path, Element&amp; element)
</span><span class="cx"> {
</span><del>-    GraphicsContext* context = drawingContext();
-
</del><ins>+    auto* context = drawingContext();
</ins><span class="cx">     if (!element.focused() || !state().hasInvertibleTransform || path.isEmpty() || !element.isDescendantOf(canvas()) || !context)
</span><span class="cx">         return;
</span><del>-
</del><span class="cx">     context-&gt;drawFocusRing(path, 1, 1, RenderTheme::focusRingColor());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2270,7 +2252,6 @@
</span><span class="cx"> static void normalizeSpaces(String&amp; text)
</span><span class="cx"> {
</span><span class="cx">     size_t i = text.find(isSpaceThatNeedsReplacing);
</span><del>-
</del><span class="cx">     if (i == notFound)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -2301,10 +2282,10 @@
</span><span class="cx"> 
</span><span class="cx"> void CanvasRenderingContext2D::drawTextInternal(const String&amp; text, float x, float y, bool fill, std::optional&lt;float&gt; maxWidth)
</span><span class="cx"> {
</span><del>-    const auto&amp; fontProxy = this-&gt;fontProxy();
-    const FontMetrics&amp; fontMetrics = fontProxy.fontMetrics();
</del><ins>+    auto&amp; fontProxy = this-&gt;fontProxy();
+    const auto&amp; fontMetrics = fontProxy.fontMetrics();
</ins><span class="cx"> 
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (!c)
</span><span class="cx">         return;
</span><span class="cx">     if (!state().hasInvertibleTransform)
</span><span class="lines">@@ -2315,7 +2296,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // If gradient size is zero, then paint nothing.
</span><del>-    Gradient* gradient = c-&gt;strokeGradient();
</del><ins>+    auto* gradient = c-&gt;strokeGradient();
</ins><span class="cx">     if (!fill &amp;&amp; gradient &amp;&amp; gradient-&gt;isZeroSize())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -2329,7 +2310,7 @@
</span><span class="cx">     // FIXME: Need to turn off font smoothing.
</span><span class="cx"> 
</span><span class="cx">     const RenderStyle* computedStyle;
</span><del>-    TextDirection direction = toTextDirection(state().direction, &amp;computedStyle);
</del><ins>+    auto direction = toTextDirection(state().direction, &amp;computedStyle);
</ins><span class="cx">     bool isRTL = direction == RTL;
</span><span class="cx">     bool override = computedStyle ? isOverride(computedStyle-&gt;unicodeBidi()) : false;
</span><span class="cx"> 
</span><span class="lines">@@ -2359,7 +2340,7 @@
</span><span class="cx">     bool useMaxWidth = maxWidth &amp;&amp; maxWidth.value() &lt; fontWidth;
</span><span class="cx">     float width = useMaxWidth ? maxWidth.value() : fontWidth;
</span><span class="cx"> 
</span><del>-    TextAlign align = state().textAlign;
</del><ins>+    auto align = state().textAlign;
</ins><span class="cx">     if (align == StartTextAlign)
</span><span class="cx">         align = isRTL ? RightTextAlign : LeftTextAlign;
</span><span class="cx">     else if (align == EndTextAlign)
</span><span class="lines">@@ -2385,7 +2366,6 @@
</span><span class="cx"> #if USE(CG)
</span><span class="cx">     const CanvasStyle&amp; drawStyle = fill ? state().fillStyle : state().strokeStyle;
</span><span class="cx">     if (drawStyle.canvasGradient() || drawStyle.canvasPattern()) {
</span><del>-
</del><span class="cx">         IntRect maskRect = enclosingIntRect(textRect);
</span><span class="cx"> 
</span><span class="cx">         // If we have a shadow, we need to draw it before the mask operation.
</span><span class="lines">@@ -2394,7 +2374,7 @@
</span><span class="cx">         if (shouldDrawShadows()) {
</span><span class="cx">             GraphicsContextStateSaver stateSaver(*c);
</span><span class="cx"> 
</span><del>-            FloatSize offset = FloatSize(0, 2 * maskRect.height());
</del><ins>+            FloatSize offset(0, 2 * maskRect.height());
</ins><span class="cx"> 
</span><span class="cx">             FloatSize shadowOffset;
</span><span class="cx">             float shadowRadius;
</span><span class="lines">@@ -2422,7 +2402,7 @@
</span><span class="cx">         if (!maskImage)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        GraphicsContext&amp; maskImageContext = maskImage-&gt;context();
</del><ins>+        auto&amp; maskImageContext = maskImage-&gt;context();
</ins><span class="cx"> 
</span><span class="cx">         if (fill)
</span><span class="cx">             maskImageContext.setFillColor(Color::black);
</span><span class="lines">@@ -2445,7 +2425,7 @@
</span><span class="cx"> 
</span><span class="cx">         GraphicsContextStateSaver stateSaver(*c);
</span><span class="cx">         c-&gt;clipToImageBuffer(*maskImage, maskRect);
</span><del>-        drawStyle.applyFillColor(c);
</del><ins>+        drawStyle.applyFillColor(*c);
</ins><span class="cx">         c-&gt;fillRect(maskRect);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -2487,7 +2467,6 @@
</span><span class="cx">         delta *= state().miterLimit;
</span><span class="cx">     else if (state().lineCap == SquareCap)
</span><span class="cx">         delta *= root2;
</span><del>-
</del><span class="cx">     rect.inflate(delta);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2494,7 +2473,6 @@
</span><span class="cx"> auto CanvasRenderingContext2D::fontProxy() -&gt; const FontProxy&amp;
</span><span class="cx"> {
</span><span class="cx">     canvas().document().updateStyleIfNeeded();
</span><del>-
</del><span class="cx">     if (!state().font.realized())
</span><span class="cx">         setFont(state().unparsedFont);
</span><span class="cx">     return state().font;
</span><span class="lines">@@ -2501,13 +2479,15 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ACCELERATED_2D_CANVAS)
</span><ins>+
</ins><span class="cx"> PlatformLayer* CanvasRenderingContext2D::platformLayer() const
</span><span class="cx"> {
</span><del>-    return canvas().buffer() ? canvas().buffer()-&gt;platformLayer() : 0;
</del><ins>+    return canvas().buffer() ? canvas().buffer()-&gt;platformLayer() : nullptr;
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-static InterpolationQuality smoothingToInterpolationQuality(CanvasRenderingContext2D::ImageSmoothingQuality quality)
</del><ins>+static inline InterpolationQuality smoothingToInterpolationQuality(CanvasRenderingContext2D::ImageSmoothingQuality quality)
</ins><span class="cx"> {
</span><span class="cx">     switch (quality) {
</span><span class="cx">     case CanvasRenderingContext2D::ImageSmoothingQuality::Low:
</span><span class="lines">@@ -2554,7 +2534,7 @@
</span><span class="cx"> 
</span><span class="cx">     realizeSaves();
</span><span class="cx">     modifiableState().imageSmoothingEnabled = enabled;
</span><del>-    GraphicsContext* c = drawingContext();
</del><ins>+    auto* c = drawingContext();
</ins><span class="cx">     if (c)
</span><span class="cx">         c-&gt;setImageInterpolationQuality(enabled ? smoothingToInterpolationQuality(state().imageSmoothingQuality) : InterpolationNone);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasRenderingContext2Dh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -340,9 +340,7 @@
</span><span class="cx">     // Therefore, all font operations must pass through the State.
</span><span class="cx">     const FontProxy&amp; fontProxy();
</span><span class="cx"> 
</span><del>-#if ENABLE(DASHBOARD_SUPPORT)
</del><span class="cx">     void clearPathForDashboardBackwardCompatibilityMode();
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx">     void beginCompositeLayer();
</span><span class="cx">     void endCompositeLayer();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasStyle.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasStyle.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/CanvasStyle.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2008, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  * Copyright (C) 2007 Alp Toker &lt;alp@atoker.com&gt;
</span><span class="cx">  * Copyright (C) 2008 Eric Seidel &lt;eric@webkit.org&gt;
</span><span class="lines">@@ -53,7 +53,6 @@
</span><span class="cx">     Color color = CSSParser::parseColor(colorString);
</span><span class="cx">     if (color.isValid())
</span><span class="cx">         return color;
</span><del>-
</del><span class="cx">     return CSSParser::parseSystemColor(colorString, document);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -76,208 +75,150 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CanvasStyle::CanvasStyle(Color color)
</span><del>-    : m_color(color)
-    , m_type(RGBA)
</del><ins>+    : m_style(color)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CanvasStyle::CanvasStyle(float grayLevel, float alpha)
</span><del>-    : m_color(Color(grayLevel, grayLevel, grayLevel, alpha))
-    , m_type(RGBA)
</del><ins>+    : m_style(Color { grayLevel, grayLevel, grayLevel, alpha })
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CanvasStyle::CanvasStyle(float r, float g, float b, float a)
</span><del>-    : m_color(Color(r, g, b, a))
-    , m_type(RGBA)
</del><ins>+    : m_style(Color { r, g, b, a })
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CanvasStyle::CanvasStyle(float c, float m, float y, float k, float a)
</span><del>-    : m_cmyka(new CMYKAValues(Color(c, m, y, k, a), c, m, y, k, a))
-    , m_type(CMYKA)
</del><ins>+    : m_style(CMYKAColor { Color { c, m, y, k, a }, c, m, y, k, a })
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-CanvasStyle::CanvasStyle(PassRefPtr&lt;CanvasGradient&gt; gradient)
-    : m_gradient(gradient.leakRef())
-    , m_type(Gradient)
</del><ins>+CanvasStyle::CanvasStyle(CanvasGradient&amp; gradient)
+    : m_style(makeRefPtr(gradient))
</ins><span class="cx"> {
</span><del>-    if (!m_gradient)
-        m_type = Invalid;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-CanvasStyle::CanvasStyle(PassRefPtr&lt;CanvasPattern&gt; pattern)
-    : m_pattern(pattern.leakRef())
-    , m_type(ImagePattern)
</del><ins>+CanvasStyle::CanvasStyle(CanvasPattern&amp; pattern)
+    : m_style(makeRefPtr(pattern))
</ins><span class="cx"> {
</span><del>-    if (!m_pattern)
-        m_type = Invalid;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-CanvasStyle::~CanvasStyle()
</del><ins>+inline CanvasStyle::CanvasStyle(CurrentColor color)
+    : m_style(color)
</ins><span class="cx"> {
</span><del>-    if (m_type == Gradient)
-        m_gradient-&gt;deref();
-    else if (m_type == ImagePattern)
-        m_pattern-&gt;deref();
-    else if (m_type == CMYKA)
-        delete m_cmyka;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CanvasStyle CanvasStyle::createFromString(const String&amp; colorString, Document* document)
</span><span class="cx"> {
</span><span class="cx">     if (isCurrentColorString(colorString))
</span><del>-        return CanvasStyle(ConstructCurrentColor);
</del><ins>+        return CurrentColor { std::nullopt };
</ins><span class="cx"> 
</span><span class="cx">     Color color = parseColor(colorString, document);
</span><del>-    if (color.isValid())
-        return CanvasStyle(color);
</del><ins>+    if (!color.isValid())
+        return { };
</ins><span class="cx"> 
</span><del>-    return CanvasStyle();
</del><ins>+    return color;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CanvasStyle CanvasStyle::createFromStringWithOverrideAlpha(const String&amp; colorString, float alpha)
</span><span class="cx"> {
</span><span class="cx">     if (isCurrentColorString(colorString))
</span><del>-        return CanvasStyle(CurrentColorWithOverrideAlpha, alpha);
</del><ins>+        return CurrentColor { alpha };
</ins><span class="cx"> 
</span><span class="cx">     Color color = parseColor(colorString);
</span><del>-    if (color.isValid())
-        return CanvasStyle(colorWithOverrideAlpha(color.rgb(), alpha));
</del><ins>+    if (!color.isValid())
+        return { };
</ins><span class="cx"> 
</span><del>-    return CanvasStyle();
</del><ins>+    return Color { colorWithOverrideAlpha(color.rgb(), alpha) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CanvasStyle::isEquivalentColor(const CanvasStyle&amp; other) const
</span><span class="cx"> {
</span><del>-    if (m_type != other.m_type)
-        return false;
</del><ins>+    if (WTF::holds_alternative&lt;Color&gt;(m_style) &amp;&amp; WTF::holds_alternative&lt;Color&gt;(other.m_style))
+        return WTF::get&lt;Color&gt;(m_style) == WTF::get&lt;Color&gt;(other.m_style);
</ins><span class="cx"> 
</span><del>-    switch (m_type) {
-    case RGBA:
-        return m_color == other.m_color;
-    case CMYKA:
-        return m_cmyka-&gt;c == other.m_cmyka-&gt;c
-            &amp;&amp; m_cmyka-&gt;m == other.m_cmyka-&gt;m
-            &amp;&amp; m_cmyka-&gt;y == other.m_cmyka-&gt;y
-            &amp;&amp; m_cmyka-&gt;k == other.m_cmyka-&gt;k
-            &amp;&amp; m_cmyka-&gt;a == other.m_cmyka-&gt;a;
-    case Gradient:
-    case ImagePattern:
-    case CurrentColor:
-    case CurrentColorWithOverrideAlpha:
-        return false;
-    case Invalid:
-        break;
</del><ins>+    if (WTF::holds_alternative&lt;CMYKAColor&gt;(m_style) &amp;&amp; WTF::holds_alternative&lt;CMYKAColor&gt;(other.m_style)) {
+        auto&amp; a = WTF::get&lt;CMYKAColor&gt;(m_style);
+        auto&amp; b = WTF::get&lt;CMYKAColor&gt;(other.m_style);
+        return a.c == b.c &amp;&amp; a.m == b.m &amp;&amp; a.y == b.y &amp;&amp; a.k == b.k &amp;&amp; a.a == b.a;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ASSERT_NOT_REACHED();
</del><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CanvasStyle::isEquivalentRGBA(float r, float g, float b, float a) const
</span><span class="cx"> {
</span><del>-    if (m_type != RGBA)
-        return false;
-
-    return m_color == Color(r, g, b, a);
</del><ins>+    return WTF::holds_alternative&lt;Color&gt;(m_style) &amp;&amp; WTF::get&lt;Color&gt;(m_style) == Color { r, g, b, a };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CanvasStyle::isEquivalentCMYKA(float c, float m, float y, float k, float a) const
</span><span class="cx"> {
</span><del>-    if (m_type != CMYKA)
</del><ins>+    if (!WTF::holds_alternative&lt;CMYKAColor&gt;(m_style))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    return c == m_cmyka-&gt;c
-        &amp;&amp; m == m_cmyka-&gt;m
-        &amp;&amp; y == m_cmyka-&gt;y
-        &amp;&amp; k == m_cmyka-&gt;k
-        &amp;&amp; a == m_cmyka-&gt;a;
</del><ins>+    auto&amp; channels = WTF::get&lt;CMYKAColor&gt;(m_style);
+    return c == channels.c &amp;&amp; m == channels.m &amp;&amp; y == channels.y &amp;&amp; k == channels.k &amp;&amp; a == channels.a;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-CanvasStyle::CanvasStyle(const CanvasStyle&amp; other)
</del><ins>+void CanvasStyle::applyStrokeColor(GraphicsContext&amp; context) const
</ins><span class="cx"> {
</span><del>-    memcpy(this, &amp;other, sizeof(CanvasStyle));
-    if (m_type == Gradient)
-        m_gradient-&gt;ref();
-    else if (m_type == ImagePattern)
-        m_pattern-&gt;ref();
-    else if (m_type == CMYKA)
-        m_cmyka = new CMYKAValues(other.m_cmyka-&gt;color, other.m_cmyka-&gt;c, other.m_cmyka-&gt;m, other.m_cmyka-&gt;y, other.m_cmyka-&gt;k, other.m_cmyka-&gt;a);
-}
-
-CanvasStyle&amp; CanvasStyle::operator=(const CanvasStyle&amp; other)
-{
-    if (this != &amp;other) {
-        this-&gt;~CanvasStyle();
-        new (this) CanvasStyle(other);
-    }
-    return *this;
-}
-
-void CanvasStyle::applyStrokeColor(GraphicsContext* context) const
-{
-    if (!context)
-        return;
-    switch (m_type) {
-    case RGBA:
-        context-&gt;setStrokeColor(m_color);
-        break;
-    case CMYKA: {
-        // FIXME: Do this through platform-independent GraphicsContext API.
-        // We'll need a fancier Color abstraction to support CMYKA correctly
</del><ins>+    WTF::switchOn(m_style,
+        [&amp;context] (const Color&amp; color) {
+            context.setStrokeColor(color);
+        },
+        [&amp;context] (const CMYKAColor&amp; color) {
+            // FIXME: Do this through platform-independent GraphicsContext API.
+            // We'll need a fancier Color abstraction to support CMYKA correctly
</ins><span class="cx"> #if USE(CG)
</span><del>-        CGContextSetCMYKStrokeColor(context-&gt;platformContext(), m_cmyka-&gt;c, m_cmyka-&gt;m, m_cmyka-&gt;y, m_cmyka-&gt;k, m_cmyka-&gt;a);
</del><ins>+            CGContextSetCMYKStrokeColor(context.platformContext(), color.c, color.m, color.y, color.k, color.a);
</ins><span class="cx"> #else
</span><del>-        context-&gt;setStrokeColor(m_cmyka-&gt;color);
</del><ins>+            context.setStrokeColor(color.color);
</ins><span class="cx"> #endif
</span><del>-        break;
-    }
-    case Gradient:
-        context-&gt;setStrokeGradient(canvasGradient()-&gt;gradient());
-        break;
-    case ImagePattern:
-        context-&gt;setStrokePattern(canvasPattern()-&gt;pattern());
-        break;
-    case CurrentColor:
-    case CurrentColorWithOverrideAlpha:
-    case Invalid:
-        ASSERT_NOT_REACHED();
-        break;
-    }
</del><ins>+        },
+        [&amp;context] (const RefPtr&lt;CanvasGradient&gt;&amp; gradient) {
+            context.setStrokeGradient(gradient-&gt;gradient());
+        },
+        [&amp;context] (const RefPtr&lt;CanvasPattern&gt;&amp; pattern) {
+            context.setStrokePattern(pattern-&gt;pattern());
+        },
+        [] (const CurrentColor&amp;) {
+            ASSERT_NOT_REACHED();
+        },
+        [] (const Invalid&amp;) {
+            ASSERT_NOT_REACHED();
+        }
+    );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CanvasStyle::applyFillColor(GraphicsContext* context) const
</del><ins>+void CanvasStyle::applyFillColor(GraphicsContext&amp; context) const
</ins><span class="cx"> {
</span><del>-    if (!context)
-        return;
-    switch (m_type) {
-    case RGBA:
-        context-&gt;setFillColor(m_color);
-        break;
-    case CMYKA: {
-        // FIXME: Do this through platform-independent GraphicsContext API.
-        // We'll need a fancier Color abstraction to support CMYKA correctly
</del><ins>+    WTF::switchOn(m_style,
+        [&amp;context] (const Color&amp; color) {
+            context.setFillColor(color);
+        },
+        [&amp;context] (const CMYKAColor&amp; color) {
+            // FIXME: Do this through platform-independent GraphicsContext API.
+            // We'll need a fancier Color abstraction to support CMYKA correctly
</ins><span class="cx"> #if USE(CG)
</span><del>-        CGContextSetCMYKFillColor(context-&gt;platformContext(), m_cmyka-&gt;c, m_cmyka-&gt;m, m_cmyka-&gt;y, m_cmyka-&gt;k, m_cmyka-&gt;a);
</del><ins>+            CGContextSetCMYKFillColor(context.platformContext(), color.c, color.m, color.y, color.k, color.a);
</ins><span class="cx"> #else
</span><del>-        context-&gt;setFillColor(m_cmyka-&gt;color);
</del><ins>+            context.setFillColor(color.color);
</ins><span class="cx"> #endif
</span><del>-        break;
-    }
-    case Gradient:
-        context-&gt;setFillGradient(canvasGradient()-&gt;gradient());
-        break;
-    case ImagePattern:
-        context-&gt;setFillPattern(canvasPattern()-&gt;pattern());
-        break;
-    case CurrentColor:
-    case CurrentColorWithOverrideAlpha:
-    case Invalid:
-        ASSERT_NOT_REACHED();
-        break;
-    }
</del><ins>+        },
+        [&amp;context] (const RefPtr&lt;CanvasGradient&gt;&amp; gradient) {
+            context.setFillGradient(gradient-&gt;gradient());
+        },
+        [&amp;context] (const RefPtr&lt;CanvasPattern&gt;&amp; pattern) {
+            context.setFillPattern(pattern-&gt;pattern());
+        },
+        [] (const CurrentColor&amp;) {
+            ASSERT_NOT_REACHED();
+        },
+        [] (const Invalid&amp;) {
+            ASSERT_NOT_REACHED();
+        }
+    );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasCanvasStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/CanvasStyle.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/CanvasStyle.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/CanvasStyle.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2008, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -26,135 +26,100 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include &quot;CanvasGradient.h&quot;
+#include &quot;CanvasPattern.h&quot;
</ins><span class="cx"> #include &quot;Color.h&quot;
</span><del>-#include &lt;wtf/Assertions.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
</del><ins>+#include &lt;wtf/Variant.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-    class CanvasGradient;
-    class CanvasPattern;
-    class Document;
-    class GraphicsContext;
-    class HTMLCanvasElement;
</del><ins>+class Document;
+class GraphicsContext;
+class HTMLCanvasElement;
</ins><span class="cx"> 
</span><del>-    class CanvasStyle {
-    public:
-        CanvasStyle();
-        explicit CanvasStyle(Color);
-        CanvasStyle(float grayLevel, float alpha);
-        CanvasStyle(float r, float g, float b, float alpha);
-        CanvasStyle(float c, float m, float y, float k, float alpha);
-        explicit CanvasStyle(PassRefPtr&lt;CanvasGradient&gt;);
-        explicit CanvasStyle(PassRefPtr&lt;CanvasPattern&gt;);
-        ~CanvasStyle();
</del><ins>+class CanvasStyle {
+public:
+    CanvasStyle();
+    CanvasStyle(Color);
+    CanvasStyle(float grayLevel, float alpha);
+    CanvasStyle(float r, float g, float b, float alpha);
+    CanvasStyle(float c, float m, float y, float k, float alpha);
+    CanvasStyle(CanvasGradient&amp;);
+    CanvasStyle(CanvasPattern&amp;);
</ins><span class="cx"> 
</span><del>-        static CanvasStyle createFromString(const String&amp; color, Document* = 0);
-        static CanvasStyle createFromStringWithOverrideAlpha(const String&amp; color, float alpha);
</del><ins>+    static CanvasStyle createFromString(const String&amp; color, Document* = nullptr);
+    static CanvasStyle createFromStringWithOverrideAlpha(const String&amp; color, float alpha);
</ins><span class="cx"> 
</span><del>-        bool isValid() const { return m_type != Invalid; }
-        bool isCurrentColor() const { return m_type == CurrentColor || m_type == CurrentColorWithOverrideAlpha; }
-        bool hasOverrideAlpha() const { return m_type == CurrentColorWithOverrideAlpha; }
-        float overrideAlpha() const { ASSERT(m_type == CurrentColorWithOverrideAlpha); return m_overrideAlpha; }
</del><ins>+    bool isValid() const { return !WTF::holds_alternative&lt;Invalid&gt;(m_style); }
+    bool isCurrentColor() const { return WTF::holds_alternative&lt;CurrentColor&gt;(m_style); }
+    bool hasOverrideAlpha() const { return isCurrentColor() &amp;&amp; WTF::get&lt;CurrentColor&gt;(m_style).overrideAlpha; }
+    float overrideAlpha() const { return WTF::get&lt;CurrentColor&gt;(m_style).overrideAlpha.value(); }
</ins><span class="cx"> 
</span><del>-        String color() const;
-        CanvasGradient* canvasGradient() const;
-        CanvasPattern* canvasPattern() const;
</del><ins>+    String color() const;
+    CanvasGradient* canvasGradient() const;
+    CanvasPattern* canvasPattern() const;
</ins><span class="cx"> 
</span><del>-        void applyFillColor(GraphicsContext*) const;
-        void applyStrokeColor(GraphicsContext*) const;
</del><ins>+    void applyFillColor(GraphicsContext&amp;) const;
+    void applyStrokeColor(GraphicsContext&amp;) const;
</ins><span class="cx"> 
</span><del>-        bool isEquivalentColor(const CanvasStyle&amp;) const;
-        bool isEquivalentRGBA(float r, float g, float b, float a) const;
-        bool isEquivalentCMYKA(float c, float m, float y, float k, float a) const;
</del><ins>+    bool isEquivalentColor(const CanvasStyle&amp;) const;
+    bool isEquivalentRGBA(float red, float green, float blue, float alpha) const;
+    bool isEquivalentCMYKA(float cyan, float magenta, float yellow, float black, float alpha) const;
</ins><span class="cx"> 
</span><del>-        CanvasStyle(const CanvasStyle&amp;);
-        CanvasStyle&amp; operator=(const CanvasStyle&amp;);
-        CanvasStyle(CanvasStyle&amp;&amp;);
-        CanvasStyle&amp; operator=(CanvasStyle&amp;&amp;);
</del><ins>+private:
+    struct Invalid { };
</ins><span class="cx"> 
</span><del>-    private:
-        enum Type { RGBA, CMYKA, Gradient, ImagePattern, CurrentColor, CurrentColorWithOverrideAlpha, Invalid };
-        struct CMYKAValues {
-            WTF_MAKE_FAST_ALLOCATED;
-            WTF_MAKE_NONCOPYABLE(CMYKAValues);
-        public:
-            CMYKAValues()
-                : color(), c(0), m(0), y(0), k(0), a(0)
-            { }
</del><ins>+    struct CMYKAColor {
+        CMYKAColor() = default;
</ins><span class="cx"> 
</span><del>-            CMYKAValues(Color color, float cyan, float magenta, float yellow, float black, float alpha)
-                : color(color), c(cyan), m(magenta), y(yellow), k(black), a(alpha)
-            { }
-            Color color;
-            float c;
-            float m;
-            float y;
-            float k;
-            float a;
-        };
-
-        enum ConstructCurrentColorTag { ConstructCurrentColor };
-        CanvasStyle(ConstructCurrentColorTag) : m_type(CurrentColor) { }
-        CanvasStyle(Type type, float overrideAlpha)
-            : m_overrideAlpha(overrideAlpha)
-            , m_type(type)
</del><ins>+        CMYKAColor(Color color, float cyan, float magenta, float yellow, float black, float alpha)
+            : color(color), c(cyan), m(magenta), y(yellow), k(black), a(alpha)
</ins><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        union {
-            Color m_color;
-            float m_overrideAlpha;
-            CanvasGradient* m_gradient;
-            CanvasPattern* m_pattern;
-            CMYKAValues* m_cmyka;
-        };
-        Type m_type;
</del><ins>+        Color color;
+        float c { 0 };
+        float m { 0 };
+        float y { 0 };
+        float k { 0 };
+        float a { 0 };
</ins><span class="cx">     };
</span><span class="cx"> 
</span><del>-    Color currentColor(HTMLCanvasElement*);
-    Color parseColorOrCurrentColor(const String&amp; colorString, HTMLCanvasElement*);
</del><ins>+    struct CurrentColor {
+        std::optional&lt;float&gt; overrideAlpha;
+    };
</ins><span class="cx"> 
</span><del>-    inline CanvasStyle::CanvasStyle()
-        : m_type(Invalid)
-    {
-    }
</del><ins>+    CanvasStyle(CurrentColor);
</ins><span class="cx"> 
</span><del>-    inline CanvasGradient* CanvasStyle::canvasGradient() const
-    {
-        if (m_type == Gradient)
-            return m_gradient;
-        return 0;
-    }
</del><ins>+    Variant&lt;Invalid, Color, CMYKAColor, RefPtr&lt;CanvasGradient&gt;, RefPtr&lt;CanvasPattern&gt;, CurrentColor&gt; m_style;
+};
</ins><span class="cx"> 
</span><del>-    inline CanvasPattern* CanvasStyle::canvasPattern() const
-    {
-        if (m_type == ImagePattern)
-            return m_pattern;
-        return 0;
-    }
</del><ins>+Color currentColor(HTMLCanvasElement*);
+Color parseColorOrCurrentColor(const String&amp; colorString, HTMLCanvasElement*);
</ins><span class="cx"> 
</span><del>-    inline String CanvasStyle::color() const
-    {
-        ASSERT(m_type == RGBA || m_type == CMYKA);
-        if (m_type == RGBA)
-            return m_color.serialized();
-        return m_cmyka-&gt;color.serialized();
-    }
</del><ins>+inline CanvasStyle::CanvasStyle()
+    : m_style(Invalid { })
+{
+}
</ins><span class="cx"> 
</span><del>-    inline CanvasStyle::CanvasStyle(CanvasStyle&amp;&amp; other)
-    {
-        memcpy(this, &amp;other, sizeof(CanvasStyle));
-        other.m_type = Invalid;
-    }
</del><ins>+inline CanvasGradient* CanvasStyle::canvasGradient() const
+{
+    if (!WTF::holds_alternative&lt;RefPtr&lt;CanvasGradient&gt;&gt;(m_style))
+        return nullptr;
+    return WTF::get&lt;RefPtr&lt;CanvasGradient&gt;&gt;(m_style).get();
+}
</ins><span class="cx"> 
</span><del>-    inline CanvasStyle&amp; CanvasStyle::operator=(CanvasStyle&amp;&amp; other)
-    {
-        if (this != &amp;other) {
-            memcpy(this, &amp;other, sizeof(CanvasStyle));
-            other.m_type = Invalid;
-        }
-        return *this;
-    }
</del><ins>+inline CanvasPattern* CanvasStyle::canvasPattern() const
+{
+    if (!WTF::holds_alternative&lt;RefPtr&lt;CanvasPattern&gt;&gt;(m_style))
+        return nullptr;
+    return WTF::get&lt;RefPtr&lt;CanvasPattern&gt;&gt;(m_style).get();
+}
</ins><span class="cx"> 
</span><ins>+inline String CanvasStyle::color() const
+{
+    auto&amp; color = WTF::holds_alternative&lt;Color&gt;(m_style) ? WTF::get&lt;Color&gt;(m_style) : WTF::get&lt;CMYKAColor&gt;(m_style).color;
+    return color.serialized();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasOESVertexArrayObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/OESVertexArrayObject.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -24,11 +24,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;OESVertexArrayObject.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> 
</span><del>-#include &quot;OESVertexArrayObject.h&quot;
-
</del><span class="cx"> #include &quot;Extensions3D.h&quot;
</span><span class="cx"> #include &quot;WebGLRenderingContext.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -49,8 +48,8 @@
</span><span class="cx">     if (m_context.isContextLost())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    auto object = WebGLVertexArrayObjectOES::create(m_context, WebGLVertexArrayObjectOES::VAOTypeUser);
-    m_context.addContextObject(object.ptr());
</del><ins>+    auto object = WebGLVertexArrayObjectOES::create(m_context, WebGLVertexArrayObjectOES::Type::User);
+    m_context.addContextObject(object.get());
</ins><span class="cx">     return WTFMove(object);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -58,10 +57,10 @@
</span><span class="cx"> {
</span><span class="cx">     if (!arrayObject || m_context.isContextLost())
</span><span class="cx">         return;
</span><del>-    
-    if (!arrayObject-&gt;isDefaultObject() &amp;&amp; arrayObject == static_cast&lt;WebGLRenderingContext*&gt;(&amp;m_context)-&gt;m_boundVertexArrayObject)
-        static_cast&lt;WebGLRenderingContext*&gt;(&amp;m_context)-&gt;setBoundVertexArrayObject(0);
</del><span class="cx"> 
</span><ins>+    if (!arrayObject-&gt;isDefaultObject() &amp;&amp; arrayObject == static_cast&lt;WebGLRenderingContext&amp;&gt;(m_context).m_boundVertexArrayObject)
+        static_cast&lt;WebGLRenderingContext&amp;&gt;(m_context).setBoundVertexArrayObject(nullptr);
+
</ins><span class="cx">     arrayObject-&gt;deleteObject(m_context.graphicsContext3D());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -89,7 +88,7 @@
</span><span class="cx">         context.setBoundVertexArrayObject(arrayObject);
</span><span class="cx">     } else {
</span><span class="cx">         extensions.bindVertexArrayOES(0);
</span><del>-        context.setBoundVertexArrayObject(0);
</del><ins>+        context.setBoundVertexArrayObject(nullptr);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,10 +24,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><del>-
-#if ENABLE(WEBGL) &amp;&amp; ENABLE(WEBGL2)
</del><span class="cx"> #include &quot;WebGL2RenderingContext.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBGL2)
+
</ins><span class="cx"> #include &quot;CachedImage.h&quot;
</span><span class="cx"> #include &quot;EXTTextureFilterAnisotropic.h&quot;
</span><span class="cx"> #include &quot;Extensions3D.h&quot;
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGL2RenderingContext::WebGL2RenderingContext(HTMLCanvasElement&amp; passedCanvas, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp; context, GraphicsContext3DAttributes attributes)
</del><ins>+WebGL2RenderingContext::WebGL2RenderingContext(HTMLCanvasElement&amp; passedCanvas, Ref&lt;GraphicsContext3D&gt;&amp;&amp; context, GraphicsContext3DAttributes attributes)
</ins><span class="cx">     : WebGLRenderingContextBase(passedCanvas, WTFMove(context), attributes)
</span><span class="cx"> {
</span><span class="cx">     initializeShaderExtensions();
</span><span class="lines">@@ -72,8 +72,8 @@
</span><span class="cx"> 
</span><span class="cx"> void WebGL2RenderingContext::initializeVertexArrayObjects()
</span><span class="cx"> {
</span><del>-    m_defaultVertexArrayObject = WebGLVertexArrayObject::create(*this, WebGLVertexArrayObject::VAOTypeDefault);
-    addContextObject(m_defaultVertexArrayObject.get());
</del><ins>+    m_defaultVertexArrayObject = WebGLVertexArrayObject::create(*this, WebGLVertexArrayObject::Type::Default);
+    addContextObject(*m_defaultVertexArrayObject);
</ins><span class="cx">     m_boundVertexArrayObject = m_defaultVertexArrayObject;
</span><span class="cx">     if (!isGLES2Compliant())
</span><span class="cx">         initVertexAttrib0();
</span><span class="lines">@@ -203,7 +203,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_context-&gt;moveErrorsToSyntheticErrorList();
</span><del>-#if PLATFORM(MAC) || PLATFORM(IOS)
</del><ins>+#if PLATFORM(COCOA)
</ins><span class="cx">     m_context-&gt;copyBufferSubData(readTarget, writeTarget, checkedReadOffset.unsafeGet(), checkedWriteOffset.unsafeGet(), checkedSize.unsafeGet());
</span><span class="cx"> #endif
</span><span class="cx">     if (m_context-&gt;moveErrorsToSyntheticErrorList()) {
</span><span class="lines">@@ -272,7 +272,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_context-&gt;moveErrorsToSyntheticErrorList();
</span><del>-#if PLATFORM(MAC) || PLATFORM(IOS)
</del><ins>+#if PLATFORM(COCOA)
</ins><span class="cx">     // FIXME: Coalesce multiple getBufferSubData() calls to use a single map() call
</span><span class="cx">     void* ptr = m_context-&gt;mapBufferRange(target, checkedSrcByteOffset.unsafeGet(), static_cast&lt;GC3Dsizeiptr&gt;(checkedCopyLengthPtr.unsafeGet() * checkedElementSize.unsafeGet()), GraphicsContext3D::MAP_READ_BIT);
</span><span class="cx">     memcpy(static_cast&lt;char*&gt;(dstData-&gt;baseAddress()) + dstData-&gt;byteOffset() + dstOffset * elementSize, ptr, copyLength * elementSize);
</span><span class="lines">@@ -290,16 +290,16 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGL2RenderingContext::getInternalformatParameter(GC3Denum, GC3Denum, GC3Denum)
</del><ins>+WebGLAny WebGL2RenderingContext::getInternalformatParameter(GC3Denum, GC3Denum, GC3Denum)
</ins><span class="cx"> {
</span><del>-    return WebGLGetInfo();
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::invalidateFramebuffer(GC3Denum, Vector&lt;GC3Denum&gt;)
</del><ins>+void WebGL2RenderingContext::invalidateFramebuffer(GC3Denum, const Vector&lt;GC3Denum&gt;&amp;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::invalidateSubFramebuffer(GC3Denum, Vector&lt;GC3Denum&gt;, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
</del><ins>+void WebGL2RenderingContext::invalidateSubFramebuffer(GC3Denum, const Vector&lt;GC3Denum&gt;&amp;, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -407,7 +407,7 @@
</span><span class="cx">     if (isContextLostOrPending())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    WebGLTexture* texture = validateTextureBinding(&quot;texStorage2D&quot;, target, false);
</del><ins>+    auto* texture = validateTextureBinding(&quot;texStorage2D&quot;, target, false);
</ins><span class="cx">     if (!texture)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -502,7 +502,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GC3Dint WebGL2RenderingContext::getFragDataLocation(WebGLProgram*, String)
</del><ins>+GC3Dint WebGL2RenderingContext::getFragDataLocation(WebGLProgram*, const String&amp;)
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="lines">@@ -633,7 +633,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::drawBuffers(Vector&lt;GC3Denum&gt; buffers)
</del><ins>+void WebGL2RenderingContext::drawBuffers(const Vector&lt;GC3Denum&gt;&amp; buffers)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLost())
</span><span class="cx">         return;
</span><span class="lines">@@ -782,9 +782,9 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGL2RenderingContext::getQueryParameter(WebGLQuery*, GC3Denum)
</del><ins>+WebGLAny WebGL2RenderingContext::getQueryParameter(WebGLQuery*, GC3Denum)
</ins><span class="cx"> {
</span><del>-    return WebGLGetInfo();
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebGLSampler&gt; WebGL2RenderingContext::createSampler()
</span><span class="lines">@@ -813,9 +813,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGL2RenderingContext::getSamplerParameter(WebGLSampler*, GC3Denum)
</del><ins>+WebGLAny WebGL2RenderingContext::getSamplerParameter(WebGLSampler*, GC3Denum)
</ins><span class="cx"> {
</span><del>-    return WebGLGetInfo();
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebGLSync&gt; WebGL2RenderingContext::fenceSync(GC3Denum, GC3Dbitfield)
</span><span class="lines">@@ -841,9 +841,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGL2RenderingContext::getSyncParameter(WebGLSync*, GC3Denum)
</del><ins>+WebGLAny WebGL2RenderingContext::getSyncParameter(WebGLSync*, GC3Denum)
</ins><span class="cx"> {
</span><del>-    return WebGLGetInfo();
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebGLTransformFeedback&gt; WebGL2RenderingContext::createTransformFeedback()
</span><span class="lines">@@ -872,7 +872,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGL2RenderingContext::transformFeedbackVaryings(WebGLProgram*, Vector&lt;String&gt;, GC3Denum)
</del><ins>+void WebGL2RenderingContext::transformFeedbackVaryings(WebGLProgram*, const Vector&lt;String&gt;&amp;, GC3Denum)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -897,7 +897,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGL2RenderingContext::getIndexedParameter(GC3Denum target, GC3Duint)
</del><ins>+WebGLAny WebGL2RenderingContext::getIndexedParameter(GC3Denum target, GC3Duint)
</ins><span class="cx"> {
</span><span class="cx">     switch (target) {
</span><span class="cx">     case GraphicsContext3D::TRANSFORM_FEEDBACK_BUFFER_BINDING:
</span><span class="lines">@@ -907,16 +907,14 @@
</span><span class="cx">     case GraphicsContext3D::UNIFORM_BUFFER_SIZE:
</span><span class="cx">     case GraphicsContext3D::UNIFORM_BUFFER_START:
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getIndexedParameter&quot;, &quot;parameter name not yet supported&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     default:
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getIndexedParameter&quot;, &quot;invalid parameter name&quot;);
</span><del>-        return WebGLGetInfo();
-            
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><del>-    return WebGLGetInfo();
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-Uint32Array* WebGL2RenderingContext::getUniformIndices(WebGLProgram*, Vector&lt;String&gt;)
</del><ins>+Uint32Array* WebGL2RenderingContext::getUniformIndices(WebGLProgram*, const Vector&lt;String&gt;&amp;)
</ins><span class="cx"> {
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -926,19 +924,19 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GC3Duint WebGL2RenderingContext::getUniformBlockIndex(WebGLProgram*, String)
</del><ins>+GC3Duint WebGL2RenderingContext::getUniformBlockIndex(WebGLProgram*, const String&amp;)
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGL2RenderingContext::getActiveUniformBlockParameter(WebGLProgram*, GC3Duint, GC3Denum)
</del><ins>+WebGLAny WebGL2RenderingContext::getActiveUniformBlockParameter(WebGLProgram*, GC3Duint, GC3Denum)
</ins><span class="cx"> {
</span><del>-    return WebGLGetInfo();
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGL2RenderingContext::getActiveUniformBlockName(WebGLProgram*, GC3Duint)
</del><ins>+WebGLAny WebGL2RenderingContext::getActiveUniformBlockName(WebGLProgram*, GC3Duint)
</ins><span class="cx"> {
</span><del>-    return WebGLGetInfo();
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGL2RenderingContext::uniformBlockBinding(WebGLProgram*, GC3Duint, GC3Duint)
</span><span class="lines">@@ -950,8 +948,8 @@
</span><span class="cx">     if (isContextLost())
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    auto object = WebGLVertexArrayObject::create(*this, WebGLVertexArrayObject::VAOTypeUser);
-    addContextObject(object.ptr());
</del><ins>+    auto object = WebGLVertexArrayObject::create(*this, WebGLVertexArrayObject::Type::User);
+    addContextObject(object.get());
</ins><span class="cx">     return WTFMove(object);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -964,7 +962,7 @@
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     if (!arrayObject-&gt;isDefaultObject() &amp;&amp; arrayObject == m_boundVertexArrayObject)
</span><del>-        setBoundVertexArrayObject(0);
</del><ins>+        setBoundVertexArrayObject(nullptr);
</ins><span class="cx">     
</span><span class="cx">     arrayObject-&gt;deleteObject(graphicsContext3D());
</span><span class="cx"> }
</span><span class="lines">@@ -972,10 +970,10 @@
</span><span class="cx"> GC3Dboolean WebGL2RenderingContext::isVertexArray(WebGLVertexArrayObject* arrayObject)
</span><span class="cx"> {
</span><span class="cx">     if (!arrayObject || isContextLost())
</span><del>-        return 0;
</del><ins>+        return false;
</ins><span class="cx">     
</span><span class="cx">     if (!arrayObject-&gt;hasEverBeenBound() || !arrayObject-&gt;validate(0, *this))
</span><del>-        return 0;
</del><ins>+        return false;
</ins><span class="cx">     
</span><span class="cx">     return m_context-&gt;isVertexArray(arrayObject-&gt;object());
</span><span class="cx"> }
</span><span class="lines">@@ -996,7 +994,7 @@
</span><span class="cx">         setBoundVertexArrayObject(arrayObject);
</span><span class="cx">     } else {
</span><span class="cx">         m_context-&gt;bindVertexArray(m_defaultVertexArrayObject-&gt;object());
</span><del>-        setBoundVertexArrayObject(m_defaultVertexArrayObject);
</del><ins>+        setBoundVertexArrayObject(m_defaultVertexArrayObject.get());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1005,43 +1003,38 @@
</span><span class="cx">     if (isContextLostOrPending())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if ((equalIgnoringASCIICase(name, &quot;EXT_texture_filter_anisotropic&quot;) || equalIgnoringASCIICase(name, &quot;WEBKIT_EXT_texture_filter_anisotropic&quot;))
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_EXT_texture_filter_anisotropic&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;EXT_texture_filter_anisotropic&quot;) || equalIgnoringASCIICase(name, &quot;WEBKIT_EXT_texture_filter_anisotropic&quot;)) {
</ins><span class="cx">         if (!m_extTextureFilterAnisotropic) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_EXT_texture_filter_anisotropic&quot;);
-            m_extTextureFilterAnisotropic = std::make_unique&lt;EXTTextureFilterAnisotropic&gt;(*this);
</del><ins>+            m_extTextureFilterAnisotropic = enableSupportedExtension(&quot;GL_EXT_texture_filter_anisotropic&quot;)
+                ? std::make_unique&lt;EXTTextureFilterAnisotropic&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_extTextureFilterAnisotropic.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;OES_texture_float&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_float&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;OES_texture_float&quot;)) {
</ins><span class="cx">         if (!m_oesTextureFloat) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_OES_texture_float&quot;);
-            m_oesTextureFloat = std::make_unique&lt;OESTextureFloat&gt;(*this);
</del><ins>+            m_oesTextureFloat = enableSupportedExtension(&quot;GL_OES_texture_float&quot;)
+                ? std::make_unique&lt;OESTextureFloat&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_oesTextureFloat.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;OES_texture_float_linear&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_float_linear&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;OES_texture_float_linear&quot;)) {
</ins><span class="cx">         if (!m_oesTextureFloatLinear) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_OES_texture_float_linear&quot;);
-            m_oesTextureFloatLinear = std::make_unique&lt;OESTextureFloatLinear&gt;(*this);
</del><ins>+            m_oesTextureFloatLinear = enableSupportedExtension(&quot;GL_OES_texture_float_linear&quot;)
+                ? std::make_unique&lt;OESTextureFloatLinear&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_oesTextureFloatLinear.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;OES_texture_half_float&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_half_float&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;OES_texture_half_float&quot;)) {
</ins><span class="cx">         if (!m_oesTextureHalfFloat) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_OES_texture_half_float&quot;);
-            m_oesTextureHalfFloat = std::make_unique&lt;OESTextureHalfFloat&gt;(*this);
</del><ins>+            m_oesTextureHalfFloat = enableSupportedExtension(&quot;GL_OES_texture_half_float&quot;)
+                ? std::make_unique&lt;OESTextureHalfFloat&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_oesTextureHalfFloat.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;OES_texture_half_float_linear&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_half_float_linear&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;OES_texture_half_float_linear&quot;)) {
</ins><span class="cx">         if (!m_oesTextureHalfFloatLinear) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_OES_texture_half_float_linear&quot;);
-            m_oesTextureHalfFloatLinear = std::make_unique&lt;OESTextureHalfFloatLinear&gt;(*this);
</del><ins>+            m_oesTextureHalfFloatLinear = enableSupportedExtension(&quot;GL_OES_texture_half_float_linear&quot;)
+                ? std::make_unique&lt;OESTextureHalfFloatLinear&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_oesTextureHalfFloatLinear.get();
</span><span class="cx">     }
</span><span class="lines">@@ -1050,28 +1043,32 @@
</span><span class="cx">             m_webglLoseContext = std::make_unique&lt;WebGLLoseContext&gt;(*this);
</span><span class="cx">         return m_webglLoseContext.get();
</span><span class="cx">     }
</span><del>-    if ((equalIgnoringASCIICase(name, &quot;WEBKIT_WEBGL_compressed_texture_atc&quot;))
-        &amp;&amp; WebGLCompressedTextureATC::supported(*this)) {
-        if (!m_webglCompressedTextureATC)
-            m_webglCompressedTextureATC = std::make_unique&lt;WebGLCompressedTextureATC&gt;(*this);
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;WEBKIT_WEBGL_compressed_texture_atc&quot;)) {
+        if (!m_webglCompressedTextureATC) {
+            if (WebGLCompressedTextureATC::supported(*this))
+                m_webglCompressedTextureATC = std::make_unique&lt;WebGLCompressedTextureATC&gt;(*this);
+        }
</ins><span class="cx">         return m_webglCompressedTextureATC.get();
</span><span class="cx">     }
</span><del>-    if ((equalIgnoringASCIICase(name, &quot;WEBKIT_WEBGL_compressed_texture_pvrtc&quot;))
-        &amp;&amp; WebGLCompressedTexturePVRTC::supported(*this)) {
-        if (!m_webglCompressedTexturePVRTC)
-            m_webglCompressedTexturePVRTC = std::make_unique&lt;WebGLCompressedTexturePVRTC&gt;(*this);
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;WEBKIT_WEBGL_compressed_texture_pvrtc&quot;)) {
+        if (!m_webglCompressedTexturePVRTC) {
+            m_webglCompressedTexturePVRTC = WebGLCompressedTexturePVRTC::supported(*this)
+                ? std::make_unique&lt;WebGLCompressedTexturePVRTC&gt;(*this) : nullptr;
+        }
</ins><span class="cx">         return m_webglCompressedTexturePVRTC.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;WEBGL_compressed_texture_s3tc&quot;)
-        &amp;&amp; WebGLCompressedTextureS3TC::supported(*this)) {
-        if (!m_webglCompressedTextureS3TC)
-            m_webglCompressedTextureS3TC = std::make_unique&lt;WebGLCompressedTextureS3TC&gt;(*this);
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;WEBGL_compressed_texture_s3tc&quot;)) {
+        if (!m_webglCompressedTextureS3TC) {
+            m_webglCompressedTextureS3TC = WebGLCompressedTextureS3TC::supported(*this)
+                ? std::make_unique&lt;WebGLCompressedTextureS3TC&gt;(*this) : nullptr;
+        }
</ins><span class="cx">         return m_webglCompressedTextureS3TC.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;WEBGL_depth_texture&quot;)
-        &amp;&amp; WebGLDepthTexture::supported(*graphicsContext3D())) {
-        if (!m_webglDepthTexture)
-            m_webglDepthTexture = std::make_unique&lt;WebGLDepthTexture&gt;(*this);
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;WEBGL_depth_texture&quot;)) {
+        if (!m_webglDepthTexture) {
+            m_webglDepthTexture = WebGLDepthTexture::supported(*graphicsContext3D())
+                ? std::make_unique&lt;WebGLDepthTexture&gt;(*this) : nullptr;
+        }
</ins><span class="cx">         return m_webglDepthTexture.get();
</span><span class="cx">     }
</span><span class="cx">     if (equalIgnoringASCIICase(name, &quot;WEBGL_debug_renderer_info&quot;)) {
</span><span class="lines">@@ -1079,10 +1076,11 @@
</span><span class="cx">             m_webglDebugRendererInfo = std::make_unique&lt;WebGLDebugRendererInfo&gt;(*this);
</span><span class="cx">         return m_webglDebugRendererInfo.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;WEBGL_debug_shaders&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_ANGLE_translated_shader_source&quot;)) {
-        if (!m_webglDebugShaders)
-            m_webglDebugShaders = std::make_unique&lt;WebGLDebugShaders&gt;(*this);
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;WEBGL_debug_shaders&quot;)) {
+        if (!m_webglDebugShaders) {
+            m_webglDebugShaders = m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_ANGLE_translated_shader_source&quot; })
+                ? std::make_unique&lt;WebGLDebugShaders&gt;(*this) : nullptr;
+        }
</ins><span class="cx">         return m_webglDebugShaders.get();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1096,90 +1094,90 @@
</span><span class="cx">     if (m_isPendingPolicyResolution)
</span><span class="cx">         return result;
</span><span class="cx"> 
</span><del>-    if (m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_float&quot;))
-        result.append(&quot;OES_texture_float&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_float_linear&quot;))
-        result.append(&quot;OES_texture_float_linear&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_half_float&quot;))
-        result.append(&quot;OES_texture_half_float&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_half_float_linear&quot;))
-        result.append(&quot;OES_texture_half_float_linear&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_EXT_texture_filter_anisotropic&quot;))
-        result.append(&quot;WEBKIT_EXT_texture_filter_anisotropic&quot;);
</del><ins>+    auto&amp; extensions = m_context-&gt;getExtensions();
+    if (extensions.supports(ASCIILiteral { &quot;GL_OES_texture_float&quot; }))
+        result.append(ASCIILiteral { &quot;OES_texture_float&quot; });
+    if (extensions.supports(ASCIILiteral { &quot;GL_OES_texture_float_linear&quot; }))
+        result.append(ASCIILiteral { &quot;OES_texture_float_linear&quot; });
+    if (extensions.supports(ASCIILiteral { &quot;GL_OES_texture_half_float&quot; }))
+        result.append(ASCIILiteral { &quot;OES_texture_half_float&quot; });
+    if (extensions.supports(ASCIILiteral { &quot;GL_OES_texture_half_float_linear&quot; }))
+        result.append(ASCIILiteral { &quot;OES_texture_half_float_linear&quot; });
+    if (extensions.supports(ASCIILiteral { &quot;GL_EXT_texture_filter_anisotropic&quot; }))
+        result.append(ASCIILiteral { &quot;WEBKIT_EXT_texture_filter_anisotropic&quot; });
</ins><span class="cx">     if (WebGLCompressedTextureATC::supported(*this))
</span><del>-        result.append(&quot;WEBKIT_WEBGL_compressed_texture_atc&quot;);
</del><ins>+        result.append(ASCIILiteral { &quot;WEBKIT_WEBGL_compressed_texture_atc&quot; });
</ins><span class="cx">     if (WebGLCompressedTexturePVRTC::supported(*this))
</span><del>-        result.append(&quot;WEBKIT_WEBGL_compressed_texture_pvrtc&quot;);
</del><ins>+        result.append(ASCIILiteral { &quot;WEBKIT_WEBGL_compressed_texture_pvrtc&quot; });
</ins><span class="cx">     if (WebGLCompressedTextureS3TC::supported(*this))
</span><del>-        result.append(&quot;WEBGL_compressed_texture_s3tc&quot;);
</del><ins>+        result.append(ASCIILiteral { &quot;WEBGL_compressed_texture_s3tc&quot; });
</ins><span class="cx">     if (WebGLDepthTexture::supported(*graphicsContext3D()))
</span><del>-        result.append(&quot;WEBGL_depth_texture&quot;);
-    result.append(&quot;WEBGL_lose_context&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_ANGLE_translated_shader_source&quot;))
-        result.append(&quot;WEBGL_debug_shaders&quot;);
-    result.append(&quot;WEBGL_debug_renderer_info&quot;);
</del><ins>+        result.append(ASCIILiteral { &quot;WEBGL_depth_texture&quot; });
+    result.append(ASCIILiteral { &quot;WEBGL_lose_context&quot; });
+    if (extensions.supports(ASCIILiteral { &quot;GL_ANGLE_translated_shader_source&quot; }))
+        result.append(ASCIILiteral { &quot;WEBGL_debug_shaders&quot; });
+    result.append(ASCIILiteral { &quot;WEBGL_debug_renderer_info&quot; });
</ins><span class="cx"> 
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGL2RenderingContext::getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname)
</del><ins>+WebGLAny WebGL2RenderingContext::getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending() || !validateFramebufferFuncParameters(&quot;getFramebufferAttachmentParameter&quot;, target, attachment))
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     
</span><span class="cx">     if (!m_framebufferBinding || !m_framebufferBinding-&gt;object()) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, &quot;getFramebufferAttachmentParameter&quot;, &quot;no framebuffer bound&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx">     
</span><del>-    WebGLSharedObject* object = m_framebufferBinding-&gt;getAttachmentObject(attachment);
</del><ins>+    auto* object = m_framebufferBinding-&gt;getAttachmentObject(attachment);
</ins><span class="cx">     if (!object) {
</span><span class="cx">         if (pname == GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)
</span><del>-            return WebGLGetInfo(GraphicsContext3D::NONE);
-        // OpenGL ES 2.0 specifies INVALID_ENUM in this case, while desktop GL
-        // specifies INVALID_OPERATION.
</del><ins>+            return static_cast&lt;unsigned&gt;(GraphicsContext3D::NONE);
+        // OpenGL ES 2.0 specifies INVALID_ENUM in this case, while desktop GL specifies INVALID_OPERATION.
</ins><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getFramebufferAttachmentParameter&quot;, &quot;invalid parameter name&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx">     
</span><del>-    ASSERT(object-&gt;isTexture() || object-&gt;isRenderbuffer());
</del><span class="cx">     if (object-&gt;isTexture()) {
</span><span class="cx">         switch (pname) {
</span><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
</span><del>-            return WebGLGetInfo(GraphicsContext3D::TEXTURE);
</del><ins>+            return static_cast&lt;unsigned&gt;(GraphicsContext3D::TEXTURE);
</ins><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
</span><del>-            return WebGLGetInfo(reinterpret_cast&lt;WebGLTexture*&gt;(object));
</del><ins>+            return makeRefPtr(reinterpret_cast&lt;WebGLTexture&amp;&gt;(*object));
</ins><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
</span><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
</span><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: {
</span><span class="cx">             GC3Dint value = 0;
</span><span class="cx">             m_context-&gt;getFramebufferAttachmentParameteriv(target, attachment, pname, &amp;value);
</span><del>-            return WebGLGetInfo(value);
</del><ins>+            return value;
</ins><span class="cx">         }
</span><span class="cx">         default:
</span><span class="cx">             synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getFramebufferAttachmentParameter&quot;, &quot;invalid parameter name for texture attachment&quot;);
</span><del>-            return WebGLGetInfo();
</del><ins>+            return nullptr;
</ins><span class="cx">         }
</span><span class="cx">     } else {
</span><ins>+        ASSERT(object-&gt;isRenderbuffer());
</ins><span class="cx">         switch (pname) {
</span><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
</span><del>-            return WebGLGetInfo(GraphicsContext3D::RENDERBUFFER);
</del><ins>+            return static_cast&lt;unsigned&gt;(GraphicsContext3D::RENDERBUFFER);
</ins><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
</span><del>-            return WebGLGetInfo(reinterpret_cast&lt;WebGLRenderbuffer*&gt;(object));
</del><ins>+            return makeRefPtr(reinterpret_cast&lt;WebGLRenderbuffer&amp;&gt;(*object));
</ins><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING : {
</span><del>-            WebGLRenderbuffer* renderBuffer = reinterpret_cast&lt;WebGLRenderbuffer*&gt;(object);
-            GC3Denum renderBufferFormat = renderBuffer-&gt;getInternalFormat();
-            if (renderBufferFormat == GraphicsContext3D::SRGB8_ALPHA8
-                || renderBufferFormat == GraphicsContext3D::COMPRESSED_SRGB8_ETC2
-                || renderBufferFormat == GraphicsContext3D::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
-                || renderBufferFormat == GraphicsContext3D::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2) {
-                return WebGLGetInfo(GraphicsContext3D::SRGB);
</del><ins>+            auto&amp; renderBuffer = reinterpret_cast&lt;WebGLRenderbuffer&amp;&gt;(*object);
+            auto format = renderBuffer.getInternalFormat();
+            if (format == GraphicsContext3D::SRGB8_ALPHA8
+                || format == GraphicsContext3D::COMPRESSED_SRGB8_ETC2
+                || format == GraphicsContext3D::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
+                || format == GraphicsContext3D::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2) {
+                return static_cast&lt;unsigned&gt;(GraphicsContext3D::SRGB);
</ins><span class="cx">             }
</span><del>-            return WebGLGetInfo(GraphicsContext3D::LINEAR);
</del><ins>+            return static_cast&lt;unsigned&gt;(GraphicsContext3D::LINEAR);
</ins><span class="cx">         }
</span><span class="cx">         default:
</span><span class="cx">             synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getFramebufferAttachmentParameter&quot;, &quot;invalid parameter name for renderbuffer attachment&quot;);
</span><del>-            return WebGLGetInfo();
</del><ins>+            return nullptr;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -1191,19 +1189,16 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     switch (attachment) {
</span><del>-    case GraphicsContext3D::COLOR_ATTACHMENT0:
</del><span class="cx">     case GraphicsContext3D::DEPTH_ATTACHMENT:
</span><span class="cx">     case GraphicsContext3D::STENCIL_ATTACHMENT:
</span><span class="cx">     case GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT:
</span><del>-        break;
</del><ins>+        return true;
</ins><span class="cx">     default:
</span><del>-        if (attachment &gt; GraphicsContext3D::COLOR_ATTACHMENT0
-            &amp;&amp; attachment &lt; static_cast&lt;GC3Denum&gt;(GraphicsContext3D::COLOR_ATTACHMENT0 + getMaxColorAttachments()))
-            break;
</del><ins>+        if (attachment &gt;= GraphicsContext3D::COLOR_ATTACHMENT0 &amp;&amp; attachment &lt; static_cast&lt;GC3Denum&gt;(GraphicsContext3D::COLOR_ATTACHMENT0 + getMaxColorAttachments()))
+            return true;
</ins><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, &quot;invalid attachment&quot;);
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><del>-    return true;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GC3Dint WebGL2RenderingContext::getMaxDrawBuffers()
</span><span class="lines">@@ -1395,7 +1390,7 @@
</span><span class="cx"> bool WebGL2RenderingContext::isIntegerFormat(GC3Denum internalformat)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: baseInternalFormatFromInternalFormat() never returns any of these enums.
</span><del>-    // Currently, This function erroneously always returns false.
</del><ins>+    // Because of that, this function erroneously always returns false!
</ins><span class="cx">     switch (baseInternalFormatFromInternalFormat(internalformat)) {
</span><span class="cx">     case GraphicsContext3D::RED_INTEGER:
</span><span class="cx">     case GraphicsContext3D::RG_INTEGER:
</span><span class="lines">@@ -1406,11 +1401,10 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGL2RenderingContext::getParameter(GC3Denum pname)
</del><ins>+WebGLAny WebGL2RenderingContext::getParameter(GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending())
</span><del>-        return WebGLGetInfo();
-    const int intZero = 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     switch (pname) {
</span><span class="cx">     case GraphicsContext3D::ACTIVE_TEXTURE:
</span><span class="cx">         return getUnsignedIntParameter(pname);
</span><span class="lines">@@ -1421,7 +1415,7 @@
</span><span class="cx">     case GraphicsContext3D::ALPHA_BITS:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::ARRAY_BUFFER_BINDING:
</span><del>-        return WebGLGetInfo(m_boundArrayBuffer.get());
</del><ins>+        return m_boundArrayBuffer;
</ins><span class="cx">     case GraphicsContext3D::BLEND:
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::BLEND_COLOR:
</span><span class="lines">@@ -1445,16 +1439,16 @@
</span><span class="cx">     case GraphicsContext3D::COLOR_WRITEMASK:
</span><span class="cx">         return getBooleanArrayParameter(pname);
</span><span class="cx">     case GraphicsContext3D::COMPRESSED_TEXTURE_FORMATS:
</span><del>-        return WebGLGetInfo(PassRefPtr&lt;Uint32Array&gt;(Uint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size())));
</del><ins>+        return Uint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size());
</ins><span class="cx">     case GraphicsContext3D::CULL_FACE:
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::CULL_FACE_MODE:
</span><span class="cx">         return getUnsignedIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::CURRENT_PROGRAM:
</span><del>-        return WebGLGetInfo(m_currentProgram.get());
</del><ins>+        return m_currentProgram;
</ins><span class="cx">     case GraphicsContext3D::DEPTH_BITS:
</span><span class="cx">         if (!m_framebufferBinding &amp;&amp; !m_attributes.depth)
</span><del>-            return WebGLGetInfo(intZero);
</del><ins>+            return 0;
</ins><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::DEPTH_CLEAR_VALUE:
</span><span class="cx">         return getFloatParameter(pname);
</span><span class="lines">@@ -1469,9 +1463,9 @@
</span><span class="cx">     case GraphicsContext3D::DITHER:
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::ELEMENT_ARRAY_BUFFER_BINDING:
</span><del>-        return WebGLGetInfo(m_boundVertexArrayObject-&gt;getElementArrayBuffer());
</del><ins>+        return makeRefPtr(m_boundVertexArrayObject-&gt;getElementArrayBuffer());
</ins><span class="cx">     case GraphicsContext3D::FRAMEBUFFER_BINDING:
</span><del>-        return WebGLGetInfo(m_framebufferBinding.get());
</del><ins>+        return m_framebufferBinding;
</ins><span class="cx">     case GraphicsContext3D::FRONT_FACE:
</span><span class="cx">         return getUnsignedIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::GENERATE_MIPMAP_HINT:
</span><span class="lines">@@ -1519,9 +1513,9 @@
</span><span class="cx">     case GraphicsContext3D::RED_BITS:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::RENDERBUFFER_BINDING:
</span><del>-        return WebGLGetInfo(m_renderbufferBinding.get());
</del><ins>+        return m_renderbufferBinding;
</ins><span class="cx">     case GraphicsContext3D::RENDERER:
</span><del>-        return WebGLGetInfo(String(&quot;WebKit WebGL&quot;));
</del><ins>+        return String { ASCIILiteral { &quot;WebKit WebGL&quot; } };
</ins><span class="cx">     case GraphicsContext3D::SAMPLE_BUFFERS:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::SAMPLE_COVERAGE_INVERT:
</span><span class="lines">@@ -1535,7 +1529,7 @@
</span><span class="cx">     case GraphicsContext3D::SCISSOR_TEST:
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::SHADING_LANGUAGE_VERSION:
</span><del>-        return WebGLGetInfo(&quot;WebGL GLSL ES 1.0 (&quot; + m_context-&gt;getString(GraphicsContext3D::SHADING_LANGUAGE_VERSION) + &quot;)&quot;);
</del><ins>+        return &quot;WebGL GLSL ES 1.0 (&quot; + m_context-&gt;getString(GraphicsContext3D::SHADING_LANGUAGE_VERSION) + &quot;)&quot;;
</ins><span class="cx">     case GraphicsContext3D::STENCIL_BACK_FAIL:
</span><span class="cx">         return getUnsignedIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::STENCIL_BACK_FUNC:
</span><span class="lines">@@ -1552,7 +1546,7 @@
</span><span class="cx">         return getUnsignedIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::STENCIL_BITS:
</span><span class="cx">         if (!m_framebufferBinding &amp;&amp; !m_attributes.stencil)
</span><del>-            return WebGLGetInfo(intZero);
</del><ins>+            return 0;
</ins><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::STENCIL_CLEAR_VALUE:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="lines">@@ -1575,38 +1569,38 @@
</span><span class="cx">     case GraphicsContext3D::SUBPIXEL_BITS:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::TEXTURE_BINDING_2D:
</span><del>-        return WebGLGetInfo(m_textureUnits[m_activeTextureUnit].texture2DBinding.get());
</del><ins>+        return m_textureUnits[m_activeTextureUnit].texture2DBinding;
</ins><span class="cx">     case GraphicsContext3D::TEXTURE_BINDING_CUBE_MAP:
</span><del>-        return WebGLGetInfo(m_textureUnits[m_activeTextureUnit].textureCubeMapBinding.get());
</del><ins>+        return m_textureUnits[m_activeTextureUnit].textureCubeMapBinding;
</ins><span class="cx">     case GraphicsContext3D::UNPACK_ALIGNMENT:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::UNPACK_FLIP_Y_WEBGL:
</span><del>-        return WebGLGetInfo(m_unpackFlipY);
</del><ins>+        return m_unpackFlipY;
</ins><span class="cx">     case GraphicsContext3D::UNPACK_PREMULTIPLY_ALPHA_WEBGL:
</span><del>-        return WebGLGetInfo(m_unpackPremultiplyAlpha);
</del><ins>+        return m_unpackPremultiplyAlpha;
</ins><span class="cx">     case GraphicsContext3D::UNPACK_COLORSPACE_CONVERSION_WEBGL:
</span><del>-        return WebGLGetInfo(m_unpackColorspaceConversion);
</del><ins>+        return m_unpackColorspaceConversion;
</ins><span class="cx">     case GraphicsContext3D::VENDOR:
</span><del>-        return WebGLGetInfo(String(&quot;WebKit&quot;));
</del><ins>+        return String { ASCIILiteral { &quot;WebKit&quot; } };
</ins><span class="cx">     case GraphicsContext3D::VERSION:
</span><del>-        return WebGLGetInfo(&quot;WebGL 2.0 (&quot; + m_context-&gt;getString(GraphicsContext3D::VERSION) + &quot;)&quot;);
</del><ins>+        return &quot;WebGL 2.0 (&quot; + m_context-&gt;getString(GraphicsContext3D::VERSION) + &quot;)&quot;;
</ins><span class="cx">     case GraphicsContext3D::VIEWPORT:
</span><span class="cx">         return getWebGLIntArrayParameter(pname);
</span><span class="cx">     case WebGLDebugRendererInfo::UNMASKED_RENDERER_WEBGL:
</span><span class="cx">         if (m_webglDebugRendererInfo)
</span><del>-            return WebGLGetInfo(m_context-&gt;getString(GraphicsContext3D::RENDERER));
</del><ins>+            return m_context-&gt;getString(GraphicsContext3D::RENDERER);
</ins><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name, WEBGL_debug_renderer_info not enabled&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     case WebGLDebugRendererInfo::UNMASKED_VENDOR_WEBGL:
</span><span class="cx">         if (m_webglDebugRendererInfo)
</span><del>-            return WebGLGetInfo(m_context-&gt;getString(GraphicsContext3D::VENDOR));
</del><ins>+            return m_context-&gt;getString(GraphicsContext3D::VENDOR);
</ins><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name, WEBGL_debug_renderer_info not enabled&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     case Extensions3D::MAX_TEXTURE_MAX_ANISOTROPY_EXT: // EXT_texture_filter_anisotropic
</span><span class="cx">         if (m_extTextureFilterAnisotropic)
</span><span class="cx">             return getUnsignedIntParameter(Extensions3D::MAX_TEXTURE_MAX_ANISOTROPY_EXT);
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name, EXT_texture_filter_anisotropic not enabled&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     case GraphicsContext3D::FRAGMENT_SHADER_DERIVATIVE_HINT:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::MAX_3D_TEXTURE_SIZE:
</span><span class="lines">@@ -1689,12 +1683,10 @@
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::UNIFORM_BUFFER_OFFSET_ALIGNMENT:
</span><span class="cx">         return getIntParameter(pname);
</span><del>-    case GraphicsContext3D::VERTEX_ARRAY_BINDING: {
-        if (!m_boundVertexArrayObject-&gt;isDefaultObject())
-            return WebGLGetInfo(static_cast&lt;WebGLVertexArrayObject*&gt;(m_boundVertexArrayObject.get()));
-        return WebGLGetInfo();
-        }
-        break;
</del><ins>+    case GraphicsContext3D::VERTEX_ARRAY_BINDING:
+        if (m_boundVertexArrayObject-&gt;isDefaultObject())
+            return nullptr;
+        return makeRefPtr(static_cast&lt;WebGLVertexArrayObject&amp;&gt;(*m_boundVertexArrayObject));
</ins><span class="cx">     case GraphicsContext3D::DRAW_BUFFER0:
</span><span class="cx">     case GraphicsContext3D::DRAW_BUFFER1:
</span><span class="cx">     case GraphicsContext3D::DRAW_BUFFER2:
</span><span class="lines">@@ -1710,14 +1702,10 @@
</span><span class="cx">     case GraphicsContext3D::DRAW_BUFFER12:
</span><span class="cx">     case GraphicsContext3D::DRAW_BUFFER13:
</span><span class="cx">     case GraphicsContext3D::DRAW_BUFFER14:
</span><del>-    case GraphicsContext3D::DRAW_BUFFER15: {
-        GC3Dint value = GraphicsContext3D::NONE;
</del><ins>+    case GraphicsContext3D::DRAW_BUFFER15:
</ins><span class="cx">         if (m_framebufferBinding)
</span><del>-            value = m_framebufferBinding-&gt;getDrawBuffer(pname);
-        else // emulated backbuffer
-            value = m_backDrawBuffer;
-        return WebGLGetInfo(value);
-        }
</del><ins>+            return m_framebufferBinding-&gt;getDrawBuffer(pname);
+        return m_backDrawBuffer; // emulated backbuffer
</ins><span class="cx">     case GraphicsContext3D::COPY_READ_BUFFER:
</span><span class="cx">     case GraphicsContext3D::COPY_WRITE_BUFFER:
</span><span class="cx">     case GraphicsContext3D::PIXEL_PACK_BUFFER_BINDING:   
</span><span class="lines">@@ -1730,10 +1718,10 @@
</span><span class="cx">     case GraphicsContext3D::TRANSFORM_FEEDBACK_BUFFER_BINDING:
</span><span class="cx">     case GraphicsContext3D::UNIFORM_BUFFER_BINDING:
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;parameter name not yet supported&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     default:
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1754,7 +1742,7 @@
</span><span class="cx">     // The case count==0 is already dealt with in drawElements before validateIndexArrayConservative.
</span><span class="cx">     if (!numElements)
</span><span class="cx">         return false;
</span><del>-    const ArrayBuffer* buffer = elementArrayBuffer-&gt;elementArrayBuffer();
</del><ins>+    auto* buffer = elementArrayBuffer-&gt;elementArrayBuffer();
</ins><span class="cx">     ASSERT(buffer);
</span><span class="cx">     
</span><span class="cx">     int maxIndex = elementArrayBuffer-&gt;getCachedMaxIndex(type);
</span><span class="lines">@@ -1806,7 +1794,6 @@
</span><span class="cx">     case GraphicsContext3D::MIN:
</span><span class="cx">     case GraphicsContext3D::MAX:
</span><span class="cx">         return true;
</span><del>-        break;
</del><span class="cx">     default:
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, &quot;invalid mode&quot;);
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #if ENABLE(WEBGL2)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebGLRenderingContextBase.h&quot;
</span><del>-#include &lt;wtf/Variant.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -41,9 +40,9 @@
</span><span class="cx"> class WebGL2RenderingContext final : public WebGLRenderingContextBase {
</span><span class="cx"> public:
</span><span class="cx">     WebGL2RenderingContext(HTMLCanvasElement&amp;, WebGLContextAttributes);
</span><del>-    WebGL2RenderingContext(HTMLCanvasElement&amp;, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp;, WebGLContextAttributes);
</del><ins>+    WebGL2RenderingContext(HTMLCanvasElement&amp;, Ref&lt;GraphicsContext3D&gt;&amp;&amp;, WebGLContextAttributes);
</ins><span class="cx"> 
</span><del>-    /* Buffer objects */
</del><ins>+    // Buffer objects
</ins><span class="cx">     using WebGLRenderingContextBase::bufferData;
</span><span class="cx">     using WebGLRenderingContextBase::bufferSubData;
</span><span class="cx">     void bufferData(GC3Denum target, const ArrayBufferView&amp; data, GC3Denum usage, GC3Duint srcOffset, GC3Duint length);
</span><span class="lines">@@ -51,19 +50,19 @@
</span><span class="cx">     void copyBufferSubData(GC3Denum readTarget, GC3Denum writeTarget, GC3Dint64 readOffset, GC3Dint64 writeOffset, GC3Dint64 size);
</span><span class="cx">     void getBufferSubData(GC3Denum target, long long srcByteOffset, RefPtr&lt;ArrayBufferView&gt;&amp;&amp; dstData, GC3Duint dstOffset = 0, GC3Duint length = 0);
</span><span class="cx">     
</span><del>-    /* Framebuffer objects */
-    WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) final;
</del><ins>+    // Framebuffer objects
+    WebGLAny getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) final;
</ins><span class="cx">     void blitFramebuffer(GC3Dint srcX0, GC3Dint srcY0, GC3Dint srcX1, GC3Dint srcY1, GC3Dint dstX0, GC3Dint dstY0, GC3Dint dstX1, GC3Dint dstY1, GC3Dbitfield mask, GC3Denum filter);
</span><span class="cx">     void framebufferTextureLayer(GC3Denum target, GC3Denum attachment, GC3Duint texture, GC3Dint level, GC3Dint layer);
</span><del>-    WebGLGetInfo getInternalformatParameter(GC3Denum target, GC3Denum internalformat, GC3Denum pname);
-    void invalidateFramebuffer(GC3Denum target, Vector&lt;GC3Denum&gt; attachments);
-    void invalidateSubFramebuffer(GC3Denum target, Vector&lt;GC3Denum&gt; attachments, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
</del><ins>+    WebGLAny getInternalformatParameter(GC3Denum target, GC3Denum internalformat, GC3Denum pname);
+    void invalidateFramebuffer(GC3Denum target, const Vector&lt;GC3Denum&gt;&amp; attachments);
+    void invalidateSubFramebuffer(GC3Denum target, const Vector&lt;GC3Denum&gt;&amp; attachments, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
</ins><span class="cx">     void readBuffer(GC3Denum src);
</span><span class="cx">     
</span><del>-    /* Renderbuffer objects */
</del><ins>+    // Renderbuffer objects
</ins><span class="cx">     void renderbufferStorageMultisample(GC3Denum target, GC3Dsizei samples, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height);
</span><span class="cx">     
</span><del>-    /* Texture objects */
</del><ins>+    // Texture objects
</ins><span class="cx">     void texStorage2D(GC3Denum target, GC3Dsizei levels, GC3Denum internalFormat, GC3Dsizei width, GC3Dsizei height);
</span><span class="cx">     void texStorage3D(GC3Denum target, GC3Dsizei levels, GC3Denum internalFormat, GC3Dsizei width, GC3Dsizei height, GC3Dsizei depth);
</span><span class="cx">     void texImage3D(GC3Denum target, GC3Dint level, GC3Dint internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dsizei depth, GC3Dint border, GC3Denum format, GC3Denum type, RefPtr&lt;ArrayBufferView&gt;&amp;&amp; pixels);
</span><span class="lines">@@ -76,10 +75,10 @@
</span><span class="cx">     void compressedTexImage3D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dsizei depth, GC3Dint border, GC3Dsizei imageSize, RefPtr&lt;ArrayBufferView&gt;&amp;&amp; data);
</span><span class="cx">     void compressedTexSubImage3D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dint zoffset, GC3Dsizei width, GC3Dsizei height, GC3Dsizei depth, GC3Denum format, GC3Dsizei imageSize, RefPtr&lt;ArrayBufferView&gt;&amp;&amp; data);
</span><span class="cx">     
</span><del>-    /* Programs and shaders */
-    GC3Dint getFragDataLocation(WebGLProgram* program, String name);
</del><ins>+    // Programs and shaders
+    GC3Dint getFragDataLocation(WebGLProgram*, const String&amp; name);
</ins><span class="cx">     
</span><del>-    /* Uniforms and attributes */
</del><ins>+    // Uniforms and attributes
</ins><span class="cx">     void uniform1ui(WebGLUniformLocation*, GC3Duint v0);
</span><span class="cx">     void uniform2ui(WebGLUniformLocation*, GC3Duint v0, GC3Duint v1);
</span><span class="cx">     void uniform3ui(WebGLUniformLocation*, GC3Duint v0, GC3Duint v1, GC3Duint v2);
</span><span class="lines">@@ -100,7 +99,7 @@
</span><span class="cx">     void vertexAttribI4uiv(GC3Duint index, RefPtr&lt;Uint32Array&gt;&amp;&amp; v);
</span><span class="cx">     void vertexAttribIPointer(GC3Duint index, GC3Dint size, GC3Denum type, GC3Dsizei stride, GC3Dint64 offset);
</span><span class="cx">     
</span><del>-    /* Writing to the drawing buffer */
</del><ins>+    // Writing to the drawing buffer
</ins><span class="cx">     void clear(GC3Dbitfield mask) final;
</span><span class="cx">     void vertexAttribDivisor(GC3Duint index, GC3Duint divisor);
</span><span class="cx">     void drawArraysInstanced(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei instanceCount);
</span><span class="lines">@@ -107,40 +106,40 @@
</span><span class="cx">     void drawElementsInstanced(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dint64 offset, GC3Dsizei instanceCount);
</span><span class="cx">     void drawRangeElements(GC3Denum mode, GC3Duint start, GC3Duint end, GC3Dsizei count, GC3Denum type, GC3Dint64 offset);
</span><span class="cx">     
</span><del>-    /* Multiple Render Targets */
-    void drawBuffers(Vector&lt;GC3Denum&gt; buffers);
</del><ins>+    // Multiple render targets
+    void drawBuffers(const Vector&lt;GC3Denum&gt;&amp; buffers);
</ins><span class="cx">     void clearBufferiv(GC3Denum buffer, GC3Dint drawbuffer, RefPtr&lt;Int32Array&gt;&amp;&amp; value);
</span><span class="cx">     void clearBufferuiv(GC3Denum buffer, GC3Dint drawbuffer, RefPtr&lt;Uint32Array&gt;&amp;&amp; value);
</span><span class="cx">     void clearBufferfv(GC3Denum buffer, GC3Dint drawbuffer, RefPtr&lt;Float32Array&gt;&amp;&amp; value);
</span><span class="cx">     void clearBufferfi(GC3Denum buffer, GC3Dint drawbuffer, GC3Dfloat depth, GC3Dint stencil);
</span><span class="cx">     
</span><del>-    /* Query Objects */
</del><ins>+    // Query objects
</ins><span class="cx">     RefPtr&lt;WebGLQuery&gt; createQuery();
</span><del>-    void deleteQuery(WebGLQuery* query);
-    GC3Dboolean isQuery(WebGLQuery* query);
-    void beginQuery(GC3Denum target, WebGLQuery* query);
</del><ins>+    void deleteQuery(WebGLQuery*);
+    GC3Dboolean isQuery(WebGLQuery*);
+    void beginQuery(GC3Denum target, WebGLQuery*);
</ins><span class="cx">     void endQuery(GC3Denum target);
</span><span class="cx">     RefPtr&lt;WebGLQuery&gt; getQuery(GC3Denum target, GC3Denum pname);
</span><del>-    WebGLGetInfo getQueryParameter(WebGLQuery* query, GC3Denum pname);
</del><ins>+    WebGLAny getQueryParameter(WebGLQuery*, GC3Denum pname);
</ins><span class="cx">     
</span><del>-    /* Sampler Objects */
</del><ins>+    // Sampler objects
</ins><span class="cx">     RefPtr&lt;WebGLSampler&gt; createSampler();
</span><del>-    void deleteSampler(WebGLSampler* sampler);
-    GC3Dboolean isSampler(WebGLSampler* sampler);
-    void bindSampler(GC3Duint unit, WebGLSampler* sampler);
-    void samplerParameteri(WebGLSampler* sampler, GC3Denum pname, GC3Dint param);
-    void samplerParameterf(WebGLSampler* sampler, GC3Denum pname, GC3Dfloat param);
-    WebGLGetInfo getSamplerParameter(WebGLSampler* sampler, GC3Denum pname);
</del><ins>+    void deleteSampler(WebGLSampler*);
+    GC3Dboolean isSampler(WebGLSampler*);
+    void bindSampler(GC3Duint unit, WebGLSampler*);
+    void samplerParameteri(WebGLSampler*, GC3Denum pname, GC3Dint param);
+    void samplerParameterf(WebGLSampler*, GC3Denum pname, GC3Dfloat param);
+    WebGLAny getSamplerParameter(WebGLSampler*, GC3Denum pname);
</ins><span class="cx">     
</span><del>-    /* Sync objects */
</del><ins>+    // Sync objects
</ins><span class="cx">     RefPtr&lt;WebGLSync&gt; fenceSync(GC3Denum condition, GC3Dbitfield flags);
</span><del>-    GC3Dboolean isSync(WebGLSync* sync);
-    void deleteSync(WebGLSync* sync);
-    GC3Denum clientWaitSync(WebGLSync* sync, GC3Dbitfield flags, GC3Duint64 timeout);
-    void waitSync(WebGLSync* sync, GC3Dbitfield flags, GC3Duint64 timeout);
-    WebGLGetInfo getSyncParameter(WebGLSync* sync, GC3Denum pname);
</del><ins>+    GC3Dboolean isSync(WebGLSync*);
+    void deleteSync(WebGLSync*);
+    GC3Denum clientWaitSync(WebGLSync*, GC3Dbitfield flags, GC3Duint64 timeout);
+    void waitSync(WebGLSync*, GC3Dbitfield flags, GC3Duint64 timeout);
+    WebGLAny getSyncParameter(WebGLSync*, GC3Denum pname);
</ins><span class="cx">     
</span><del>-    /* Transform Feedback */
</del><ins>+    // Transform feedback
</ins><span class="cx">     RefPtr&lt;WebGLTransformFeedback&gt; createTransformFeedback();
</span><span class="cx">     void deleteTransformFeedback(WebGLTransformFeedback* id);
</span><span class="cx">     GC3Dboolean isTransformFeedback(WebGLTransformFeedback* id);
</span><span class="lines">@@ -147,23 +146,23 @@
</span><span class="cx">     void bindTransformFeedback(GC3Denum target, WebGLTransformFeedback* id);
</span><span class="cx">     void beginTransformFeedback(GC3Denum primitiveMode);
</span><span class="cx">     void endTransformFeedback();
</span><del>-    void transformFeedbackVaryings(WebGLProgram*, Vector&lt;String&gt; varyings, GC3Denum bufferMode);
</del><ins>+    void transformFeedbackVaryings(WebGLProgram*, const Vector&lt;String&gt;&amp; varyings, GC3Denum bufferMode);
</ins><span class="cx">     RefPtr&lt;WebGLActiveInfo&gt; getTransformFeedbackVarying(WebGLProgram*, GC3Duint index);
</span><span class="cx">     void pauseTransformFeedback();
</span><span class="cx">     void resumeTransformFeedback();
</span><span class="cx">     
</span><del>-    /* Uniform Buffer Objects and Transform Feedback Buffers */
-    void bindBufferBase(GC3Denum target, GC3Duint index, WebGLBuffer* buffer);
-    void bindBufferRange(GC3Denum target, GC3Duint index, WebGLBuffer* buffer, GC3Dint64 offset, GC3Dint64 size);
-    WebGLGetInfo getIndexedParameter(GC3Denum target, GC3Duint index);
-    Uint32Array* getUniformIndices(WebGLProgram*, Vector&lt;String&gt; uniformNames);
</del><ins>+    // Uniform buffer objects and transform feedback buffers
+    void bindBufferBase(GC3Denum target, GC3Duint index, WebGLBuffer*);
+    void bindBufferRange(GC3Denum target, GC3Duint index, WebGLBuffer*, GC3Dint64 offset, GC3Dint64 size);
+    WebGLAny getIndexedParameter(GC3Denum target, GC3Duint index);
+    Uint32Array* getUniformIndices(WebGLProgram*, const Vector&lt;String&gt;&amp; uniformNames);
</ins><span class="cx">     Int32Array* getActiveUniforms(WebGLProgram*, RefPtr&lt;Uint32Array&gt;&amp;&amp; uniformIndices, GC3Denum pname);
</span><del>-    GC3Duint getUniformBlockIndex(WebGLProgram*, String uniformBlockName);
-    WebGLGetInfo getActiveUniformBlockParameter(WebGLProgram*, GC3Duint uniformBlockIndex, GC3Denum pname);
-    WebGLGetInfo getActiveUniformBlockName(WebGLProgram*, GC3Duint uniformBlockIndex);
</del><ins>+    GC3Duint getUniformBlockIndex(WebGLProgram*, const String&amp; uniformBlockName);
+    WebGLAny getActiveUniformBlockParameter(WebGLProgram*, GC3Duint uniformBlockIndex, GC3Denum pname);
+    WebGLAny getActiveUniformBlockName(WebGLProgram*, GC3Duint uniformBlockIndex);
</ins><span class="cx">     void uniformBlockBinding(WebGLProgram*, GC3Duint uniformBlockIndex, GC3Duint uniformBlockBinding);
</span><span class="cx">     
</span><del>-    /* Vertex Array Objects */
</del><ins>+    // Vertex array objects
</ins><span class="cx">     RefPtr&lt;WebGLVertexArrayObject&gt; createVertexArray();
</span><span class="cx">     void deleteVertexArray(WebGLVertexArrayObject* vertexArray);
</span><span class="cx">     GC3Dboolean isVertexArray(WebGLVertexArrayObject* vertexArray);
</span><span class="lines">@@ -172,10 +171,10 @@
</span><span class="cx"> private:
</span><span class="cx">     bool isWebGL2() const final { return true; }
</span><span class="cx"> 
</span><del>-    /* Extensions */
</del><ins>+    // Extensions
</ins><span class="cx">     WebGLExtension* getExtension(const String&amp;) final;
</span><span class="cx">     Vector&lt;String&gt; getSupportedExtensions() final;
</span><del>-    WebGLGetInfo getParameter(GC3Denum pname) final;
</del><ins>+    WebGLAny getParameter(GC3Denum pname) final;
</ins><span class="cx"> 
</span><span class="cx">     void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height) final;
</span><span class="cx">     void hint(GC3Denum target, GC3Denum mode) final;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLAnycpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/html/canvas/WebGLAny.cpp (0 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLAny.cpp                                (rev 0)
+++ trunk/Source/WebCore/html/canvas/WebGLAny.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebGLAny.h&quot;
+
+#if ENABLE(WEBGL)
+
+#include &quot;JSDOMBinding.h&quot;
+#include &quot;JSWebGLBuffer.h&quot;
+#include &quot;JSWebGLFramebuffer.h&quot;
+#include &quot;JSWebGLProgram.h&quot;
+#include &quot;JSWebGLRenderbuffer.h&quot;
+#include &quot;JSWebGLTexture.h&quot;
+#include &quot;JSWebGLVertexArrayObjectOES.h&quot;
+#include &lt;wtf/Variant.h&gt;
+
+#if ENABLE(WEBGL2)
+#include &quot;JSWebGLVertexArrayObject.h&quot;
+#endif
+
+namespace WebCore {
+
+using namespace JSC;
+
+// FIXME: This likely can be autogenerated with a bit of work.
+JSValue toJS(ExecState&amp; state, JSDOMGlobalObject&amp; globalObject, const WebGLAny&amp; any)
+{
+    return WTF::switchOn(any,
+        [] (std::nullptr_t) {
+            return jsNull();
+        },
+        [] (bool value) {
+            return jsBoolean(value);
+        },
+        [] (int value) {
+            return jsNumber(value);
+        },
+        [] (unsigned value) {
+            return jsNumber(value);
+        },
+        [] (long long value) {
+            return jsNumber(value);
+        },
+        [] (float value) {
+            return jsNumber(value);
+        },
+        [&amp;] (const String&amp; value) {
+            return jsStringWithCache(&amp;state, value);
+        },
+        [&amp;] (const Vector&lt;bool&gt;&amp; values) {
+            MarkedArgumentBuffer list;
+            for (auto&amp; value : values)
+                list.append(jsBoolean(value));
+            return constructArray(&amp;state, 0, &amp;globalObject, list);
+        },
+        [&amp;] (const RefPtr&lt;Float32Array&gt;&amp; array) {
+            return toJS(&amp;state, &amp;globalObject, array.get());
+        },
+        [&amp;] (const RefPtr&lt;Int32Array&gt;&amp; array) {
+            return toJS(&amp;state, &amp;globalObject, array.get());
+        },
+        [&amp;] (const RefPtr&lt;Uint8Array&gt;&amp; array) {
+            return toJS(&amp;state, &amp;globalObject, array.get());
+        },
+        [&amp;] (const RefPtr&lt;Uint32Array&gt;&amp; array) {
+            return toJS(&amp;state, &amp;globalObject, array.get());
+        },
+        [&amp;] (const RefPtr&lt;WebGLBuffer&gt;&amp; buffer) {
+            return toJS(&amp;state, &amp;globalObject, buffer.get());
+        },
+        [&amp;] (const RefPtr&lt;WebGLFramebuffer&gt;&amp; buffer) {
+            return toJS(&amp;state, &amp;globalObject, buffer.get());
+        },
+        [&amp;] (const RefPtr&lt;WebGLProgram&gt;&amp; program) {
+            return toJS(&amp;state, &amp;globalObject, program.get());
+        },
+        [&amp;] (const RefPtr&lt;WebGLRenderbuffer&gt;&amp; buffer) {
+            return toJS(&amp;state, &amp;globalObject, buffer.get());
+        },
+        [&amp;] (const RefPtr&lt;WebGLTexture&gt;&amp; texture) {
+            return toJS(&amp;state, &amp;globalObject, texture.get());
+        },
+        [&amp;] (const RefPtr&lt;WebGLVertexArrayObjectOES&gt;&amp; array) {
+            return toJS(&amp;state, &amp;globalObject, array.get());
+        }
+#if ENABLE(WEBGL2)
+        ,
+        [&amp;] (const RefPtr&lt;WebGLVertexArrayObject&gt;&amp; array) {
+            return toJS(&amp;state, &amp;globalObject, array.get());
+        }
+#endif
+    );
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLAnyhfromrev210318trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjecth"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/html/canvas/WebGLAny.h (from rev 210318, trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.h) (0 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLAny.h                                (rev 0)
+++ trunk/Source/WebCore/html/canvas/WebGLAny.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBGL)
+
+#include &quot;WebGLBuffer.h&quot;
+#include &quot;WebGLFramebuffer.h&quot;
+#include &quot;WebGLProgram.h&quot;
+#include &quot;WebGLRenderbuffer.h&quot;
+#include &quot;WebGLTexture.h&quot;
+#include &quot;WebGLVertexArrayObjectOES.h&quot;
+#include &lt;runtime/Float32Array.h&gt;
+#include &lt;runtime/Int32Array.h&gt;
+#include &lt;runtime/Uint32Array.h&gt;
+#include &lt;runtime/Uint8Array.h&gt;
+
+#if ENABLE(WEBGL2)
+#include &quot;WebGLVertexArrayObject.h&quot;
+#endif
+
+namespace JSC {
+class ExecState;
+class JSValue;
+}
+
+namespace WebCore {
+
+class JSDOMGlobalObject;
+
+using WebGLAny = Variant&lt;std::nullptr_t, bool, int, unsigned, long long, float, String, Vector&lt;bool&gt;,
+    RefPtr&lt;Float32Array&gt;,
+    RefPtr&lt;Int32Array&gt;,
+    RefPtr&lt;Uint32Array&gt;,
+    RefPtr&lt;Uint8Array&gt;,
+    RefPtr&lt;WebGLBuffer&gt;,
+    RefPtr&lt;WebGLFramebuffer&gt;,
+    RefPtr&lt;WebGLProgram&gt;,
+    RefPtr&lt;WebGLRenderbuffer&gt;,
+    RefPtr&lt;WebGLTexture&gt;,
+    RefPtr&lt;WebGLVertexArrayObjectOES&gt;
+#if ENABLE(WEBGL2)
+    , RefPtr&lt;WebGLVertexArrayObject&gt;
+#endif
+&gt;;
+
+JSC::JSValue toJS(JSC::ExecState&amp;, JSDOMGlobalObject&amp;, const WebGLAny&amp;);
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLBuffer.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLBuffer.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLBuffer.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,11 +24,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;WebGLBuffer.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> 
</span><del>-#include &quot;WebGLBuffer.h&quot;
-
</del><span class="cx"> #include &quot;WebGLContextGroup.h&quot;
</span><span class="cx"> #include &quot;WebGLRenderingContextBase.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -41,9 +40,6 @@
</span><span class="cx"> 
</span><span class="cx"> WebGLBuffer::WebGLBuffer(WebGLRenderingContextBase&amp; ctx)
</span><span class="cx">     : WebGLSharedObject(ctx)
</span><del>-    , m_target(0)
-    , m_byteLength(0)
-    , m_nextAvailableCacheEntry(0)
</del><span class="cx"> {
</span><span class="cx">     setObject(ctx.graphicsContext3D()-&gt;createBuffer());
</span><span class="cx">     clearCachedMaxIndices();
</span><span class="lines">@@ -56,7 +52,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebGLBuffer::deleteObjectImpl(GraphicsContext3D* context3d, Platform3DObject object)
</span><span class="cx"> {
</span><del>-      context3d-&gt;deleteBuffer(object);
</del><ins>+    context3d-&gt;deleteBuffer(object);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebGLBuffer::associateBufferDataImpl(const void* data, GC3Dsizeiptr byteLength)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLBuffer.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLBuffer.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLBuffer.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -37,10 +37,9 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGLBuffer final : public WebGLSharedObject {
</span><span class="cx"> public:
</span><ins>+    static Ref&lt;WebGLBuffer&gt; create(WebGLRenderingContextBase&amp;);
</ins><span class="cx">     virtual ~WebGLBuffer();
</span><span class="cx"> 
</span><del>-    static Ref&lt;WebGLBuffer&gt; create(WebGLRenderingContextBase&amp;);
-
</del><span class="cx">     bool associateBufferData(GC3Dsizeiptr size);
</span><span class="cx">     bool associateBufferData(JSC::ArrayBuffer*);
</span><span class="cx">     bool associateBufferData(JSC::ArrayBufferView*);
</span><span class="lines">@@ -70,12 +69,10 @@
</span><span class="cx">     void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    bool isBuffer() const override { return true; }
</del><ins>+    GC3Denum m_target { 0 };
</ins><span class="cx"> 
</span><del>-    GC3Denum m_target;
-
</del><span class="cx">     RefPtr&lt;JSC::ArrayBuffer&gt; m_elementArrayBuffer;
</span><del>-    GC3Dsizeiptr m_byteLength;
</del><ins>+    GC3Dsizeiptr m_byteLength { 0 };
</ins><span class="cx"> 
</span><span class="cx">     // Optimization for index validation. For each type of index
</span><span class="cx">     // (i.e., UNSIGNED_SHORT), cache the maximum index in the
</span><span class="lines">@@ -92,7 +89,7 @@
</span><span class="cx">     // and UNSIGNED_SHORT), but might as well leave open the
</span><span class="cx">     // possibility of adding others.
</span><span class="cx">     MaxIndexCacheEntry m_maxIndexCache[4];
</span><del>-    unsigned int m_nextAvailableCacheEntry;
</del><ins>+    unsigned m_nextAvailableCacheEntry { 0 };
</ins><span class="cx"> 
</span><span class="cx">     // Clears all of the cached max indices.
</span><span class="cx">     void clearCachedMaxIndices();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLContextGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLContextGroup.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLContextGroup.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLContextGroup.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,11 +24,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;WebGLContextGroup.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> 
</span><del>-#include &quot;WebGLContextGroup.h&quot;
-
</del><span class="cx"> #include &quot;GraphicsContext3D.h&quot;
</span><span class="cx"> #include &quot;WebGLRenderingContextBase.h&quot;
</span><span class="cx"> #include &quot;WebGLSharedObject.h&quot;
</span><span class="lines">@@ -37,55 +36,48 @@
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;WebGLContextGroup&gt; WebGLContextGroup::create()
</span><span class="cx"> {
</span><del>-    return adoptRef(*new WebGLContextGroup());
</del><ins>+    return adoptRef(*new WebGLContextGroup);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLContextGroup::WebGLContextGroup()
-{
-}
-
</del><span class="cx"> WebGLContextGroup::~WebGLContextGroup()
</span><span class="cx"> {
</span><span class="cx">     detachAndRemoveAllObjects();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GraphicsContext3D* WebGLContextGroup::getAGraphicsContext3D()
</del><ins>+GraphicsContext3D&amp; WebGLContextGroup::getAGraphicsContext3D()
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!m_contexts.isEmpty());
</span><del>-    HashSet&lt;WebGLRenderingContextBase*&gt;::iterator it = m_contexts.begin();
-    return (*it)-&gt;graphicsContext3D();
</del><ins>+    return *(*m_contexts.begin())-&gt;graphicsContext3D();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLContextGroup::addContext(WebGLRenderingContextBase* context)
</del><ins>+void WebGLContextGroup::addContext(WebGLRenderingContextBase&amp; context)
</ins><span class="cx"> {
</span><del>-    m_contexts.add(context);
</del><ins>+    m_contexts.add(&amp;context);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLContextGroup::removeContext(WebGLRenderingContextBase* context)
</del><ins>+void WebGLContextGroup::removeContext(WebGLRenderingContextBase&amp; context)
</ins><span class="cx"> {
</span><span class="cx">     // We must call detachAndRemoveAllObjects before removing the last context.
</span><del>-    if (m_contexts.size() == 1 &amp;&amp; m_contexts.contains(context))
</del><ins>+    if (m_contexts.size() == 1 &amp;&amp; m_contexts.contains(&amp;context))
</ins><span class="cx">         detachAndRemoveAllObjects();
</span><span class="cx"> 
</span><del>-    m_contexts.remove(context);
</del><ins>+    m_contexts.remove(&amp;context);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLContextGroup::removeObject(WebGLSharedObject* object)
</del><ins>+void WebGLContextGroup::removeObject(WebGLSharedObject&amp; object)
</ins><span class="cx"> {
</span><del>-    m_groupObjects.remove(object);
</del><ins>+    m_groupObjects.remove(&amp;object);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLContextGroup::addObject(WebGLSharedObject* object)
</del><ins>+void WebGLContextGroup::addObject(WebGLSharedObject&amp; object)
</ins><span class="cx"> {
</span><del>-    m_groupObjects.add(object);
</del><ins>+    m_groupObjects.add(&amp;object);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGLContextGroup::detachAndRemoveAllObjects()
</span><span class="cx"> {
</span><del>-    while (!m_groupObjects.isEmpty()) {
-        HashSet&lt;WebGLSharedObject*&gt;::iterator it = m_groupObjects.begin();
-        (*it)-&gt;detachContextGroup();
-    }
</del><ins>+    while (!m_groupObjects.isEmpty())
+        (*m_groupObjects.begin())-&gt;detachContextGroup();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGLContextGroup::loseContextGroup(WebGLRenderingContextBase::LostContextMode mode)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLContextGrouph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLContextGroup.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLContextGroup.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLContextGroup.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,36 +26,27 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebGLRenderingContextBase.h&quot;
</span><del>-#include &lt;wtf/HashSet.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class GraphicsContext3D;
-class WebGLExtension;
-class WebGLSharedObject;
-class WebGLRenderingContextBase;
-
-class WebGLContextGroup final : public RefCounted&lt;WebGLContextGroup&gt; {
</del><ins>+class WebGLContextGroup : public RefCounted&lt;WebGLContextGroup&gt; {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;WebGLContextGroup&gt; create();
</span><span class="cx">     ~WebGLContextGroup();
</span><span class="cx"> 
</span><del>-    void addContext(WebGLRenderingContextBase*);
-    void removeContext(WebGLRenderingContextBase*);
</del><ins>+    void addContext(WebGLRenderingContextBase&amp;);
+    void removeContext(WebGLRenderingContextBase&amp;);
</ins><span class="cx"> 
</span><del>-    void addObject(WebGLSharedObject*);
-    void removeObject(WebGLSharedObject*);
</del><ins>+    void addObject(WebGLSharedObject&amp;);
+    void removeObject(WebGLSharedObject&amp;);
</ins><span class="cx"> 
</span><del>-    GraphicsContext3D* getAGraphicsContext3D();
</del><ins>+    GraphicsContext3D&amp; getAGraphicsContext3D();
</ins><span class="cx"> 
</span><span class="cx">     void loseContextGroup(WebGLRenderingContextBase::LostContextMode);
</span><span class="cx"> 
</span><del>-  private:
-    friend class WebGLObject;
</del><ins>+private:
+    WebGLContextGroup() = default;
</ins><span class="cx"> 
</span><del>-    WebGLContextGroup();
-
</del><span class="cx">     void detachAndRemoveAllObjects();
</span><span class="cx"> 
</span><span class="cx">     HashSet&lt;WebGLRenderingContextBase*&gt; m_contexts;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLContextObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLContextObject.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLContextObject.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLContextObject.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -24,18 +24,16 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;WebGLContextObject.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> 
</span><del>-#include &quot;WebGLContextObject.h&quot;
-
</del><span class="cx"> #include &quot;WebGLRenderingContextBase.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> WebGLContextObject::WebGLContextObject(WebGLRenderingContextBase&amp; context)
</span><del>-    : WebGLObject(context)
-    , m_context(&amp;context)
</del><ins>+    : m_context(&amp;context)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -42,7 +40,7 @@
</span><span class="cx"> WebGLContextObject::~WebGLContextObject()
</span><span class="cx"> {
</span><span class="cx">     if (m_context)
</span><del>-        m_context-&gt;removeContextObject(this);
</del><ins>+        m_context-&gt;removeContextObject(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGLContextObject::detachContext()
</span><span class="lines">@@ -50,14 +48,14 @@
</span><span class="cx">     detach();
</span><span class="cx">     if (m_context) {
</span><span class="cx">         deleteObject(m_context-&gt;graphicsContext3D());
</span><del>-        m_context-&gt;removeContextObject(this);
-        m_context = 0;
</del><ins>+        m_context-&gt;removeContextObject(*this);
+        m_context = nullptr;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GraphicsContext3D* WebGLContextObject::getAGraphicsContext3D() const
</span><span class="cx"> {
</span><del>-    return m_context ? m_context-&gt;graphicsContext3D() : 0;
</del><ins>+    return m_context ? m_context-&gt;graphicsContext3D() : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLFramebuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLFramebuffer.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLFramebuffer.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLFramebuffer.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,11 +24,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;WebGLFramebuffer.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> 
</span><del>-#include &quot;WebGLFramebuffer.h&quot;
-
</del><span class="cx"> #include &quot;Extensions3D.h&quot;
</span><span class="cx"> #include &quot;WebGLContextGroup.h&quot;
</span><span class="cx"> #include &quot;WebGLDrawBuffers.h&quot;
</span><span class="lines">@@ -606,6 +605,9 @@
</span><span class="cx"> void WebGLFramebuffer::drawBuffersIfNecessary(bool force)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(WEBGL2)
</span><ins>+    // FIXME: The logic here seems wrong. If we don't have WebGL 2 enabled at all, then
+    // we skip the m_webglDrawBuffers check. But if we do have WebGL 2 enabled, then we
+    // perform this check, for WebGL 1 contexts only.
</ins><span class="cx">     if (!context()-&gt;m_webglDrawBuffers &amp;&amp; !context()-&gt;isWebGL2())
</span><span class="cx">         return;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLGetInfocpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,371 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 Apple Inc. All Rights Reserved.
- * Copyright (C) 2009 Google Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-
-#if ENABLE(WEBGL)
-
-#include &quot;WebGLGetInfo.h&quot;
-
-#include &lt;runtime/Float32Array.h&gt;
-#include &lt;runtime/Int32Array.h&gt;
-#include &lt;runtime/Uint32Array.h&gt;
-#include &lt;runtime/Uint8Array.h&gt;
-
-namespace WebCore {
-
-WebGLGetInfo::WebGLGetInfo(bool value)
-    : m_type(kTypeBool)
-    , m_bool(value)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(const bool* value, int size)
-    : m_type(kTypeBoolArray)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-{
-    if (!value || size &lt;=0)
-        return;
-    m_boolArray.resize(size);
-    for (int ii = 0; ii &lt; size; ++ii)
-        m_boolArray[ii] = value[ii];
-}
-
-WebGLGetInfo::WebGLGetInfo(float value)
-    : m_type(kTypeFloat)
-    , m_bool(false)
-    , m_float(value)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(int value)
-    : m_type(kTypeInt)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(value)
-    , m_unsignedInt(0)
-    , m_int64(0)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo()
-    : m_type(kTypeNull)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(const String&amp; value)
-    : m_type(kTypeString)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_string(value)
-    , m_unsignedInt(0)
-    , m_int64(0)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(unsigned int value)
-    : m_type(kTypeUnsignedInt)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(value)
-    , m_int64(0)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(long long value)
-    : m_type(kTypeInt64)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(value)
-{
-}
-
-
-WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;WebGLBuffer&gt; value)
-    : m_type(kTypeWebGLBuffer)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-    , m_webglBuffer(value)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;Float32Array&gt; value)
-    : m_type(kTypeWebGLFloatArray)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-    , m_webglFloatArray(value)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;WebGLFramebuffer&gt; value)
-    : m_type(kTypeWebGLFramebuffer)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-    , m_webglFramebuffer(value)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;Int32Array&gt; value)
-    : m_type(kTypeWebGLIntArray)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-    , m_webglIntArray(value)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;WebGLProgram&gt; value)
-    : m_type(kTypeWebGLProgram)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-    , m_webglProgram(value)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;WebGLRenderbuffer&gt; value)
-    : m_type(kTypeWebGLRenderbuffer)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-    , m_webglRenderbuffer(value)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;WebGLTexture&gt; value)
-    : m_type(kTypeWebGLTexture)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-    , m_webglTexture(value)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;Uint8Array&gt; value)
-    : m_type(kTypeWebGLUnsignedByteArray)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-    , m_webglUnsignedByteArray(value)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;Uint32Array&gt; value)
-    : m_type(kTypeWebGLUnsignedIntArray)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-    , m_webglUnsignedIntArray(value)
-{
-}
-
-WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;WebGLVertexArrayObjectOES&gt; value)
-    : m_type(kTypeWebGLVertexArrayObjectOES)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-    , m_webglVertexArrayObjectOES(value)
-{
-}
-
-#if ENABLE(WEBGL2)
-WebGLGetInfo::WebGLGetInfo(PassRefPtr&lt;WebGLVertexArrayObject&gt; value)
-    : m_type(kTypeWebGLVertexArrayObject)
-    , m_bool(false)
-    , m_float(0)
-    , m_int(0)
-    , m_unsignedInt(0)
-    , m_int64(0)
-    , m_webglVertexArrayObject(value)
-{
-}
-#endif
-
-WebGLGetInfo::~WebGLGetInfo()
-{
-}
-
-WebGLGetInfo::Type WebGLGetInfo::getType() const
-{
-    return m_type;
-}
-
-bool WebGLGetInfo::getBool() const
-{
-    ASSERT(getType() == kTypeBool);
-    return m_bool;
-}
-
-const Vector&lt;bool&gt;&amp; WebGLGetInfo::getBoolArray() const
-{
-    ASSERT(getType() == kTypeBoolArray);
-    return m_boolArray;
-}
-
-float WebGLGetInfo::getFloat() const
-{
-    ASSERT(getType() == kTypeFloat);
-    return m_float;
-}
-
-int WebGLGetInfo::getInt() const
-{
-    ASSERT(getType() == kTypeInt);
-    return m_int;
-}
-
-const String&amp; WebGLGetInfo::getString() const
-{
-    ASSERT(getType() == kTypeString);
-    return m_string;
-}
-
-unsigned int WebGLGetInfo::getUnsignedInt() const
-{
-    ASSERT(getType() == kTypeUnsignedInt);
-    return m_unsignedInt;
-}
-
-long long WebGLGetInfo::getInt64() const
-{
-    ASSERT(getType() == kTypeInt64);
-    return m_int64;
-}
-
-WebGLBuffer* WebGLGetInfo::getWebGLBuffer() const
-{
-    ASSERT(getType() == kTypeWebGLBuffer);
-    return m_webglBuffer.get();
-}
-
-Float32Array* WebGLGetInfo::getWebGLFloatArray() const
-{
-    ASSERT(getType() == kTypeWebGLFloatArray);
-    return m_webglFloatArray.get();
-}
-
-WebGLFramebuffer* WebGLGetInfo::getWebGLFramebuffer() const
-{
-    ASSERT(getType() == kTypeWebGLFramebuffer);
-    return m_webglFramebuffer.get();
-}
-
-Int32Array* WebGLGetInfo::getWebGLIntArray() const
-{
-    ASSERT(getType() == kTypeWebGLIntArray);
-    return m_webglIntArray.get();
-}
-
-WebGLProgram* WebGLGetInfo::getWebGLProgram() const
-{
-    ASSERT(getType() == kTypeWebGLProgram);
-    return m_webglProgram.get();
-}
-
-WebGLRenderbuffer* WebGLGetInfo::getWebGLRenderbuffer() const
-{
-    ASSERT(getType() == kTypeWebGLRenderbuffer);
-    return m_webglRenderbuffer.get();
-}
-
-WebGLTexture* WebGLGetInfo::getWebGLTexture() const
-{
-    ASSERT(getType() == kTypeWebGLTexture);
-    return m_webglTexture.get();
-}
-
-Uint8Array* WebGLGetInfo::getWebGLUnsignedByteArray() const
-{
-    ASSERT(getType() == kTypeWebGLUnsignedByteArray);
-    return m_webglUnsignedByteArray.get();
-}
-
-Uint32Array* WebGLGetInfo::getWebGLUnsignedIntArray() const
-{
-    ASSERT(getType() == kTypeWebGLUnsignedIntArray);
-    return m_webglUnsignedIntArray.get();
-}
-
-WebGLVertexArrayObjectOES* WebGLGetInfo::getWebGLVertexArrayObjectOES() const
-{
-    ASSERT(getType() == kTypeWebGLVertexArrayObjectOES);
-    return m_webglVertexArrayObjectOES.get();
-}
-
-#if ENABLE(WEBGL2)
-WebGLVertexArrayObject* WebGLGetInfo::getWebGLVertexArrayObject() const
-{
-    ASSERT(getType() == kTypeWebGLVertexArrayObject);
-    return m_webglVertexArrayObject.get();
-}
-#endif
-
-} // namespace WebCore
-
-#endif // ENABLE(WEBGL)
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLGetInfoh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/html/canvas/WebGLGetInfo.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLGetInfo.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLGetInfo.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,156 +0,0 @@
</span><del>-/*
- * Copyright (C) 2009 Apple Inc. All Rights Reserved.
- * Copyright (C) 2009 Google Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include &quot;WebGLBuffer.h&quot;
-#include &quot;WebGLFramebuffer.h&quot;
-#include &quot;WebGLProgram.h&quot;
-#include &quot;WebGLRenderbuffer.h&quot;
-#include &quot;WebGLTexture.h&quot;
-#if ENABLE(WEBGL2)
-#include &quot;WebGLVertexArrayObject.h&quot;
-#endif
-#include &quot;WebGLVertexArrayObjectOES.h&quot;
-#include &lt;runtime/Float32Array.h&gt;
-#include &lt;runtime/Int32Array.h&gt;
-#include &lt;runtime/Uint32Array.h&gt;
-#include &lt;runtime/Uint8Array.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace WebCore {
-
-// A tagged union representing the result of get queries like
-// getParameter (encompassing getBooleanv, getIntegerv, getFloatv) and
-// similar variants. For reference counted types, increments and
-// decrements the reference count of the target object.
-
-class WebGLGetInfo final {
-public:
-    enum Type {
-        kTypeBool,
-        kTypeBoolArray,
-        kTypeFloat,
-        kTypeInt,
-        kTypeNull,
-        kTypeString,
-        kTypeUnsignedInt,
-        kTypeInt64,
-        kTypeWebGLBuffer,
-        kTypeWebGLFloatArray,
-        kTypeWebGLFramebuffer,
-        kTypeWebGLIntArray,
-        kTypeWebGLObjectArray,
-        kTypeWebGLProgram,
-        kTypeWebGLRenderbuffer,
-        kTypeWebGLTexture,
-        kTypeWebGLUnsignedByteArray,
-        kTypeWebGLUnsignedIntArray,
-        kTypeWebGLVertexArrayObjectOES,
-        kTypeWebGLVertexArrayObject,
-    };
-
-    explicit WebGLGetInfo(bool value);
-    WebGLGetInfo(const bool* value, int size);
-    explicit WebGLGetInfo(float value);
-    explicit WebGLGetInfo(int value);
-    // Represents the null value and type.
-    WebGLGetInfo();
-    explicit WebGLGetInfo(const String&amp; value);
-    explicit WebGLGetInfo(unsigned int value);
-    explicit WebGLGetInfo(long long value);
-    explicit WebGLGetInfo(PassRefPtr&lt;WebGLBuffer&gt; value);
-    explicit WebGLGetInfo(PassRefPtr&lt;Float32Array&gt; value);
-    explicit WebGLGetInfo(PassRefPtr&lt;WebGLFramebuffer&gt; value);
-    explicit WebGLGetInfo(PassRefPtr&lt;Int32Array&gt; value);
-    // FIXME: implement WebGLObjectArray
-    // WebGLGetInfo(PassRefPtr&lt;WebGLObjectArray&gt; value);
-    explicit WebGLGetInfo(PassRefPtr&lt;WebGLProgram&gt; value);
-    explicit WebGLGetInfo(PassRefPtr&lt;WebGLRenderbuffer&gt; value);
-    explicit WebGLGetInfo(PassRefPtr&lt;WebGLTexture&gt; value);
-    explicit WebGLGetInfo(PassRefPtr&lt;Uint8Array&gt; value);
-    explicit WebGLGetInfo(PassRefPtr&lt;Uint32Array&gt; value);
-    explicit WebGLGetInfo(PassRefPtr&lt;WebGLVertexArrayObjectOES&gt; value);
-#if ENABLE(WEBGL2)
-    explicit WebGLGetInfo(PassRefPtr&lt;WebGLVertexArrayObject&gt; value);
-#endif
-
-    ~WebGLGetInfo();
-
-    Type getType() const;
-
-    bool getBool() const;
-    const Vector&lt;bool&gt;&amp; getBoolArray() const;
-    float getFloat() const;
-    int getInt() const;
-    const String&amp; getString() const;
-    unsigned int getUnsignedInt() const;
-    long long getInt64() const;
-    WebGLBuffer* getWebGLBuffer() const;
-    Float32Array* getWebGLFloatArray() const;
-    WebGLFramebuffer* getWebGLFramebuffer() const;
-    Int32Array* getWebGLIntArray() const;
-    // FIXME: implement WebGLObjectArray
-    // WebGLObjectArray* getWebGLObjectArray() const;
-    WebGLProgram* getWebGLProgram() const;
-    WebGLRenderbuffer* getWebGLRenderbuffer() const;
-    WebGLTexture* getWebGLTexture() const;
-    Uint8Array* getWebGLUnsignedByteArray() const;
-    Uint32Array* getWebGLUnsignedIntArray() const;
-    WebGLVertexArrayObjectOES* getWebGLVertexArrayObjectOES() const;
-#if ENABLE(WEBGL2)
-    WebGLVertexArrayObject* getWebGLVertexArrayObject() const;
-#endif
-
-private:
-    Type m_type;
-    bool m_bool;
-    Vector&lt;bool&gt; m_boolArray;
-    float m_float;
-    int m_int;
-    String m_string;
-    unsigned int m_unsignedInt;
-    long long m_int64;
-    RefPtr&lt;WebGLBuffer&gt; m_webglBuffer;
-    RefPtr&lt;Float32Array&gt; m_webglFloatArray;
-    RefPtr&lt;WebGLFramebuffer&gt; m_webglFramebuffer;
-    RefPtr&lt;Int32Array&gt; m_webglIntArray;
-    // FIXME: implement WebGLObjectArray
-    // RefPtr&lt;WebGLObjectArray&gt; m_webglObjectArray;
-    RefPtr&lt;WebGLProgram&gt; m_webglProgram;
-    RefPtr&lt;WebGLRenderbuffer&gt; m_webglRenderbuffer;
-    RefPtr&lt;WebGLTexture&gt; m_webglTexture;
-    RefPtr&lt;Uint8Array&gt; m_webglUnsignedByteArray;
-    RefPtr&lt;Uint32Array&gt; m_webglUnsignedIntArray;
-    RefPtr&lt;WebGLVertexArrayObjectOES&gt; m_webglVertexArrayObjectOES;
-#if ENABLE(WEBGL2)
-    RefPtr&lt;WebGLVertexArrayObject&gt; m_webglVertexArrayObject;
-#endif
-};
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLObject.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLObject.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLObject.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,11 +24,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;WebGLObject.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> 
</span><del>-#include &quot;WebGLObject.h&quot;
-
</del><span class="cx"> #include &quot;WebGLCompressedTextureS3TC.h&quot;
</span><span class="cx"> #include &quot;WebGLContextGroup.h&quot;
</span><span class="cx"> #include &quot;WebGLDebugRendererInfo.h&quot;
</span><span class="lines">@@ -38,21 +37,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-WebGLObject::WebGLObject(WebGLRenderingContextBase&amp;)
-    : m_object(0)
-    , m_attachmentCount(0)
-    , m_deleted(false)
-{
-}
-
-WebGLObject::~WebGLObject()
-{
-}
-
</del><span class="cx"> void WebGLObject::setObject(Platform3DObject object)
</span><span class="cx"> {
</span><del>-    // object==0 &amp;&amp; m_deleted==false indicating an uninitialized state;
-    ASSERT(!m_object &amp;&amp; !m_deleted);
</del><ins>+    ASSERT(!m_object);
+    ASSERT(!m_deleted);
</ins><span class="cx">     m_object = object;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -79,9 +67,8 @@
</span><span class="cx"> void WebGLObject::detach()
</span><span class="cx"> {
</span><span class="cx">     m_attachmentCount = 0; // Make sure OpenGL resource is deleted.
</span><del>-    }
</del><ins>+}
</ins><span class="cx"> 
</span><del>-
</del><span class="cx"> void WebGLObject::onDetached(GraphicsContext3D* context3d)
</span><span class="cx"> {
</span><span class="cx">     if (m_attachmentCount)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLObject.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLObject.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLObject.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,17 +26,15 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include &quot;GraphicsContext3D.h&quot;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class GraphicsContext3D;
</del><span class="cx"> class WebGLContextGroup;
</span><span class="cx"> class WebGLRenderingContextBase;
</span><span class="cx"> 
</span><span class="cx"> class WebGLObject : public RefCounted&lt;WebGLObject&gt; {
</span><span class="cx"> public:
</span><del>-    virtual ~WebGLObject();
</del><ins>+    virtual ~WebGLObject() { }
</ins><span class="cx"> 
</span><span class="cx">     Platform3DObject object() const { return m_object; }
</span><span class="cx"> 
</span><span class="lines">@@ -57,7 +55,7 @@
</span><span class="cx">     virtual bool validate(const WebGLContextGroup*, const WebGLRenderingContextBase&amp;) const = 0;
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    WebGLObject(WebGLRenderingContextBase&amp;);
</del><ins>+    WebGLObject() = default;
</ins><span class="cx"> 
</span><span class="cx">     // setObject should be only called once right after creating a WebGLObject.
</span><span class="cx">     void setObject(Platform3DObject);
</span><span class="lines">@@ -72,9 +70,9 @@
</span><span class="cx">     virtual GraphicsContext3D* getAGraphicsContext3D() const = 0;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    Platform3DObject m_object;
-    unsigned m_attachmentCount;
-    bool m_deleted;
</del><ins>+    Platform3DObject m_object { 0 };
+    unsigned m_attachmentCount { 0 };
+    bool m_deleted { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLProgramcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLProgram.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLProgram.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLProgram.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -24,13 +24,13 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;WebGLProgram.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> 
</span><del>-#include &quot;WebGLProgram.h&quot;
-
</del><span class="cx"> #include &quot;WebGLContextGroup.h&quot;
</span><span class="cx"> #include &quot;WebGLRenderingContextBase.h&quot;
</span><ins>+#include &quot;WebGLShader.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -41,9 +41,6 @@
</span><span class="cx"> 
</span><span class="cx"> WebGLProgram::WebGLProgram(WebGLRenderingContextBase&amp; ctx)
</span><span class="cx">     : WebGLSharedObject(ctx)
</span><del>-    , m_linkStatus(false)
-    , m_linkCount(0)
-    , m_infoValid(true)
</del><span class="cx"> {
</span><span class="cx">     setObject(ctx.graphicsContext3D()-&gt;createProgram());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLProgramh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLProgram.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLProgram.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLProgram.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -25,18 +25,17 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include &quot;WebGLShader.h&quot;
</del><span class="cx"> #include &quot;WebGLSharedObject.h&quot;
</span><del>-#include &lt;wtf/Vector.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class WebGLShader;
+
</ins><span class="cx"> class WebGLProgram final : public WebGLSharedObject {
</span><span class="cx"> public:
</span><ins>+    static Ref&lt;WebGLProgram&gt; create(WebGLRenderingContextBase&amp;);
</ins><span class="cx">     virtual ~WebGLProgram();
</span><span class="cx"> 
</span><del>-    static Ref&lt;WebGLProgram&gt; create(WebGLRenderingContextBase&amp;);
-
</del><span class="cx">     unsigned numActiveAttribLocations();
</span><span class="cx">     GC3Dint getActiveAttribLocation(GC3Duint index);
</span><span class="cx"> 
</span><span class="lines">@@ -63,23 +62,20 @@
</span><span class="cx">     void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    bool isProgram() const override { return true; }
-
</del><span class="cx">     void cacheActiveAttribLocations(GraphicsContext3D*);
</span><span class="cx">     void cacheInfoIfNeeded();
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;GC3Dint&gt; m_activeAttribLocations;
</span><span class="cx"> 
</span><del>-    GC3Dint m_linkStatus;
</del><ins>+    GC3Dint m_linkStatus { 0 };
</ins><span class="cx"> 
</span><del>-    // This is used to track whether a WebGLUniformLocation belongs to this
-    // program or not.
-    unsigned m_linkCount;
</del><ins>+    // This is used to track whether a WebGLUniformLocation belongs to this program or not.
+    unsigned m_linkCount { 0 };
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;WebGLShader&gt; m_vertexShader;
</span><span class="cx">     RefPtr&lt;WebGLShader&gt; m_fragmentShader;
</span><span class="cx"> 
</span><del>-    bool m_infoValid;
</del><ins>+    bool m_infoValid { true };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLQueryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLQuery.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLQuery.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLQuery.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -31,17 +31,12 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGLQuery final : public WebGLSharedObject {
</span><span class="cx"> public:
</span><ins>+    static Ref&lt;WebGLQuery&gt; create(WebGLRenderingContextBase&amp;);
</ins><span class="cx">     virtual ~WebGLQuery();
</span><span class="cx"> 
</span><del>-    static Ref&lt;WebGLQuery&gt; create(WebGLRenderingContextBase&amp;);
-
</del><span class="cx"> protected:
</span><del>-    WebGLQuery(WebGLRenderingContextBase&amp;);
-
</del><ins>+    explicit WebGLQuery(WebGLRenderingContextBase&amp;);
</ins><span class="cx">     void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
</span><del>-
-private:
-    bool isQuery() const override { return true; }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,9 +24,9 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;WebGLRenderingContext.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><del>-#include &quot;WebGLRenderingContext.h&quot;
</del><span class="cx"> 
</span><span class="cx"> #include &quot;ANGLEInstancedArrays.h&quot;
</span><span class="cx"> #include &quot;CachedImage.h&quot;
</span><span class="lines">@@ -70,8 +70,8 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement&amp; passedCanvas, PassRefPtr&lt;GraphicsContext3D&gt; context,
-    GraphicsContext3DAttributes attributes) : WebGLRenderingContextBase(passedCanvas, context, attributes)
</del><ins>+WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement&amp; passedCanvas, Ref&lt;GraphicsContext3D&gt;&amp;&amp; context, GraphicsContext3DAttributes attributes)
+    : WebGLRenderingContextBase(passedCanvas, WTFMove(context), attributes)
</ins><span class="cx"> {
</span><span class="cx">     initializeVertexArrayObjects();
</span><span class="cx"> }
</span><span class="lines">@@ -78,8 +78,8 @@
</span><span class="cx"> 
</span><span class="cx"> void WebGLRenderingContext::initializeVertexArrayObjects()
</span><span class="cx"> {
</span><del>-    m_defaultVertexArrayObject = WebGLVertexArrayObjectOES::create(*this, WebGLVertexArrayObjectOES::VAOTypeDefault);
-    addContextObject(m_defaultVertexArrayObject.get());
</del><ins>+    m_defaultVertexArrayObject = WebGLVertexArrayObjectOES::create(*this, WebGLVertexArrayObjectOES::Type::Default);
+    addContextObject(*m_defaultVertexArrayObject);
</ins><span class="cx">     m_boundVertexArrayObject = m_defaultVertexArrayObject;
</span><span class="cx">     if (!isGLES2Compliant())
</span><span class="cx">         initVertexAttrib0();
</span><span class="lines">@@ -90,99 +90,91 @@
</span><span class="cx">     if (isContextLostOrPending())
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    if (equalIgnoringASCIICase(name, &quot;EXT_blend_minmax&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_EXT_blend_minmax&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;EXT_blend_minmax&quot;)) {
</ins><span class="cx">         if (!m_extBlendMinMax) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_EXT_blend_minmax&quot;);
-            m_extBlendMinMax = std::make_unique&lt;EXTBlendMinMax&gt;(*this);
</del><ins>+            m_extBlendMinMax = enableSupportedExtension(&quot;GL_EXT_blend_minmax&quot;)
+                ? std::make_unique&lt;EXTBlendMinMax&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_extBlendMinMax.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;EXT_sRGB&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_EXT_sRGB&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;EXT_sRGB&quot;)) {
</ins><span class="cx">         if (!m_extsRGB) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_EXT_sRGB&quot;);
-            m_extsRGB = std::make_unique&lt;EXTsRGB&gt;(*this);
</del><ins>+            m_extsRGB = enableSupportedExtension(&quot;GL_EXT_sRGB&quot;)
+                ? std::make_unique&lt;EXTsRGB&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_extsRGB.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;EXT_frag_depth&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_EXT_frag_depth&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;EXT_frag_depth&quot;)) {
</ins><span class="cx">         if (!m_extFragDepth) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_EXT_frag_depth&quot;);
-            m_extFragDepth = std::make_unique&lt;EXTFragDepth&gt;(*this);
</del><ins>+            m_extFragDepth = enableSupportedExtension(&quot;GL_EXT_frag_depth&quot;)
+                ? std::make_unique&lt;EXTFragDepth&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_extFragDepth.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;EXT_shader_texture_lod&quot;)
-        &amp;&amp; (m_context-&gt;getExtensions().supports(&quot;GL_EXT_shader_texture_lod&quot;) || m_context-&gt;getExtensions().supports(&quot;GL_ARB_shader_texture_lod&quot;))) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;EXT_shader_texture_lod&quot;)) {
</ins><span class="cx">         if (!m_extShaderTextureLOD) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_EXT_shader_texture_lod&quot;);
-            m_extShaderTextureLOD = std::make_unique&lt;EXTShaderTextureLOD&gt;(*this);
</del><ins>+            if (!(m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_EXT_shader_texture_lod&quot; }) || m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_ARB_shader_texture_lod&quot; })))
+                m_extShaderTextureLOD = nullptr;
+            else {
+                m_context-&gt;getExtensions().ensureEnabled(ASCIILiteral { &quot;GL_EXT_shader_texture_lod&quot; });
+                m_extShaderTextureLOD = std::make_unique&lt;EXTShaderTextureLOD&gt;(*this);
+            }
</ins><span class="cx">         }
</span><span class="cx">         return m_extShaderTextureLOD.get();
</span><span class="cx">     }
</span><del>-    if ((equalIgnoringASCIICase(name, &quot;EXT_texture_filter_anisotropic&quot;) || equalIgnoringASCIICase(name, &quot;WEBKIT_EXT_texture_filter_anisotropic&quot;))
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_EXT_texture_filter_anisotropic&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;EXT_texture_filter_anisotropic&quot;) || equalIgnoringASCIICase(name, &quot;WEBKIT_EXT_texture_filter_anisotropic&quot;)) {
</ins><span class="cx">         if (!m_extTextureFilterAnisotropic) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_EXT_texture_filter_anisotropic&quot;);
-            m_extTextureFilterAnisotropic = std::make_unique&lt;EXTTextureFilterAnisotropic&gt;(*this);
</del><ins>+            m_extTextureFilterAnisotropic = enableSupportedExtension(&quot;GL_EXT_texture_filter_anisotropic&quot;)
+                ? std::make_unique&lt;EXTTextureFilterAnisotropic&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_extTextureFilterAnisotropic.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;OES_standard_derivatives&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_OES_standard_derivatives&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;OES_standard_derivatives&quot;)) {
</ins><span class="cx">         if (!m_oesStandardDerivatives) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_OES_standard_derivatives&quot;);
-            m_oesStandardDerivatives = std::make_unique&lt;OESStandardDerivatives&gt;(*this);
</del><ins>+            m_oesStandardDerivatives = enableSupportedExtension(&quot;GL_OES_standard_derivatives&quot;)
+                ? std::make_unique&lt;OESStandardDerivatives&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_oesStandardDerivatives.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;OES_texture_float&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_float&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;OES_texture_float&quot;)) {
</ins><span class="cx">         if (!m_oesTextureFloat) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_OES_texture_float&quot;);
-            m_oesTextureFloat = std::make_unique&lt;OESTextureFloat&gt;(*this);
</del><ins>+            m_oesTextureFloat = enableSupportedExtension(&quot;GL_OES_texture_float&quot;)
+                ? std::make_unique&lt;OESTextureFloat&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_oesTextureFloat.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;OES_texture_float_linear&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_float_linear&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;OES_texture_float_linear&quot;)) {
</ins><span class="cx">         if (!m_oesTextureFloatLinear) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_OES_texture_float_linear&quot;);
-            m_oesTextureFloatLinear = std::make_unique&lt;OESTextureFloatLinear&gt;(*this);
</del><ins>+            m_oesTextureFloatLinear = enableSupportedExtension(&quot;GL_OES_texture_float_linear&quot;)
+                ? std::make_unique&lt;OESTextureFloatLinear&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_oesTextureFloatLinear.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;OES_texture_half_float&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_half_float&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;OES_texture_half_float&quot;)) {
</ins><span class="cx">         if (!m_oesTextureHalfFloat) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_OES_texture_half_float&quot;);
-            m_oesTextureHalfFloat = std::make_unique&lt;OESTextureHalfFloat&gt;(*this);
</del><ins>+            m_oesTextureHalfFloat = enableSupportedExtension(&quot;GL_OES_texture_half_float&quot;)
+                ? std::make_unique&lt;OESTextureHalfFloat&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_oesTextureHalfFloat.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;OES_texture_half_float_linear&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_half_float_linear&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;OES_texture_half_float_linear&quot;)) {
</ins><span class="cx">         if (!m_oesTextureHalfFloatLinear) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_OES_texture_half_float_linear&quot;);
-            m_oesTextureHalfFloatLinear = std::make_unique&lt;OESTextureHalfFloatLinear&gt;(*this);
</del><ins>+            m_oesTextureHalfFloatLinear = enableSupportedExtension(&quot;GL_OES_texture_half_float_linear&quot;)
+                ? std::make_unique&lt;OESTextureHalfFloatLinear&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_oesTextureHalfFloatLinear.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;OES_vertex_array_object&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_OES_vertex_array_object&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;OES_vertex_array_object&quot;)) {
</ins><span class="cx">         if (!m_oesVertexArrayObject) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_OES_vertex_array_object&quot;);
-            m_oesVertexArrayObject = std::make_unique&lt;OESVertexArrayObject&gt;(*this);
</del><ins>+            m_oesVertexArrayObject = enableSupportedExtension(&quot;GL_OES_vertex_array_object&quot;)
+                ? std::make_unique&lt;OESVertexArrayObject&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_oesVertexArrayObject.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;OES_element_index_uint&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_OES_element_index_uint&quot;)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;OES_element_index_uint&quot;)) {
</ins><span class="cx">         if (!m_oesElementIndexUint) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_OES_element_index_uint&quot;);
-            m_oesElementIndexUint = std::make_unique&lt;OESElementIndexUint&gt;(*this);
</del><ins>+            m_oesElementIndexUint = enableSupportedExtension(&quot;GL_OES_element_index_uint&quot;)
+                ? std::make_unique&lt;OESElementIndexUint&gt;(*this) : nullptr;
</ins><span class="cx">         }
</span><span class="cx">         return m_oesElementIndexUint.get();
</span><span class="cx">     }
</span><span class="lines">@@ -191,41 +183,53 @@
</span><span class="cx">             m_webglLoseContext = std::make_unique&lt;WebGLLoseContext&gt;(*this);
</span><span class="cx">         return m_webglLoseContext.get();
</span><span class="cx">     }
</span><del>-    if ((equalIgnoringASCIICase(name, &quot;WEBKIT_WEBGL_compressed_texture_atc&quot;))
-        &amp;&amp; WebGLCompressedTextureATC::supported(*this)) {
-        if (!m_webglCompressedTextureATC)
-            m_webglCompressedTextureATC = std::make_unique&lt;WebGLCompressedTextureATC&gt;(*this);
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;WEBKIT_WEBGL_compressed_texture_atc&quot;)) {
+        if (!m_webglCompressedTextureATC) {
+            m_webglCompressedTextureATC = WebGLCompressedTextureATC::supported(*this)
+                ? std::make_unique&lt;WebGLCompressedTextureATC&gt;(*this) : nullptr;
+        }
</ins><span class="cx">         return m_webglCompressedTextureATC.get();
</span><span class="cx">     }
</span><del>-    if ((equalIgnoringASCIICase(name, &quot;WEBKIT_WEBGL_compressed_texture_pvrtc&quot;))
-        &amp;&amp; WebGLCompressedTexturePVRTC::supported(*this)) {
-        if (!m_webglCompressedTexturePVRTC)
-            m_webglCompressedTexturePVRTC = std::make_unique&lt;WebGLCompressedTexturePVRTC&gt;(*this);
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;WEBKIT_WEBGL_compressed_texture_pvrtc&quot;)) {
+        if (!m_webglCompressedTexturePVRTC) {
+            m_webglCompressedTexturePVRTC = WebGLCompressedTexturePVRTC::supported(*this)
+                ? std::make_unique&lt;WebGLCompressedTexturePVRTC&gt;(*this) : nullptr;
+        }
</ins><span class="cx">         return m_webglCompressedTexturePVRTC.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;WEBGL_compressed_texture_s3tc&quot;)
-        &amp;&amp; WebGLCompressedTextureS3TC::supported(*this)) {
-        if (!m_webglCompressedTextureS3TC)
-            m_webglCompressedTextureS3TC = std::make_unique&lt;WebGLCompressedTextureS3TC&gt;(*this);
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;WEBGL_compressed_texture_s3tc&quot;)) {
+        if (!m_webglCompressedTextureS3TC) {
+            m_webglCompressedTextureS3TC = WebGLCompressedTextureS3TC::supported(*this)
+                ? std::make_unique&lt;WebGLCompressedTextureS3TC&gt;(*this) : nullptr;
+        }
</ins><span class="cx">         return m_webglCompressedTextureS3TC.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;WEBGL_depth_texture&quot;)
-        &amp;&amp; WebGLDepthTexture::supported(*graphicsContext3D())) {
-        if (!m_webglDepthTexture)
-            m_webglDepthTexture = std::make_unique&lt;WebGLDepthTexture&gt;(*this);
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;WEBGL_depth_texture&quot;)) {
+        if (!m_webglDepthTexture) {
+            m_webglDepthTexture = WebGLDepthTexture::supported(*m_context)
+                ? std::make_unique&lt;WebGLDepthTexture&gt;(*this) : nullptr;
+        }
</ins><span class="cx">         return m_webglDepthTexture.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;WEBGL_draw_buffers&quot;) &amp;&amp; supportsDrawBuffers()) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;WEBGL_draw_buffers&quot;)) {
</ins><span class="cx">         if (!m_webglDrawBuffers) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_EXT_draw_buffers&quot;);
-            m_webglDrawBuffers = std::make_unique&lt;WebGLDrawBuffers&gt;(*this);
</del><ins>+            if (!supportsDrawBuffers())
+                m_webglDrawBuffers = nullptr;
+            else {
+                m_context-&gt;getExtensions().ensureEnabled(ASCIILiteral { &quot;GL_EXT_draw_buffers&quot; });
+                m_webglDrawBuffers = std::make_unique&lt;WebGLDrawBuffers&gt;(*this);
+            }
</ins><span class="cx">         }
</span><span class="cx">         return m_webglDrawBuffers.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;ANGLE_instanced_arrays&quot;) &amp;&amp; ANGLEInstancedArrays::supported(*this)) {
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;ANGLE_instanced_arrays&quot;)) {
</ins><span class="cx">         if (!m_angleInstancedArrays) {
</span><del>-            m_context-&gt;getExtensions().ensureEnabled(&quot;GL_ANGLE_instanced_arrays&quot;);
-            m_angleInstancedArrays = std::make_unique&lt;ANGLEInstancedArrays&gt;(*this);
</del><ins>+            if (!ANGLEInstancedArrays::supported(*this))
+                m_angleInstancedArrays = nullptr;
+            else {
+                m_context-&gt;getExtensions().ensureEnabled(ASCIILiteral { &quot;GL_ANGLE_instanced_arrays&quot; });
+                m_angleInstancedArrays = std::make_unique&lt;ANGLEInstancedArrays&gt;(*this);
+            }
</ins><span class="cx">         }
</span><span class="cx">         return m_angleInstancedArrays.get();
</span><span class="cx">     }
</span><span class="lines">@@ -234,10 +238,11 @@
</span><span class="cx">             m_webglDebugRendererInfo = std::make_unique&lt;WebGLDebugRendererInfo&gt;(*this);
</span><span class="cx">         return m_webglDebugRendererInfo.get();
</span><span class="cx">     }
</span><del>-    if (equalIgnoringASCIICase(name, &quot;WEBGL_debug_shaders&quot;)
-        &amp;&amp; m_context-&gt;getExtensions().supports(&quot;GL_ANGLE_translated_shader_source&quot;)) {
-        if (!m_webglDebugShaders)
-            m_webglDebugShaders = std::make_unique&lt;WebGLDebugShaders&gt;(*this);
</del><ins>+    if (equalIgnoringASCIICase(name, &quot;WEBGL_debug_shaders&quot;)) {
+        if (!m_webglDebugShaders) {
+            m_webglDebugShaders = m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_ANGLE_translated_shader_source&quot; })
+                ? std::make_unique&lt;WebGLDebugShaders&gt;(*this) : nullptr;
+        }
</ins><span class="cx">         return m_webglDebugShaders.get();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -251,109 +256,109 @@
</span><span class="cx">     if (m_isPendingPolicyResolution)
</span><span class="cx">         return result;
</span><span class="cx">     
</span><del>-    if (m_context-&gt;getExtensions().supports(&quot;GL_EXT_blend_minmax&quot;))
-        result.append(&quot;EXT_blend_minmax&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_EXT_sRGB&quot;))
-        result.append(&quot;EXT_sRGB&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_EXT_frag_depth&quot;))
-        result.append(&quot;EXT_frag_depth&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_float&quot;))
-        result.append(&quot;OES_texture_float&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_float_linear&quot;))
-        result.append(&quot;OES_texture_float_linear&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_half_float&quot;))
-        result.append(&quot;OES_texture_half_float&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_OES_texture_half_float_linear&quot;))
-        result.append(&quot;OES_texture_half_float_linear&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_OES_standard_derivatives&quot;))
-        result.append(&quot;OES_standard_derivatives&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_EXT_shader_texture_lod&quot;) || m_context-&gt;getExtensions().supports(&quot;GL_ARB_shader_texture_lod&quot;))
-        result.append(&quot;EXT_shader_texture_lod&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_EXT_texture_filter_anisotropic&quot;))
-        result.append(&quot;EXT_texture_filter_anisotropic&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_OES_vertex_array_object&quot;))
-        result.append(&quot;OES_vertex_array_object&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_OES_element_index_uint&quot;))
-        result.append(&quot;OES_element_index_uint&quot;);
-    result.append(&quot;WEBGL_lose_context&quot;);
</del><ins>+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_EXT_blend_minmax&quot; }))
+        result.append(ASCIILiteral { &quot;EXT_blend_minmax&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_EXT_sRGB&quot; }))
+        result.append(ASCIILiteral { &quot;EXT_sRGB&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_EXT_frag_depth&quot; }))
+        result.append(ASCIILiteral { &quot;EXT_frag_depth&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_OES_texture_float&quot; }))
+        result.append(ASCIILiteral { &quot;OES_texture_float&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_OES_texture_float_linear&quot; }))
+        result.append(ASCIILiteral { &quot;OES_texture_float_linear&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_OES_texture_half_float&quot; }))
+        result.append(ASCIILiteral { &quot;OES_texture_half_float&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_OES_texture_half_float_linear&quot; }))
+        result.append(ASCIILiteral { &quot;OES_texture_half_float_linear&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_OES_standard_derivatives&quot; }))
+        result.append(ASCIILiteral { &quot;OES_standard_derivatives&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_EXT_shader_texture_lod&quot; }) || m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_ARB_shader_texture_lod&quot; }))
+        result.append(ASCIILiteral { &quot;EXT_shader_texture_lod&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_EXT_texture_filter_anisotropic&quot; }))
+        result.append(ASCIILiteral { &quot;EXT_texture_filter_anisotropic&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_OES_vertex_array_object&quot; }))
+        result.append(ASCIILiteral { &quot;OES_vertex_array_object&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_OES_element_index_uint&quot; }))
+        result.append(ASCIILiteral { &quot;OES_element_index_uint&quot; });
+    result.append(ASCIILiteral { &quot;WEBGL_lose_context&quot; });
</ins><span class="cx">     if (WebGLCompressedTextureATC::supported(*this))
</span><del>-        result.append(&quot;WEBKIT_WEBGL_compressed_texture_atc&quot;);
</del><ins>+        result.append(ASCIILiteral { &quot;WEBKIT_WEBGL_compressed_texture_atc&quot; });
</ins><span class="cx">     if (WebGLCompressedTexturePVRTC::supported(*this))
</span><del>-        result.append(&quot;WEBKIT_WEBGL_compressed_texture_pvrtc&quot;);
</del><ins>+        result.append(ASCIILiteral { &quot;WEBKIT_WEBGL_compressed_texture_pvrtc&quot; });
</ins><span class="cx">     if (WebGLCompressedTextureS3TC::supported(*this))
</span><span class="cx">         result.append(&quot;WEBGL_compressed_texture_s3tc&quot;);
</span><del>-    if (WebGLDepthTexture::supported(*graphicsContext3D()))
-        result.append(&quot;WEBGL_depth_texture&quot;);
</del><ins>+    if (WebGLDepthTexture::supported(*m_context))
+        result.append(ASCIILiteral { &quot;WEBGL_depth_texture&quot; });
</ins><span class="cx">     if (supportsDrawBuffers())
</span><del>-        result.append(&quot;WEBGL_draw_buffers&quot;);
</del><ins>+        result.append(ASCIILiteral { &quot;WEBGL_draw_buffers&quot; });
</ins><span class="cx">     if (ANGLEInstancedArrays::supported(*this))
</span><del>-        result.append(&quot;ANGLE_instanced_arrays&quot;);
-    if (m_context-&gt;getExtensions().supports(&quot;GL_ANGLE_translated_shader_source&quot;))
-        result.append(&quot;WEBGL_debug_shaders&quot;);
-    result.append(&quot;WEBGL_debug_renderer_info&quot;);
</del><ins>+        result.append(ASCIILiteral { &quot;ANGLE_instanced_arrays&quot; });
+    if (m_context-&gt;getExtensions().supports(ASCIILiteral { &quot;GL_ANGLE_translated_shader_source&quot; }))
+        result.append(ASCIILiteral { &quot;WEBGL_debug_shaders&quot; });
+    result.append(ASCIILiteral { &quot;WEBGL_debug_renderer_info&quot; });
</ins><span class="cx"> 
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname)
</del><ins>+WebGLAny WebGLRenderingContext::getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending() || !validateFramebufferFuncParameters(&quot;getFramebufferAttachmentParameter&quot;, target, attachment))
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     
</span><span class="cx">     if (!m_framebufferBinding || !m_framebufferBinding-&gt;object()) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, &quot;getFramebufferAttachmentParameter&quot;, &quot;no framebuffer bound&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx">     
</span><del>-    WebGLSharedObject* object = m_framebufferBinding-&gt;getAttachmentObject(attachment);
</del><ins>+    auto* object = m_framebufferBinding-&gt;getAttachmentObject(attachment);
</ins><span class="cx">     if (!object) {
</span><span class="cx">         if (pname == GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)
</span><del>-            return WebGLGetInfo(GraphicsContext3D::NONE);
</del><ins>+            return static_cast&lt;unsigned&gt;(GraphicsContext3D::NONE);
</ins><span class="cx">         // OpenGL ES 2.0 specifies INVALID_ENUM in this case, while desktop GL
</span><span class="cx">         // specifies INVALID_OPERATION.
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getFramebufferAttachmentParameter&quot;, &quot;invalid parameter name&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx">     
</span><del>-    ASSERT(object-&gt;isTexture() || object-&gt;isRenderbuffer());
</del><span class="cx">     if (object-&gt;isTexture()) {
</span><span class="cx">         switch (pname) {
</span><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
</span><del>-            return WebGLGetInfo(GraphicsContext3D::TEXTURE);
</del><ins>+            return static_cast&lt;unsigned&gt;(GraphicsContext3D::TEXTURE);
</ins><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
</span><del>-            return WebGLGetInfo(PassRefPtr&lt;WebGLTexture&gt;(reinterpret_cast&lt;WebGLTexture*&gt;(object)));
</del><ins>+            return makeRefPtr(reinterpret_cast&lt;WebGLTexture&amp;&gt;(*object));
</ins><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
</span><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
</span><span class="cx">         case Extensions3D::FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: {
</span><span class="cx">             GC3Dint value = 0;
</span><span class="cx">             m_context-&gt;getFramebufferAttachmentParameteriv(target, attachment, pname, &amp;value);
</span><del>-            return WebGLGetInfo(value);
</del><ins>+            return value;
</ins><span class="cx">         }
</span><span class="cx">         default:
</span><span class="cx">             synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getFramebufferAttachmentParameter&quot;, &quot;invalid parameter name for texture attachment&quot;);
</span><del>-            return WebGLGetInfo();
</del><ins>+            return nullptr;
</ins><span class="cx">         }
</span><span class="cx">     } else {
</span><ins>+        ASSERT(object-&gt;isRenderbuffer());
</ins><span class="cx">         switch (pname) {
</span><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
</span><del>-            return WebGLGetInfo(GraphicsContext3D::RENDERBUFFER);
</del><ins>+            return static_cast&lt;unsigned&gt;(GraphicsContext3D::RENDERBUFFER);
</ins><span class="cx">         case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
</span><del>-            return WebGLGetInfo(PassRefPtr&lt;WebGLRenderbuffer&gt;(reinterpret_cast&lt;WebGLRenderbuffer*&gt;(object)));
</del><ins>+            return makeRefPtr(reinterpret_cast&lt;WebGLRenderbuffer&amp;&gt;(*object));
</ins><span class="cx">         case Extensions3D::FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: {
</span><span class="cx">             if (!m_extsRGB) {
</span><span class="cx">                 synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getFramebufferAttachmentParameter&quot;, &quot;invalid parameter name for renderbuffer attachment&quot;);
</span><del>-                return WebGLGetInfo();
</del><ins>+                return nullptr;
</ins><span class="cx">             }
</span><span class="cx">             WebGLRenderbuffer* renderBuffer = reinterpret_cast&lt;WebGLRenderbuffer*&gt;(object);
</span><span class="cx">             GC3Denum renderBufferFormat = renderBuffer-&gt;getInternalFormat();
</span><span class="cx">             ASSERT(renderBufferFormat != Extensions3D::SRGB_EXT &amp;&amp; renderBufferFormat != Extensions3D::SRGB_ALPHA_EXT);
</span><span class="cx">             if (renderBufferFormat == Extensions3D::SRGB8_ALPHA8_EXT)
</span><del>-                return WebGLGetInfo(Extensions3D::SRGB_EXT);
-            return WebGLGetInfo(GraphicsContext3D::LINEAR);
</del><ins>+                return static_cast&lt;unsigned&gt;(Extensions3D::SRGB_EXT);
+            return static_cast&lt;unsigned&gt;(GraphicsContext3D::LINEAR);
</ins><span class="cx">         }
</span><span class="cx">         default:
</span><span class="cx">             synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getFramebufferAttachmentParameter&quot;, &quot;invalid parameter name for renderbuffer attachment&quot;);
</span><del>-            return WebGLGetInfo();
</del><ins>+            return nullptr;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -364,21 +369,22 @@
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, &quot;invalid target&quot;);
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><ins>+    // FIXME: Why does this return true unconditionally for COLOR_ATTACHMENT0,
+    // but false for other COLOR_ATTACHMENT values if m_webglDrawBuffers is false?
</ins><span class="cx">     switch (attachment) {
</span><span class="cx">     case GraphicsContext3D::COLOR_ATTACHMENT0:
</span><span class="cx">     case GraphicsContext3D::DEPTH_ATTACHMENT:
</span><span class="cx">     case GraphicsContext3D::STENCIL_ATTACHMENT:
</span><span class="cx">     case GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT:
</span><del>-        break;
</del><ins>+        return true;
</ins><span class="cx">     default:
</span><span class="cx">         if (m_webglDrawBuffers
</span><del>-            &amp;&amp; attachment &gt; GraphicsContext3D::COLOR_ATTACHMENT0
</del><ins>+            &amp;&amp; attachment &gt;= GraphicsContext3D::COLOR_ATTACHMENT0
</ins><span class="cx">             &amp;&amp; attachment &lt; static_cast&lt;GC3Denum&gt;(GraphicsContext3D::COLOR_ATTACHMENT0 + getMaxColorAttachments()))
</span><del>-            break;
</del><ins>+            return true;
</ins><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, &quot;invalid attachment&quot;);
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><del>-    return true;
</del><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void WebGLRenderingContext::renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height)
</span><span class="lines">@@ -455,7 +461,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     const char* reason = &quot;framebuffer incomplete&quot;;
</span><del>-    if (m_framebufferBinding &amp;&amp; !m_framebufferBinding-&gt;onAccess(graphicsContext3D(), &amp;reason)) {
</del><ins>+    if (m_framebufferBinding &amp;&amp; !m_framebufferBinding-&gt;onAccess(m_context.get(), &amp;reason)) {
</ins><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_FRAMEBUFFER_OPERATION, &quot;clear&quot;, reason);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -464,11 +470,11 @@
</span><span class="cx">     markContextChanged();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContext::getParameter(GC3Denum pname)
</del><ins>+WebGLAny WebGLRenderingContext::getParameter(GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending())
</span><del>-        return WebGLGetInfo();
-    const int intZero = 0;
</del><ins>+        return nullptr;
+
</ins><span class="cx">     switch (pname) {
</span><span class="cx">     case GraphicsContext3D::ACTIVE_TEXTURE:
</span><span class="cx">         return getUnsignedIntParameter(pname);
</span><span class="lines">@@ -479,7 +485,7 @@
</span><span class="cx">     case GraphicsContext3D::ALPHA_BITS:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::ARRAY_BUFFER_BINDING:
</span><del>-        return WebGLGetInfo(PassRefPtr&lt;WebGLBuffer&gt;(m_boundArrayBuffer));
</del><ins>+        return m_boundArrayBuffer;
</ins><span class="cx">     case GraphicsContext3D::BLEND:
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::BLEND_COLOR:
</span><span class="lines">@@ -503,16 +509,16 @@
</span><span class="cx">     case GraphicsContext3D::COLOR_WRITEMASK:
</span><span class="cx">         return getBooleanArrayParameter(pname);
</span><span class="cx">     case GraphicsContext3D::COMPRESSED_TEXTURE_FORMATS:
</span><del>-        return WebGLGetInfo(PassRefPtr&lt;Uint32Array&gt;(Uint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size())));
</del><ins>+        return Uint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size());
</ins><span class="cx">     case GraphicsContext3D::CULL_FACE:
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::CULL_FACE_MODE:
</span><span class="cx">         return getUnsignedIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::CURRENT_PROGRAM:
</span><del>-        return WebGLGetInfo(PassRefPtr&lt;WebGLProgram&gt;(m_currentProgram));
</del><ins>+        return m_currentProgram;
</ins><span class="cx">     case GraphicsContext3D::DEPTH_BITS:
</span><span class="cx">         if (!m_framebufferBinding &amp;&amp; !m_attributes.depth)
</span><del>-            return WebGLGetInfo(intZero);
</del><ins>+            return 0;
</ins><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::DEPTH_CLEAR_VALUE:
</span><span class="cx">         return getFloatParameter(pname);
</span><span class="lines">@@ -527,9 +533,9 @@
</span><span class="cx">     case GraphicsContext3D::DITHER:
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::ELEMENT_ARRAY_BUFFER_BINDING:
</span><del>-        return WebGLGetInfo(PassRefPtr&lt;WebGLBuffer&gt;(m_boundVertexArrayObject-&gt;getElementArrayBuffer()));
</del><ins>+        return makeRefPtr(m_boundVertexArrayObject-&gt;getElementArrayBuffer());
</ins><span class="cx">     case GraphicsContext3D::FRAMEBUFFER_BINDING:
</span><del>-        return WebGLGetInfo(PassRefPtr&lt;WebGLFramebuffer&gt;(m_framebufferBinding));
</del><ins>+        return m_framebufferBinding;
</ins><span class="cx">     case GraphicsContext3D::FRONT_FACE:
</span><span class="cx">         return getUnsignedIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::GENERATE_MIPMAP_HINT:
</span><span class="lines">@@ -577,9 +583,9 @@
</span><span class="cx">     case GraphicsContext3D::RED_BITS:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::RENDERBUFFER_BINDING:
</span><del>-        return WebGLGetInfo(PassRefPtr&lt;WebGLRenderbuffer&gt;(m_renderbufferBinding));
</del><ins>+        return m_renderbufferBinding;
</ins><span class="cx">     case GraphicsContext3D::RENDERER:
</span><del>-        return WebGLGetInfo(String(&quot;WebKit WebGL&quot;));
</del><ins>+        return String { ASCIILiteral { &quot;WebKit WebGL&quot; } };
</ins><span class="cx">     case GraphicsContext3D::SAMPLE_BUFFERS:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::SAMPLE_COVERAGE_INVERT:
</span><span class="lines">@@ -593,7 +599,7 @@
</span><span class="cx">     case GraphicsContext3D::SCISSOR_TEST:
</span><span class="cx">         return getBooleanParameter(pname);
</span><span class="cx">     case GraphicsContext3D::SHADING_LANGUAGE_VERSION:
</span><del>-        return WebGLGetInfo(&quot;WebGL GLSL ES 1.0 (&quot; + m_context-&gt;getString(GraphicsContext3D::SHADING_LANGUAGE_VERSION) + &quot;)&quot;);
</del><ins>+        return &quot;WebGL GLSL ES 1.0 (&quot; + m_context-&gt;getString(GraphicsContext3D::SHADING_LANGUAGE_VERSION) + &quot;)&quot;;
</ins><span class="cx">     case GraphicsContext3D::STENCIL_BACK_FAIL:
</span><span class="cx">         return getUnsignedIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::STENCIL_BACK_FUNC:
</span><span class="lines">@@ -610,7 +616,7 @@
</span><span class="cx">         return getUnsignedIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::STENCIL_BITS:
</span><span class="cx">         if (!m_framebufferBinding &amp;&amp; !m_attributes.stencil)
</span><del>-            return WebGLGetInfo(intZero);
</del><ins>+            return 0;
</ins><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::STENCIL_CLEAR_VALUE:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="lines">@@ -633,21 +639,21 @@
</span><span class="cx">     case GraphicsContext3D::SUBPIXEL_BITS:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::TEXTURE_BINDING_2D:
</span><del>-        return WebGLGetInfo(PassRefPtr&lt;WebGLTexture&gt;(m_textureUnits[m_activeTextureUnit].texture2DBinding));
</del><ins>+        return m_textureUnits[m_activeTextureUnit].texture2DBinding;
</ins><span class="cx">     case GraphicsContext3D::TEXTURE_BINDING_CUBE_MAP:
</span><del>-        return WebGLGetInfo(PassRefPtr&lt;WebGLTexture&gt;(m_textureUnits[m_activeTextureUnit].textureCubeMapBinding));
</del><ins>+        return m_textureUnits[m_activeTextureUnit].textureCubeMapBinding;
</ins><span class="cx">     case GraphicsContext3D::UNPACK_ALIGNMENT:
</span><span class="cx">         return getIntParameter(pname);
</span><span class="cx">     case GraphicsContext3D::UNPACK_FLIP_Y_WEBGL:
</span><del>-        return WebGLGetInfo(m_unpackFlipY);
</del><ins>+        return m_unpackFlipY;
</ins><span class="cx">     case GraphicsContext3D::UNPACK_PREMULTIPLY_ALPHA_WEBGL:
</span><del>-        return WebGLGetInfo(m_unpackPremultiplyAlpha);
</del><ins>+        return m_unpackPremultiplyAlpha;
</ins><span class="cx">     case GraphicsContext3D::UNPACK_COLORSPACE_CONVERSION_WEBGL:
</span><del>-        return WebGLGetInfo(m_unpackColorspaceConversion);
</del><ins>+        return m_unpackColorspaceConversion;
</ins><span class="cx">     case GraphicsContext3D::VENDOR:
</span><del>-        return WebGLGetInfo(String(&quot;WebKit&quot;));
</del><ins>+        return String { ASCIILiteral { &quot;WebKit&quot; } };
</ins><span class="cx">     case GraphicsContext3D::VERSION:
</span><del>-        return WebGLGetInfo(&quot;WebGL 1.0 (&quot; + m_context-&gt;getString(GraphicsContext3D::VERSION) + &quot;)&quot;);
</del><ins>+        return &quot;WebGL 1.0 (&quot; + m_context-&gt;getString(GraphicsContext3D::VERSION) + &quot;)&quot;;
</ins><span class="cx">     case GraphicsContext3D::VIEWPORT:
</span><span class="cx">         return getWebGLIntArrayParameter(pname);
</span><span class="cx">     case Extensions3D::FRAGMENT_SHADER_DERIVATIVE_HINT_OES: // OES_standard_derivatives
</span><span class="lines">@@ -654,40 +660,40 @@
</span><span class="cx">         if (m_oesStandardDerivatives)
</span><span class="cx">             return getUnsignedIntParameter(Extensions3D::FRAGMENT_SHADER_DERIVATIVE_HINT_OES);
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name, OES_standard_derivatives not enabled&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     case WebGLDebugRendererInfo::UNMASKED_RENDERER_WEBGL:
</span><span class="cx">         if (m_webglDebugRendererInfo)
</span><del>-            return WebGLGetInfo(m_context-&gt;getString(GraphicsContext3D::RENDERER));
</del><ins>+            return m_context-&gt;getString(GraphicsContext3D::RENDERER);
</ins><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name, WEBGL_debug_renderer_info not enabled&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     case WebGLDebugRendererInfo::UNMASKED_VENDOR_WEBGL:
</span><span class="cx">         if (m_webglDebugRendererInfo)
</span><del>-            return WebGLGetInfo(m_context-&gt;getString(GraphicsContext3D::VENDOR));
</del><ins>+            return m_context-&gt;getString(GraphicsContext3D::VENDOR);
</ins><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name, WEBGL_debug_renderer_info not enabled&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     case Extensions3D::VERTEX_ARRAY_BINDING_OES: // OES_vertex_array_object
</span><span class="cx">         if (m_oesVertexArrayObject) {
</span><del>-            if (!m_boundVertexArrayObject-&gt;isDefaultObject())
-                return WebGLGetInfo(PassRefPtr&lt;WebGLVertexArrayObjectOES&gt;(static_cast&lt;WebGLVertexArrayObjectOES*&gt;(m_boundVertexArrayObject.get())));
-            return WebGLGetInfo();
</del><ins>+            if (m_boundVertexArrayObject-&gt;isDefaultObject())
+                return nullptr;
+            return makeRefPtr(static_cast&lt;WebGLVertexArrayObjectOES&amp;&gt;(*m_boundVertexArrayObject));
</ins><span class="cx">         }
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name, OES_vertex_array_object not enabled&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     case Extensions3D::MAX_TEXTURE_MAX_ANISOTROPY_EXT: // EXT_texture_filter_anisotropic
</span><span class="cx">         if (m_extTextureFilterAnisotropic)
</span><span class="cx">             return getUnsignedIntParameter(Extensions3D::MAX_TEXTURE_MAX_ANISOTROPY_EXT);
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name, EXT_texture_filter_anisotropic not enabled&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     case Extensions3D::MAX_COLOR_ATTACHMENTS_EXT: // EXT_draw_buffers BEGIN
</span><span class="cx">         if (m_webglDrawBuffers)
</span><del>-            return WebGLGetInfo(getMaxColorAttachments());
</del><ins>+            return getMaxColorAttachments();
</ins><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name, WEBGL_draw_buffers not enabled&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     case Extensions3D::MAX_DRAW_BUFFERS_EXT:
</span><span class="cx">         if (m_webglDrawBuffers)
</span><del>-            return WebGLGetInfo(getMaxDrawBuffers());
</del><ins>+            return getMaxDrawBuffers();
</ins><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name, WEBGL_draw_buffers not enabled&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     default:
</span><span class="cx">         if (m_webglDrawBuffers
</span><span class="cx">             &amp;&amp; pname &gt;= Extensions3D::DRAW_BUFFER0_EXT
</span><span class="lines">@@ -697,10 +703,10 @@
</span><span class="cx">                 value = m_framebufferBinding-&gt;getDrawBuffer(pname);
</span><span class="cx">             else // emulated backbuffer
</span><span class="cx">                 value = m_backDrawBuffer;
</span><del>-            return WebGLGetInfo(value);
</del><ins>+            return value;
</ins><span class="cx">         }
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getParameter&quot;, &quot;invalid parameter name&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -32,16 +32,16 @@
</span><span class="cx"> class WebGLRenderingContext final : public WebGLRenderingContextBase {
</span><span class="cx"> public:
</span><span class="cx">     WebGLRenderingContext(HTMLCanvasElement&amp;, GraphicsContext3DAttributes);
</span><del>-    WebGLRenderingContext(HTMLCanvasElement&amp;, PassRefPtr&lt;GraphicsContext3D&gt;, GraphicsContext3DAttributes);
</del><ins>+    WebGLRenderingContext(HTMLCanvasElement&amp;, Ref&lt;GraphicsContext3D&gt;&amp;&amp;, GraphicsContext3DAttributes);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     bool isWebGL1() const final { return true; }
</span><span class="cx"> 
</span><span class="cx">     WebGLExtension* getExtension(const String&amp;) final;
</span><del>-    WebGLGetInfo getParameter(GC3Denum pname) final;
</del><ins>+    WebGLAny getParameter(GC3Denum pname) final;
</ins><span class="cx">     Vector&lt;String&gt; getSupportedExtensions() final;
</span><span class="cx"> 
</span><del>-    WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) final;
</del><ins>+    WebGLAny getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) final;
</ins><span class="cx">     void renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height) final;
</span><span class="cx">     bool validateFramebufferFuncParameters(const char* functionName, GC3Denum target, GC3Denum attachment) final;
</span><span class="cx">     void hint(GC3Denum target, GC3Denum mode) final;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,9 +24,9 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;WebGLRenderingContextBase.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><del>-#include &quot;WebGLRenderingContextBase.h&quot;
</del><span class="cx"> 
</span><span class="cx"> #include &quot;ANGLEInstancedArrays.h&quot;
</span><span class="cx"> #include &quot;CachedImage.h&quot;
</span><span class="lines">@@ -423,17 +423,15 @@
</span><span class="cx">         return renderingContext;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    HostWindow* hostWindow = document.view()-&gt;root()-&gt;hostWindow();
-    RefPtr&lt;GraphicsContext3D&gt; context(GraphicsContext3D::create(attributes, hostWindow));
-
</del><ins>+    auto context = GraphicsContext3D::create(attributes, document.view()-&gt;root()-&gt;hostWindow());
</ins><span class="cx">     if (!context || !context-&gt;makeContextCurrent()) {
</span><span class="cx">         canvas.dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextcreationerrorEvent, false, true, &quot;Could not create a WebGL context.&quot;));
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Extensions3D&amp; extensions = context-&gt;getExtensions();
-    if (extensions.supports(&quot;GL_EXT_debug_marker&quot;))
-        extensions.pushGroupMarkerEXT(&quot;WebGLRenderingContext&quot;);
</del><ins>+    auto&amp; extensions = context-&gt;getExtensions();
+    if (extensions.supports(ASCIILiteral { &quot;GL_EXT_debug_marker&quot; }))
+        extensions.pushGroupMarkerEXT(ASCIILiteral { &quot;WebGLRenderingContext&quot; });
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL2) &amp;&amp; PLATFORM(MAC)
</span><span class="cx">     // glTexStorage() was only added to Core in OpenGL 4.2.
</span><span class="lines">@@ -442,13 +440,13 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;WebGLRenderingContextBase&gt; renderingContext = nullptr;
</del><ins>+    std::unique_ptr&lt;WebGLRenderingContextBase&gt; renderingContext;
</ins><span class="cx"> #if ENABLE(WEBGL2)
</span><span class="cx">     if (type == &quot;webgl2&quot;)
</span><del>-        renderingContext = std::make_unique&lt;WebGL2RenderingContext&gt;(canvas, WTFMove(context), attributes);
</del><ins>+        renderingContext = std::make_unique&lt;WebGL2RenderingContext&gt;(canvas, context.releaseNonNull(), attributes);
</ins><span class="cx">     else
</span><span class="cx"> #endif
</span><del>-        renderingContext = std::make_unique&lt;WebGLRenderingContext&gt;(canvas, WTFMove(context), attributes);
</del><ins>+        renderingContext = std::make_unique&lt;WebGLRenderingContext&gt;(canvas, context.releaseNonNull(), attributes);
</ins><span class="cx">     renderingContext-&gt;suspendIfNeeded();
</span><span class="cx"> 
</span><span class="cx">     return renderingContext;
</span><span class="lines">@@ -457,44 +455,29 @@
</span><span class="cx"> WebGLRenderingContextBase::WebGLRenderingContextBase(HTMLCanvasElement&amp; passedCanvas, WebGLContextAttributes attributes)
</span><span class="cx">     : CanvasRenderingContext(passedCanvas)
</span><span class="cx">     , ActiveDOMObject(&amp;passedCanvas.document())
</span><del>-    , m_context(nullptr)
</del><span class="cx">     , m_dispatchContextLostEventTimer(*this, &amp;WebGLRenderingContextBase::dispatchContextLostEvent)
</span><del>-    , m_restoreAllowed(false)
</del><span class="cx">     , m_restoreTimer(*this, &amp;WebGLRenderingContextBase::maybeRestoreContext)
</span><del>-    , m_generatedImageCache(0)
-    , m_contextLost(false)
-    , m_contextLostMode(SyntheticLostContext)
</del><span class="cx">     , m_attributes(attributes)
</span><del>-    , m_synthesizedErrorsToConsole(true)
</del><span class="cx">     , m_numGLErrorsToConsoleAllowed(maxGLErrorsAllowedToConsole)
</span><span class="cx">     , m_isPendingPolicyResolution(true)
</span><del>-    , m_hasRequestedPolicyResolution(false)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLRenderingContextBase::WebGLRenderingContextBase(HTMLCanvasElement&amp; passedCanvas, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp; context, WebGLContextAttributes attributes)
</del><ins>+WebGLRenderingContextBase::WebGLRenderingContextBase(HTMLCanvasElement&amp; passedCanvas, Ref&lt;GraphicsContext3D&gt;&amp;&amp; context, WebGLContextAttributes attributes)
</ins><span class="cx">     : CanvasRenderingContext(passedCanvas)
</span><span class="cx">     , ActiveDOMObject(&amp;passedCanvas.document())
</span><span class="cx">     , m_context(WTFMove(context))
</span><span class="cx">     , m_dispatchContextLostEventTimer(*this, &amp;WebGLRenderingContextBase::dispatchContextLostEvent)
</span><del>-    , m_restoreAllowed(false)
</del><span class="cx">     , m_restoreTimer(*this, &amp;WebGLRenderingContextBase::maybeRestoreContext)
</span><span class="cx">     , m_generatedImageCache(4)
</span><del>-    , m_contextLost(false)
-    , m_contextLostMode(SyntheticLostContext)
</del><span class="cx">     , m_attributes(attributes)
</span><del>-    , m_synthesizedErrorsToConsole(true)
</del><span class="cx">     , m_numGLErrorsToConsoleAllowed(maxGLErrorsAllowedToConsole)
</span><del>-    , m_isPendingPolicyResolution(false)
-    , m_hasRequestedPolicyResolution(false)
</del><span class="cx"> {
</span><del>-    ASSERT(m_context);
</del><span class="cx">     m_contextGroup = WebGLContextGroup::create();
</span><del>-    m_contextGroup-&gt;addContext(this);
</del><ins>+    m_contextGroup-&gt;addContext(*this);
</ins><span class="cx">     
</span><span class="cx">     m_context-&gt;setWebGLContext(this);
</span><span class="cx"> 
</span><del>-    m_maxViewportDims[0] = m_maxViewportDims[1] = 0;
</del><span class="cx">     m_context-&gt;getIntegerv(GraphicsContext3D::MAX_VIEWPORT_DIMS, m_maxViewportDims);
</span><span class="cx"> 
</span><span class="cx">     setupFlags();
</span><span class="lines">@@ -622,7 +605,7 @@
</span><span class="cx">     if (!m_isPendingPolicyResolution) {
</span><span class="cx">         detachAndRemoveAllObjects();
</span><span class="cx">         destroyGraphicsContext3D();
</span><del>-        m_contextGroup-&gt;removeContext(this);
</del><ins>+        m_contextGroup-&gt;removeContext(*this);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -916,7 +899,7 @@
</span><span class="cx">     if (!checkObjectToBeBound(&quot;bindBuffer&quot;, buffer, deleted))
</span><span class="cx">         return;
</span><span class="cx">     if (deleted)
</span><del>-        buffer = 0;
</del><ins>+        buffer = nullptr;
</ins><span class="cx">     if (buffer &amp;&amp; buffer-&gt;getTarget() &amp;&amp; buffer-&gt;getTarget() != target) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, &quot;bindBuffer&quot;, &quot;buffers can not be used with multiple targets&quot;);
</span><span class="cx">         return;
</span><span class="lines">@@ -1398,7 +1381,7 @@
</span><span class="cx">     if (isContextLostOrPending())
</span><span class="cx">         return nullptr;
</span><span class="cx">     auto buffer = WebGLBuffer::create(*this);
</span><del>-    addSharedObject(buffer.ptr());
</del><ins>+    addSharedObject(buffer.get());
</ins><span class="cx">     return WTFMove(buffer);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1407,7 +1390,7 @@
</span><span class="cx">     if (isContextLostOrPending())
</span><span class="cx">         return nullptr;
</span><span class="cx">     auto buffer = WebGLFramebuffer::create(*this);
</span><del>-    addContextObject(buffer.ptr());
</del><ins>+    addContextObject(buffer.get());
</ins><span class="cx">     return WTFMove(buffer);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1416,7 +1399,7 @@
</span><span class="cx">     if (isContextLostOrPending())
</span><span class="cx">         return nullptr;
</span><span class="cx">     auto texture = WebGLTexture::create(*this);
</span><del>-    addSharedObject(texture.ptr());
</del><ins>+    addSharedObject(texture.get());
</ins><span class="cx">     return WTFMove(texture);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1425,7 +1408,7 @@
</span><span class="cx">     if (isContextLostOrPending())
</span><span class="cx">         return nullptr;
</span><span class="cx">     auto program = WebGLProgram::create(*this);
</span><del>-    addSharedObject(program.ptr());
</del><ins>+    addSharedObject(program.get());
</ins><span class="cx">     return WTFMove(program);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1434,7 +1417,7 @@
</span><span class="cx">     if (isContextLostOrPending())
</span><span class="cx">         return nullptr;
</span><span class="cx">     auto buffer = WebGLRenderbuffer::create(*this);
</span><del>-    addSharedObject(buffer.ptr());
</del><ins>+    addSharedObject(buffer.get());
</ins><span class="cx">     return WTFMove(buffer);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1448,7 +1431,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto shader = WebGLShader::create(*this, type);
</span><del>-    addSharedObject(shader.ptr());
</del><ins>+    addSharedObject(shader.get());
</ins><span class="cx">     return WTFMove(shader);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1481,7 +1464,7 @@
</span><span class="cx">     if (m_boundArrayBuffer == buffer)
</span><span class="cx">         m_boundArrayBuffer = nullptr;
</span><span class="cx"> 
</span><del>-    m_boundVertexArrayObject-&gt;unbindBuffer(buffer);
</del><ins>+    m_boundVertexArrayObject-&gt;unbindBuffer(*buffer);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGLRenderingContextBase::deleteFramebuffer(WebGLFramebuffer* framebuffer)
</span><span class="lines">@@ -2187,10 +2170,10 @@
</span><span class="cx">     return m_context-&gt;getAttribLocation(objectOrZero(program), name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getBufferParameter(GC3Denum target, GC3Denum pname)
</del><ins>+WebGLAny WebGLRenderingContextBase::getBufferParameter(GC3Denum target, GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending())
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     bool valid = false;
</span><span class="cx">     if (target == GraphicsContext3D::ARRAY_BUFFER || target == GraphicsContext3D::ELEMENT_ARRAY_BUFFER)
</span><span class="lines">@@ -2210,19 +2193,19 @@
</span><span class="cx"> #endif
</span><span class="cx">     if (!valid) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getBufferParameter&quot;, &quot;invalid target&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (pname != GraphicsContext3D::BUFFER_SIZE &amp;&amp; pname != GraphicsContext3D::BUFFER_USAGE) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getBufferParameter&quot;, &quot;invalid parameter name&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     GC3Dint value = 0;
</span><span class="cx">     m_context-&gt;getBufferParameteriv(target, pname, &amp;value);
</span><span class="cx">     if (pname == GraphicsContext3D::BUFFER_SIZE)
</span><del>-        return WebGLGetInfo(value);
-    return WebGLGetInfo(static_cast&lt;unsigned int&gt;(value));
</del><ins>+        return value;
+    return static_cast&lt;unsigned&gt;(value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::optional&lt;WebGLContextAttributes&gt; WebGLRenderingContextBase::getContextAttributes()
</span><span class="lines">@@ -2249,30 +2232,30 @@
</span><span class="cx">     return m_context-&gt;getError();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getProgramParameter(WebGLProgram* program, GC3Denum pname)
</del><ins>+WebGLAny WebGLRenderingContextBase::getProgramParameter(WebGLProgram* program, GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending() || !validateWebGLObject(&quot;getProgramParameter&quot;, program))
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     GC3Dint value = 0;
</span><span class="cx">     switch (pname) {
</span><span class="cx">     case GraphicsContext3D::DELETE_STATUS:
</span><del>-        return WebGLGetInfo(program-&gt;isDeleted());
</del><ins>+        return program-&gt;isDeleted();
</ins><span class="cx">     case GraphicsContext3D::VALIDATE_STATUS:
</span><span class="cx">         m_context-&gt;getProgramiv(objectOrZero(program), pname, &amp;value);
</span><del>-        return WebGLGetInfo(static_cast&lt;bool&gt;(value));
</del><ins>+        return static_cast&lt;bool&gt;(value);
</ins><span class="cx">     case GraphicsContext3D::LINK_STATUS:
</span><del>-        return WebGLGetInfo(program-&gt;getLinkStatus());
</del><ins>+        return program-&gt;getLinkStatus();
</ins><span class="cx">     case GraphicsContext3D::ATTACHED_SHADERS:
</span><span class="cx">         m_context-&gt;getProgramiv(objectOrZero(program), pname, &amp;value);
</span><del>-        return WebGLGetInfo(value);
</del><ins>+        return value;
</ins><span class="cx">     case GraphicsContext3D::ACTIVE_ATTRIBUTES:
</span><span class="cx">     case GraphicsContext3D::ACTIVE_UNIFORMS:
</span><span class="cx">         m_context-&gt;getNonBuiltInActiveSymbolCount(objectOrZero(program), pname, &amp;value);
</span><del>-        return WebGLGetInfo(value);
</del><ins>+        return value;
</ins><span class="cx">     default:
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getProgramParameter&quot;, &quot;invalid parameter name&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2283,17 +2266,17 @@
</span><span class="cx">     return ensureNotNull(m_context-&gt;getProgramInfoLog(objectOrZero(program)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getRenderbufferParameter(GC3Denum target, GC3Denum pname)
</del><ins>+WebGLAny WebGLRenderingContextBase::getRenderbufferParameter(GC3Denum target, GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending())
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     if (target != GraphicsContext3D::RENDERBUFFER) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getRenderbufferParameter&quot;, &quot;invalid target&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx">     if (!m_renderbufferBinding || !m_renderbufferBinding-&gt;object()) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, &quot;getRenderbufferParameter&quot;, &quot;no renderbuffer bound&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_renderbufferBinding-&gt;getInternalFormat() == GraphicsContext3D::DEPTH_STENCIL
</span><span class="lines">@@ -2320,12 +2303,12 @@
</span><span class="cx">             value = 8;
</span><span class="cx">             break;
</span><span class="cx">         case GraphicsContext3D::RENDERBUFFER_INTERNAL_FORMAT:
</span><del>-            return WebGLGetInfo(m_renderbufferBinding-&gt;getInternalFormat());
</del><ins>+            return m_renderbufferBinding-&gt;getInternalFormat();
</ins><span class="cx">         default:
</span><span class="cx">             synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getRenderbufferParameter&quot;, &quot;invalid parameter name&quot;);
</span><del>-            return WebGLGetInfo();
</del><ins>+            return nullptr;
</ins><span class="cx">         }
</span><del>-        return WebGLGetInfo(value);
</del><ins>+        return value;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     GC3Dint value = 0;
</span><span class="lines">@@ -2339,32 +2322,32 @@
</span><span class="cx">     case GraphicsContext3D::RENDERBUFFER_DEPTH_SIZE:
</span><span class="cx">     case GraphicsContext3D::RENDERBUFFER_STENCIL_SIZE:
</span><span class="cx">         m_context-&gt;getRenderbufferParameteriv(target, pname, &amp;value);
</span><del>-        return WebGLGetInfo(value);
</del><ins>+        return value;
</ins><span class="cx">     case GraphicsContext3D::RENDERBUFFER_INTERNAL_FORMAT:
</span><del>-        return WebGLGetInfo(m_renderbufferBinding-&gt;getInternalFormat());
</del><ins>+        return m_renderbufferBinding-&gt;getInternalFormat();
</ins><span class="cx">     default:
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getRenderbufferParameter&quot;, &quot;invalid parameter name&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getShaderParameter(WebGLShader* shader, GC3Denum pname)
</del><ins>+WebGLAny WebGLRenderingContextBase::getShaderParameter(WebGLShader* shader, GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending() || !validateWebGLObject(&quot;getShaderParameter&quot;, shader))
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     GC3Dint value = 0;
</span><span class="cx">     switch (pname) {
</span><span class="cx">     case GraphicsContext3D::DELETE_STATUS:
</span><del>-        return WebGLGetInfo(shader-&gt;isDeleted());
</del><ins>+        return shader-&gt;isDeleted();
</ins><span class="cx">     case GraphicsContext3D::COMPILE_STATUS:
</span><span class="cx">         m_context-&gt;getShaderiv(objectOrZero(shader), pname, &amp;value);
</span><del>-        return WebGLGetInfo(static_cast&lt;bool&gt;(value));
</del><ins>+        return static_cast&lt;bool&gt;(value);
</ins><span class="cx">     case GraphicsContext3D::SHADER_TYPE:
</span><span class="cx">         m_context-&gt;getShaderiv(objectOrZero(shader), pname, &amp;value);
</span><del>-        return WebGLGetInfo(static_cast&lt;unsigned int&gt;(value));
</del><ins>+        return static_cast&lt;unsigned&gt;(value);
</ins><span class="cx">     default:
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getShaderParameter&quot;, &quot;invalid parameter name&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2413,13 +2396,13 @@
</span><span class="cx">     return ensureNotNull(shader-&gt;getSource());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getTexParameter(GC3Denum target, GC3Denum pname)
</del><ins>+WebGLAny WebGLRenderingContextBase::getTexParameter(GC3Denum target, GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending())
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     WebGLTexture* tex = validateTextureBinding(&quot;getTexParameter&quot;, target, false);
</span><span class="cx">     if (!tex)
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     GC3Dint value = 0;
</span><span class="cx">     switch (pname) {
</span><span class="cx">     case GraphicsContext3D::TEXTURE_MAG_FILTER:
</span><span class="lines">@@ -2427,27 +2410,27 @@
</span><span class="cx">     case GraphicsContext3D::TEXTURE_WRAP_S:
</span><span class="cx">     case GraphicsContext3D::TEXTURE_WRAP_T:
</span><span class="cx">         m_context-&gt;getTexParameteriv(target, pname, &amp;value);
</span><del>-        return WebGLGetInfo(static_cast&lt;unsigned int&gt;(value));
</del><ins>+        return static_cast&lt;unsigned&gt;(value);
</ins><span class="cx">     case Extensions3D::TEXTURE_MAX_ANISOTROPY_EXT: // EXT_texture_filter_anisotropic
</span><span class="cx">         if (m_extTextureFilterAnisotropic) {
</span><span class="cx">             m_context-&gt;getTexParameteriv(target, pname, &amp;value);
</span><del>-            return WebGLGetInfo(static_cast&lt;unsigned int&gt;(value));
</del><ins>+            return static_cast&lt;unsigned&gt;(value);
</ins><span class="cx">         }
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getTexParameter&quot;, &quot;invalid parameter name, EXT_texture_filter_anisotropic not enabled&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     default:
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getTexParameter&quot;, &quot;invalid parameter name&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getUniform(WebGLProgram* program, const WebGLUniformLocation* uniformLocation)
</del><ins>+WebGLAny WebGLRenderingContextBase::getUniform(WebGLProgram* program, const WebGLUniformLocation* uniformLocation)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending() || !validateWebGLObject(&quot;getUniform&quot;, program))
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     if (!uniformLocation || uniformLocation-&gt;program() != program) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, &quot;getUniform&quot;, &quot;no uniformlocation or not valid for this program&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx">     GC3Dint location = uniformLocation-&gt;location();
</span><span class="cx"> 
</span><span class="lines">@@ -2522,7 +2505,7 @@
</span><span class="cx">     default:
</span><span class="cx">         // Can't handle this type
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_VALUE, &quot;getUniform&quot;, &quot;unhandled type&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx">     switch (baseType) {
</span><span class="cx">     case GraphicsContext3D::FLOAT: {
</span><span class="lines">@@ -2532,8 +2515,8 @@
</span><span class="cx">         else
</span><span class="cx">             m_context-&gt;getUniformfv(objectOrZero(program), location, value);
</span><span class="cx">         if (length == 1)
</span><del>-            return WebGLGetInfo(value[0]);
-        return WebGLGetInfo(PassRefPtr&lt;Float32Array&gt;(Float32Array::create(value, length)));
</del><ins>+            return value[0];
+        return Float32Array::create(value, length);
</ins><span class="cx">     }
</span><span class="cx">     case GraphicsContext3D::INT: {
</span><span class="cx">         GC3Dint value[4] = {0};
</span><span class="lines">@@ -2542,8 +2525,8 @@
</span><span class="cx">         else
</span><span class="cx">             m_context-&gt;getUniformiv(objectOrZero(program), location, value);
</span><span class="cx">         if (length == 1)
</span><del>-            return WebGLGetInfo(value[0]);
-        return WebGLGetInfo(PassRefPtr&lt;Int32Array&gt;(Int32Array::create(value, length)));
</del><ins>+            return value[0];
+        return Int32Array::create(value, length);
</ins><span class="cx">     }
</span><span class="cx">     case GraphicsContext3D::BOOL: {
</span><span class="cx">         GC3Dint value[4] = {0};
</span><span class="lines">@@ -2552,12 +2535,12 @@
</span><span class="cx">         else
</span><span class="cx">             m_context-&gt;getUniformiv(objectOrZero(program), location, value);
</span><span class="cx">         if (length &gt; 1) {
</span><del>-            bool boolValue[16] = {0};
</del><ins>+            Vector&lt;bool&gt; vector(length);
</ins><span class="cx">             for (unsigned j = 0; j &lt; length; j++)
</span><del>-                boolValue[j] = static_cast&lt;bool&gt;(value[j]);
-            return WebGLGetInfo(boolValue, length);
</del><ins>+                vector[j] = value[j];
+            return WTFMove(vector);
</ins><span class="cx">         }
</span><del>-        return WebGLGetInfo(static_cast&lt;bool&gt;(value[0]));
</del><ins>+        return static_cast&lt;bool&gt;(value[0]);
</ins><span class="cx">     }
</span><span class="cx">     default:
</span><span class="cx">         notImplemented();
</span><span class="lines">@@ -2565,7 +2548,7 @@
</span><span class="cx"> 
</span><span class="cx">     // If we get here, something went wrong in our unfortunately complex logic above
</span><span class="cx">     synthesizeGLError(GraphicsContext3D::INVALID_VALUE, &quot;getUniform&quot;, &quot;unknown error&quot;);
</span><del>-    return WebGLGetInfo();
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebGLUniformLocation&gt; WebGLRenderingContextBase::getUniformLocation(WebGLProgram* program, const String&amp; name)
</span><span class="lines">@@ -2606,20 +2589,20 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getVertexAttrib(GC3Duint index, GC3Denum pname)
</del><ins>+WebGLAny WebGLRenderingContextBase::getVertexAttrib(GC3Duint index, GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending())
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     if (index &gt;= m_maxVertexAttribs) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_VALUE, &quot;getVertexAttrib&quot;, &quot;index out of range&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     const WebGLVertexArrayObjectBase::VertexAttribState&amp; state = m_boundVertexArrayObject-&gt;getVertexAttribState(index);
</span><span class="cx"> 
</span><span class="cx">     if ((isWebGL2() || m_angleInstancedArrays) &amp;&amp; pname == GraphicsContext3D::VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)
</span><del>-        return WebGLGetInfo(state.divisor);
</del><ins>+        return state.divisor;
</ins><span class="cx"> 
</span><span class="cx">     switch (pname) {
</span><span class="cx">     case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:
</span><span class="lines">@@ -2626,23 +2609,23 @@
</span><span class="cx">         if ((!isGLES2Compliant() &amp;&amp; !index &amp;&amp; m_boundVertexArrayObject-&gt;getVertexAttribState(0).bufferBinding == m_vertexAttrib0Buffer)
</span><span class="cx">             || !state.bufferBinding
</span><span class="cx">             || !state.bufferBinding-&gt;object())
</span><del>-            return WebGLGetInfo();
-        return WebGLGetInfo(PassRefPtr&lt;WebGLBuffer&gt;(state.bufferBinding));
</del><ins>+            return nullptr;
+        return state.bufferBinding;
</ins><span class="cx">     case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_ENABLED:
</span><del>-        return WebGLGetInfo(state.enabled);
</del><ins>+        return state.enabled;
</ins><span class="cx">     case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_NORMALIZED:
</span><del>-        return WebGLGetInfo(state.normalized);
</del><ins>+        return state.normalized;
</ins><span class="cx">     case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_SIZE:
</span><del>-        return WebGLGetInfo(state.size);
</del><ins>+        return state.size;
</ins><span class="cx">     case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_STRIDE:
</span><del>-        return WebGLGetInfo(state.originalStride);
</del><ins>+        return state.originalStride;
</ins><span class="cx">     case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_TYPE:
</span><del>-        return WebGLGetInfo(state.type);
</del><ins>+        return state.type;
</ins><span class="cx">     case GraphicsContext3D::CURRENT_VERTEX_ATTRIB:
</span><del>-        return WebGLGetInfo(PassRefPtr&lt;Float32Array&gt;(Float32Array::create(m_vertexAttribValue[index].value, 4)));
</del><ins>+        return Float32Array::create(m_vertexAttribValue[index].value, 4);
</ins><span class="cx">     default:
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;getVertexAttrib&quot;, &quot;invalid parameter name&quot;);
</span><del>-        return WebGLGetInfo();
</del><ins>+        return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2650,8 +2633,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (isContextLostOrPending())
</span><span class="cx">         return 0;
</span><del>-    GC3Dsizeiptr result = m_context-&gt;getVertexAttribOffset(index, pname);
-    return static_cast&lt;long long&gt;(result);
</del><ins>+    return m_context-&gt;getVertexAttribOffset(index, pname);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GC3Dboolean WebGLRenderingContextBase::isBuffer(WebGLBuffer* buffer)
</span><span class="lines">@@ -3113,8 +3095,8 @@
</span><span class="cx"> #undef PACKED_INTERNAL_FORMAT_CHECK
</span><span class="cx"> 
</span><span class="cx">     // Calculate array size, taking into consideration of PACK_ALIGNMENT.
</span><del>-    unsigned int totalBytesRequired = 0;
-    unsigned int padding = 0;
</del><ins>+    unsigned totalBytesRequired = 0;
+    unsigned padding = 0;
</ins><span class="cx">     if (!m_isRobustnessEXTSupported) {
</span><span class="cx">         GC3Denum error = m_context-&gt;computeImageSizeInBytes(format, type, width, height, m_packAlignment, &amp;totalBytesRequired, &amp;padding);
</span><span class="cx">         if (error != GraphicsContext3D::NO_ERROR) {
</span><span class="lines">@@ -4590,7 +4572,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     // Determine the number of elements the bound buffer can hold, given the offset, size, type and stride
</span><del>-    unsigned int typeSize = sizeInBytes(type);
</del><ins>+    auto typeSize = sizeInBytes(type);
</ins><span class="cx">     if (!typeSize) {
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, &quot;vertexAttribPointer&quot;, &quot;invalid type&quot;);
</span><span class="cx">         return;
</span><span class="lines">@@ -4601,7 +4583,7 @@
</span><span class="cx">     }
</span><span class="cx">     GC3Dsizei bytesPerElement = size * typeSize;
</span><span class="cx"> 
</span><del>-    m_boundVertexArrayObject-&gt;setVertexAttribState(index, bytesPerElement, size, type, normalized, stride, static_cast&lt;GC3Dintptr&gt;(offset), m_boundArrayBuffer);
</del><ins>+    m_boundVertexArrayObject-&gt;setVertexAttribState(index, bytesPerElement, size, type, normalized, stride, static_cast&lt;GC3Dintptr&gt;(offset), *m_boundArrayBuffer);
</ins><span class="cx">     m_context-&gt;vertexAttribPointer(index, size, type, normalized, stride, static_cast&lt;GC3Dintptr&gt;(offset));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -4692,7 +4674,7 @@
</span><span class="cx">     return (!isContextLost() &amp;&amp; !m_isPendingPolicyResolution) ? m_context-&gt;platformLayer() : 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContextBase::removeSharedObject(WebGLSharedObject* object)
</del><ins>+void WebGLRenderingContextBase::removeSharedObject(WebGLSharedObject&amp; object)
</ins><span class="cx"> {
</span><span class="cx">     if (m_isPendingPolicyResolution)
</span><span class="cx">         return;
</span><span class="lines">@@ -4700,7 +4682,7 @@
</span><span class="cx">     m_contextGroup-&gt;removeObject(object);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContextBase::addSharedObject(WebGLSharedObject* object)
</del><ins>+void WebGLRenderingContextBase::addSharedObject(WebGLSharedObject&amp; object)
</ins><span class="cx"> {
</span><span class="cx">     if (m_isPendingPolicyResolution)
</span><span class="cx">         return;
</span><span class="lines">@@ -4709,21 +4691,21 @@
</span><span class="cx">     m_contextGroup-&gt;addObject(object);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContextBase::removeContextObject(WebGLContextObject* object)
</del><ins>+void WebGLRenderingContextBase::removeContextObject(WebGLContextObject&amp; object)
</ins><span class="cx"> {
</span><span class="cx">     if (m_isPendingPolicyResolution)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_contextObjects.remove(object);
</del><ins>+    m_contextObjects.remove(&amp;object);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLRenderingContextBase::addContextObject(WebGLContextObject* object)
</del><ins>+void WebGLRenderingContextBase::addContextObject(WebGLContextObject&amp; object)
</ins><span class="cx"> {
</span><span class="cx">     if (m_isPendingPolicyResolution)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!isContextLost());
</span><del>-    m_contextObjects.add(object);
</del><ins>+    m_contextObjects.add(&amp;object);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGLRenderingContextBase::detachAndRemoveAllObjects()
</span><span class="lines">@@ -4761,56 +4743,56 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getBooleanParameter(GC3Denum pname)
</del><ins>+bool WebGLRenderingContextBase::getBooleanParameter(GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     GC3Dboolean value = 0;
</span><span class="cx">     m_context-&gt;getBooleanv(pname, &amp;value);
</span><del>-    return WebGLGetInfo(static_cast&lt;bool&gt;(value));
</del><ins>+    return value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getBooleanArrayParameter(GC3Denum pname)
</del><ins>+Vector&lt;bool&gt; WebGLRenderingContextBase::getBooleanArrayParameter(GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     if (pname != GraphicsContext3D::COLOR_WRITEMASK) {
</span><span class="cx">         notImplemented();
</span><del>-        return WebGLGetInfo(0, 0);
</del><ins>+        return { };
</ins><span class="cx">     }
</span><del>-    GC3Dboolean value[4] = {0};
</del><ins>+    GC3Dboolean value[4] = { 0 };
</ins><span class="cx">     m_context-&gt;getBooleanv(pname, value);
</span><del>-    bool boolValue[4];
-    for (int ii = 0; ii &lt; 4; ++ii)
-        boolValue[ii] = static_cast&lt;bool&gt;(value[ii]);
-    return WebGLGetInfo(boolValue, 4);
</del><ins>+    Vector&lt;bool&gt; vector(4);
+    for (unsigned i = 0; i &lt; 4; ++i)
+        vector[i] = value[i];
+    return vector;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getFloatParameter(GC3Denum pname)
</del><ins>+float WebGLRenderingContextBase::getFloatParameter(GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     GC3Dfloat value = 0;
</span><span class="cx">     m_context-&gt;getFloatv(pname, &amp;value);
</span><del>-    return WebGLGetInfo(value);
</del><ins>+    return value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getIntParameter(GC3Denum pname)
</del><ins>+int WebGLRenderingContextBase::getIntParameter(GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     GC3Dint value = 0;
</span><span class="cx">     m_context-&gt;getIntegerv(pname, &amp;value);
</span><del>-    return WebGLGetInfo(value);
</del><ins>+    return value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getUnsignedIntParameter(GC3Denum pname)
</del><ins>+unsigned WebGLRenderingContextBase::getUnsignedIntParameter(GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     GC3Dint value = 0;
</span><span class="cx">     m_context-&gt;getIntegerv(pname, &amp;value);
</span><del>-    return WebGLGetInfo(static_cast&lt;unsigned int&gt;(value));
</del><ins>+    return value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getInt64Parameter(GC3Denum pname)
</del><ins>+long long WebGLRenderingContextBase::getInt64Parameter(GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     GC3Dint64 value = 0;
</span><span class="cx">     m_context-&gt;getInteger64v(pname, &amp;value);
</span><del>-    return WebGLGetInfo(value);
</del><ins>+    return value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getWebGLFloatArrayParameter(GC3Denum pname)
</del><ins>+RefPtr&lt;Float32Array&gt; WebGLRenderingContextBase::getWebGLFloatArrayParameter(GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     GC3Dfloat value[4] = {0};
</span><span class="cx">     m_context-&gt;getFloatv(pname, value);
</span><span class="lines">@@ -4828,10 +4810,10 @@
</span><span class="cx">     default:
</span><span class="cx">         notImplemented();
</span><span class="cx">     }
</span><del>-    return WebGLGetInfo(PassRefPtr&lt;Float32Array&gt;(Float32Array::create(value, length)));
</del><ins>+    return Float32Array::create(value, length);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLGetInfo WebGLRenderingContextBase::getWebGLIntArrayParameter(GC3Denum pname)
</del><ins>+RefPtr&lt;Int32Array&gt; WebGLRenderingContextBase::getWebGLIntArrayParameter(GC3Denum pname)
</ins><span class="cx"> {
</span><span class="cx">     GC3Dint value[4] = {0};
</span><span class="cx">     m_context-&gt;getIntegerv(pname, value);
</span><span class="lines">@@ -4847,7 +4829,7 @@
</span><span class="cx">     default:
</span><span class="cx">         notImplemented();
</span><span class="cx">     }
</span><del>-    return WebGLGetInfo(PassRefPtr&lt;Int32Array&gt;(Int32Array::create(value, length)));
</del><ins>+    return Int32Array::create(value, length);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebGLRenderingContextBase::checkTextureCompleteness(const char* functionName, bool prepareToDraw)
</span><span class="lines">@@ -5071,7 +5053,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    unsigned int bytesRequired = 0;
</del><ins>+    unsigned bytesRequired = 0;
</ins><span class="cx"> 
</span><span class="cx">     switch (format) {
</span><span class="cx">     case Extensions3D::COMPRESSED_RGB_S3TC_DXT1_EXT:
</span><span class="lines">@@ -5328,10 +5310,10 @@
</span><span class="cx"> 
</span><span class="cx"> WebGLBuffer* WebGLRenderingContextBase::validateBufferDataParameters(const char* functionName, GC3Denum target, GC3Denum usage)
</span><span class="cx"> {
</span><del>-    WebGLBuffer* buffer = 0;
</del><ins>+    std::optional&lt;WebGLBuffer*&gt; buffer;
</ins><span class="cx">     switch (target) {
</span><span class="cx">     case GraphicsContext3D::ELEMENT_ARRAY_BUFFER:
</span><del>-        buffer = m_boundVertexArrayObject-&gt;getElementArrayBuffer().get();
</del><ins>+        buffer = m_boundVertexArrayObject-&gt;getElementArrayBuffer();
</ins><span class="cx">         break;
</span><span class="cx">     case GraphicsContext3D::ARRAY_BUFFER:
</span><span class="cx">         buffer = m_boundArrayBuffer.get();
</span><span class="lines">@@ -5338,7 +5320,6 @@
</span><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx"> #if ENABLE(WEBGL2)
</span><del>-        bool success = true;
</del><span class="cx">         if (isWebGL2()) {
</span><span class="cx">             switch (target) {
</span><span class="cx">             case GraphicsContext3D::COPY_READ_BUFFER:
</span><span class="lines">@@ -5359,19 +5340,15 @@
</span><span class="cx">             case GraphicsContext3D::UNIFORM_BUFFER:
</span><span class="cx">                 buffer = m_boundUniformBuffer.get();
</span><span class="cx">                 break;
</span><del>-            default:
-                success = false;
</del><ins>+            }
+            if (buffer)
</ins><span class="cx">                 break;
</span><del>-            }
-        } else
-            success = false;
-        if (success)
-            break;
</del><ins>+        }
</ins><span class="cx"> #endif
</span><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, &quot;invalid target&quot;);
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><del>-    if (!buffer) {
</del><ins>+    if (!buffer || !buffer.value()) {
</ins><span class="cx">         synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, &quot;no buffer&quot;);
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -5379,7 +5356,7 @@
</span><span class="cx">     case GraphicsContext3D::STREAM_DRAW:
</span><span class="cx">     case GraphicsContext3D::STATIC_DRAW:
</span><span class="cx">     case GraphicsContext3D::DYNAMIC_DRAW:
</span><del>-        return buffer;
</del><ins>+        return buffer.value();
</ins><span class="cx">     }
</span><span class="cx">     synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, &quot;invalid usage&quot;);
</span><span class="cx">     return nullptr;
</span><span class="lines">@@ -5929,6 +5906,16 @@
</span><span class="cx">     m_context-&gt;vertexAttribDivisor(index, divisor);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool WebGLRenderingContextBase::enableSupportedExtension(const char* extensionNameLiteral)
+{
+    ASSERT(m_context);
+    auto&amp; extensions = m_context-&gt;getExtensions();
+    String extensionName { ASCIILiteral { extensionNameLiteral } };
+    if (!extensions.supports(extensionName))
+        return false;
+    extensions.ensureEnabled(extensionName);
+    return true;
+}
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContextBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -30,13 +30,10 @@
</span><span class="cx"> #include &quot;GraphicsContext3D.h&quot;
</span><span class="cx"> #include &quot;ImageBuffer.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><ins>+#include &quot;WebGLAny.h&quot;
</ins><span class="cx"> #include &quot;WebGLContextAttributes.h&quot;
</span><del>-#include &quot;WebGLGetInfo.h&quot;
-#include &quot;WebGLObject.h&quot;
</del><span class="cx"> #include &quot;WebGLTexture.h&quot;
</span><span class="cx"> #include &lt;memory&gt;
</span><del>-#include &lt;runtime/Float32Array.h&gt;
-#include &lt;runtime/Int32Array.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -48,7 +45,6 @@
</span><span class="cx"> class EXTFragDepth;
</span><span class="cx"> class HTMLImageElement;
</span><span class="cx"> class HTMLVideoElement;
</span><del>-class ImageBuffer;
</del><span class="cx"> class ImageData;
</span><span class="cx"> class IntSize;
</span><span class="cx"> class OESStandardDerivatives;
</span><span class="lines">@@ -191,24 +187,24 @@
</span><span class="cx">     RefPtr&lt;WebGLActiveInfo&gt; getActiveUniform(WebGLProgram*, GC3Duint index);
</span><span class="cx">     bool getAttachedShaders(WebGLProgram*, Vector&lt;RefPtr&lt;WebGLShader&gt;&gt;&amp;);
</span><span class="cx">     GC3Dint getAttribLocation(WebGLProgram*, const String&amp; name);
</span><del>-    WebGLGetInfo getBufferParameter(GC3Denum target, GC3Denum pname);
</del><ins>+    WebGLAny getBufferParameter(GC3Denum target, GC3Denum pname);
</ins><span class="cx">     std::optional&lt;WebGLContextAttributes&gt; getContextAttributes();
</span><span class="cx">     GC3Denum getError();
</span><span class="cx">     virtual WebGLExtension* getExtension(const String&amp; name) = 0;
</span><del>-    virtual WebGLGetInfo getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) = 0;
-    virtual WebGLGetInfo getParameter(GC3Denum pname) = 0;
-    WebGLGetInfo getProgramParameter(WebGLProgram*, GC3Denum pname);
</del><ins>+    virtual WebGLAny getFramebufferAttachmentParameter(GC3Denum target, GC3Denum attachment, GC3Denum pname) = 0;
+    virtual WebGLAny getParameter(GC3Denum pname) = 0;
+    WebGLAny getProgramParameter(WebGLProgram*, GC3Denum pname);
</ins><span class="cx">     String getProgramInfoLog(WebGLProgram*);
</span><del>-    WebGLGetInfo getRenderbufferParameter(GC3Denum target, GC3Denum pname);
-    WebGLGetInfo getShaderParameter(WebGLShader*, GC3Denum pname);
</del><ins>+    WebGLAny getRenderbufferParameter(GC3Denum target, GC3Denum pname);
+    WebGLAny getShaderParameter(WebGLShader*, GC3Denum pname);
</ins><span class="cx">     String getShaderInfoLog(WebGLShader*);
</span><span class="cx">     RefPtr&lt;WebGLShaderPrecisionFormat&gt; getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType);
</span><span class="cx">     String getShaderSource(WebGLShader*);
</span><span class="cx">     virtual Vector&lt;String&gt; getSupportedExtensions() = 0;
</span><del>-    WebGLGetInfo getTexParameter(GC3Denum target, GC3Denum pname);
-    WebGLGetInfo getUniform(WebGLProgram*, const WebGLUniformLocation*);
</del><ins>+    WebGLAny getTexParameter(GC3Denum target, GC3Denum pname);
+    WebGLAny getUniform(WebGLProgram*, const WebGLUniformLocation*);
</ins><span class="cx">     RefPtr&lt;WebGLUniformLocation&gt; getUniformLocation(WebGLProgram*, const String&amp;);
</span><del>-    WebGLGetInfo getVertexAttrib(GC3Duint index, GC3Denum pname);
</del><ins>+    WebGLAny getVertexAttrib(GC3Duint index, GC3Denum pname);
</ins><span class="cx">     long long getVertexAttribOffset(GC3Duint index, GC3Denum pname);
</span><span class="cx"> 
</span><span class="cx">     virtual void hint(GC3Denum target, GC3Denum mode) = 0;
</span><span class="lines">@@ -323,8 +319,8 @@
</span><span class="cx">     void paintRenderingResultsToCanvas() override;
</span><span class="cx">     RefPtr&lt;ImageData&gt; paintRenderingResultsToImageData();
</span><span class="cx"> 
</span><del>-    void removeSharedObject(WebGLSharedObject*);
-    void removeContextObject(WebGLContextObject*);
</del><ins>+    void removeSharedObject(WebGLSharedObject&amp;);
+    void removeContextObject(WebGLContextObject&amp;);
</ins><span class="cx">     
</span><span class="cx">     unsigned getMaxVertexAttribs() const { return m_maxVertexAttribs; }
</span><span class="cx"> 
</span><span class="lines">@@ -335,7 +331,7 @@
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     WebGLRenderingContextBase(HTMLCanvasElement&amp;, WebGLContextAttributes);
</span><del>-    WebGLRenderingContextBase(HTMLCanvasElement&amp;, RefPtr&lt;GraphicsContext3D&gt;&amp;&amp;, WebGLContextAttributes);
</del><ins>+    WebGLRenderingContextBase(HTMLCanvasElement&amp;, Ref&lt;GraphicsContext3D&gt;&amp;&amp;, WebGLContextAttributes);
</ins><span class="cx"> 
</span><span class="cx">     friend class WebGLDrawBuffers;
</span><span class="cx">     friend class WebGLFramebuffer;
</span><span class="lines">@@ -360,8 +356,8 @@
</span><span class="cx">     const char* activeDOMObjectName() const override;
</span><span class="cx">     bool canSuspendForDocumentSuspension() const override;
</span><span class="cx"> 
</span><del>-    void addSharedObject(WebGLSharedObject*);
-    void addContextObject(WebGLContextObject*);
</del><ins>+    void addSharedObject(WebGLSharedObject&amp;);
+    void addContextObject(WebGLContextObject&amp;);
</ins><span class="cx">     void detachAndRemoveAllObjects();
</span><span class="cx"> 
</span><span class="cx">     void destroyGraphicsContext3D();
</span><span class="lines">@@ -405,6 +401,8 @@
</span><span class="cx"> 
</span><span class="cx">     WebGLTexture::TextureExtensionFlag textureExtensionFlags() const;
</span><span class="cx"> 
</span><ins>+    bool enableSupportedExtension(const char* extensionNameLiteral);
+
</ins><span class="cx">     RefPtr&lt;GraphicsContext3D&gt; m_context;
</span><span class="cx">     RefPtr&lt;WebGLContextGroup&gt; m_contextGroup;
</span><span class="cx"> 
</span><span class="lines">@@ -414,7 +412,7 @@
</span><span class="cx">     // on how exactly the platform discovers that the context was lost. For better
</span><span class="cx">     // portability we always defer the dispatch of the event.
</span><span class="cx">     Timer m_dispatchContextLostEventTimer;
</span><del>-    bool m_restoreAllowed;
</del><ins>+    bool m_restoreAllowed { false };
</ins><span class="cx">     Timer m_restoreTimer;
</span><span class="cx"> 
</span><span class="cx">     bool m_needsUpdate;
</span><span class="lines">@@ -432,12 +430,10 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;WebGLVertexArrayObjectBase&gt; m_defaultVertexArrayObject;
</span><span class="cx">     RefPtr&lt;WebGLVertexArrayObjectBase&gt; m_boundVertexArrayObject;
</span><del>-    void setBoundVertexArrayObject(PassRefPtr&lt;WebGLVertexArrayObjectBase&gt; arrayObject)
</del><ins>+
+    void setBoundVertexArrayObject(WebGLVertexArrayObjectBase* arrayObject)
</ins><span class="cx">     {
</span><del>-        if (arrayObject)
-            m_boundVertexArrayObject = arrayObject;
-        else
-            m_boundVertexArrayObject = m_defaultVertexArrayObject;
</del><ins>+        m_boundVertexArrayObject = arrayObject ? arrayObject : m_defaultVertexArrayObject;
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     class VertexAttribValue {
</span><span class="lines">@@ -493,12 +489,12 @@
</span><span class="cx">         std::unique_ptr&lt;std::unique_ptr&lt;ImageBuffer&gt;[]&gt; m_buffers;
</span><span class="cx">         int m_capacity;
</span><span class="cx">     };
</span><del>-    LRUImageBufferCache m_generatedImageCache;
</del><ins>+    LRUImageBufferCache m_generatedImageCache { 0 };
</ins><span class="cx"> 
</span><span class="cx">     GC3Dint m_maxTextureSize;
</span><span class="cx">     GC3Dint m_maxCubeMapTextureSize;
</span><span class="cx">     GC3Dint m_maxRenderbufferSize;
</span><del>-    GC3Dint m_maxViewportDims[2];
</del><ins>+    GC3Dint m_maxViewportDims[2] { 0, 0 };
</ins><span class="cx">     GC3Dint m_maxTextureLevel;
</span><span class="cx">     GC3Dint m_maxCubeMapTextureLevel;
</span><span class="cx"> 
</span><span class="lines">@@ -513,8 +509,8 @@
</span><span class="cx">     bool m_unpackFlipY;
</span><span class="cx">     bool m_unpackPremultiplyAlpha;
</span><span class="cx">     GC3Denum m_unpackColorspaceConversion;
</span><del>-    bool m_contextLost;
-    LostContextMode m_contextLostMode;
</del><ins>+    bool m_contextLost { false };
+    LostContextMode m_contextLostMode { SyntheticLostContext };
</ins><span class="cx">     WebGLContextAttributes m_attributes;
</span><span class="cx"> 
</span><span class="cx">     bool m_layerCleared;
</span><span class="lines">@@ -535,17 +531,18 @@
</span><span class="cx">     bool m_isDepthStencilSupported;
</span><span class="cx">     bool m_isRobustnessEXTSupported;
</span><span class="cx"> 
</span><del>-    bool m_synthesizedErrorsToConsole;
</del><ins>+    bool m_synthesizedErrorsToConsole { true };
</ins><span class="cx">     int m_numGLErrorsToConsoleAllowed;
</span><span class="cx"> 
</span><span class="cx">     // A WebGLRenderingContext can be created in a state where it appears as
</span><span class="cx">     // a valid and active context, but will not execute any important operations
</span><span class="cx">     // until its load policy is completely resolved.
</span><del>-    bool m_isPendingPolicyResolution;
-    bool m_hasRequestedPolicyResolution;
</del><ins>+    bool m_isPendingPolicyResolution { false };
+    bool m_hasRequestedPolicyResolution { false };
</ins><span class="cx">     bool isContextLostOrPending();
</span><span class="cx"> 
</span><del>-    // Enabled extension objects. FIXME: Move these to WebGL1RenderingContext, not needed for WebGL2
</del><ins>+    // Enabled extension objects.
+    // FIXME: Move some of these to WebGLRenderingContext, the ones not needed for WebGL2
</ins><span class="cx">     std::unique_ptr&lt;EXTFragDepth&gt; m_extFragDepth;
</span><span class="cx">     std::unique_ptr&lt;EXTBlendMinMax&gt; m_extBlendMinMax;
</span><span class="cx">     std::unique_ptr&lt;EXTsRGB&gt; m_extsRGB;
</span><span class="lines">@@ -568,15 +565,15 @@
</span><span class="cx">     std::unique_ptr&lt;WebGLDrawBuffers&gt; m_webglDrawBuffers;
</span><span class="cx">     std::unique_ptr&lt;ANGLEInstancedArrays&gt; m_angleInstancedArrays;
</span><span class="cx"> 
</span><del>-    // Helpers for getParameter and others
-    WebGLGetInfo getBooleanParameter(GC3Denum);
-    WebGLGetInfo getBooleanArrayParameter(GC3Denum);
-    WebGLGetInfo getFloatParameter(GC3Denum);
-    WebGLGetInfo getIntParameter(GC3Denum);
-    WebGLGetInfo getUnsignedIntParameter(GC3Denum);
-    WebGLGetInfo getInt64Parameter(GC3Denum);
-    WebGLGetInfo getWebGLFloatArrayParameter(GC3Denum);
-    WebGLGetInfo getWebGLIntArrayParameter(GC3Denum);
</del><ins>+    // Helpers for getParameter and other similar functions.
+    bool getBooleanParameter(GC3Denum);
+    Vector&lt;bool&gt; getBooleanArrayParameter(GC3Denum);
+    float getFloatParameter(GC3Denum);
+    int getIntParameter(GC3Denum);
+    unsigned getUnsignedIntParameter(GC3Denum);
+    long long getInt64Parameter(GC3Denum);
+    RefPtr&lt;Float32Array&gt; getWebGLFloatArrayParameter(GC3Denum);
+    RefPtr&lt;Int32Array&gt; getWebGLIntArrayParameter(GC3Denum);
</ins><span class="cx"> 
</span><span class="cx">     // Clear the backbuffer if it was composited since the last operation.
</span><span class="cx">     // clearMask is set to the bitfield of any clear that would happen anyway at this time
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLSamplerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLSampler.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLSampler.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLSampler.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -31,17 +31,12 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGLSampler final : public WebGLSharedObject {
</span><span class="cx"> public:
</span><ins>+    static Ref&lt;WebGLSampler&gt; create(WebGLRenderingContextBase&amp;);
</ins><span class="cx">     virtual ~WebGLSampler();
</span><span class="cx"> 
</span><del>-    static Ref&lt;WebGLSampler&gt; create(WebGLRenderingContextBase&amp;);
-
</del><span class="cx"> protected:
</span><del>-    WebGLSampler(WebGLRenderingContextBase&amp;);
-
-    void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
-
-private:
-    bool isSampler() const override { return true; }
</del><ins>+    explicit WebGLSampler(WebGLRenderingContextBase&amp;);
+    void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) final;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLShaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLShader.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLShader.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLShader.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -31,10 +31,9 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGLShader final : public WebGLSharedObject {
</span><span class="cx"> public:
</span><ins>+    static Ref&lt;WebGLShader&gt; create(WebGLRenderingContextBase&amp;, GC3Denum);
</ins><span class="cx">     virtual ~WebGLShader();
</span><span class="cx"> 
</span><del>-    static Ref&lt;WebGLShader&gt; create(WebGLRenderingContextBase&amp;, GC3Denum);
-
</del><span class="cx">     GC3Denum getType() const { return m_type; }
</span><span class="cx">     const String&amp; getSource() const { return m_source; }
</span><span class="cx"> 
</span><span class="lines">@@ -46,10 +45,8 @@
</span><span class="cx"> private:
</span><span class="cx">     WebGLShader(WebGLRenderingContextBase&amp;, GC3Denum);
</span><span class="cx"> 
</span><del>-    void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
</del><ins>+    void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) final;
</ins><span class="cx"> 
</span><del>-    bool isShader() const override { return true; }
-
</del><span class="cx">     GC3Denum m_type;
</span><span class="cx">     String m_source;
</span><span class="cx">     bool m_isValid;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLSharedObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLSharedObject.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLSharedObject.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLSharedObject.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,11 +24,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;WebGLSharedObject.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> 
</span><del>-#include &quot;WebGLSharedObject.h&quot;
-
</del><span class="cx"> #include &quot;WebGLContextGroup.h&quot;
</span><span class="cx"> #include &quot;WebGLRenderingContextBase.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -35,8 +34,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> WebGLSharedObject::WebGLSharedObject(WebGLRenderingContextBase&amp; context)
</span><del>-    : WebGLObject(context)
-    , m_contextGroup(context.contextGroup())
</del><ins>+    : m_contextGroup(context.contextGroup())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -43,7 +41,7 @@
</span><span class="cx"> WebGLSharedObject::~WebGLSharedObject()
</span><span class="cx"> {
</span><span class="cx">     if (m_contextGroup)
</span><del>-        m_contextGroup-&gt;removeObject(this);
</del><ins>+        m_contextGroup-&gt;removeObject(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGLSharedObject::detachContextGroup()
</span><span class="lines">@@ -50,15 +48,15 @@
</span><span class="cx"> {
</span><span class="cx">     detach();
</span><span class="cx">     if (m_contextGroup) {
</span><del>-        deleteObject(0);
-        m_contextGroup-&gt;removeObject(this);
-        m_contextGroup = 0;
</del><ins>+        deleteObject(nullptr);
+        m_contextGroup-&gt;removeObject(*this);
+        m_contextGroup = nullptr;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GraphicsContext3D* WebGLSharedObject::getAGraphicsContext3D() const
</span><span class="cx"> {
</span><del>-    return m_contextGroup ? m_contextGroup-&gt;getAGraphicsContext3D() : 0;
</del><ins>+    return m_contextGroup ? &amp;m_contextGroup-&gt;getAGraphicsContext3D() : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLSharedObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLSharedObject.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLSharedObject.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLSharedObject.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -33,8 +33,7 @@
</span><span class="cx"> class WebGLContextGroup;
</span><span class="cx"> class WebGLRenderingContextBase;
</span><span class="cx"> 
</span><del>-// WebGLSharedObject the base class for objects that can be shared by multiple
-// WebGLRenderingContexts.
</del><ins>+// WebGLSharedObject the base class for objects that can be shared by multiple WebGLRenderingContexts.
</ins><span class="cx"> class WebGLSharedObject : public WebGLObject {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~WebGLSharedObject();
</span><span class="lines">@@ -41,16 +40,8 @@
</span><span class="cx"> 
</span><span class="cx">     WebGLContextGroup* contextGroup() const { return m_contextGroup; }
</span><span class="cx"> 
</span><del>-    virtual bool isBuffer() const { return false; }
-    virtual bool isProgram() const { return false; }
-    virtual bool isQuery() const { return false; }
</del><span class="cx">     virtual bool isRenderbuffer() const { return false; }
</span><del>-    virtual bool isSampler() const { return false; }
-    virtual bool isShader() const { return false; }
-    virtual bool isSync() const { return false; }
</del><span class="cx">     virtual bool isTexture() const { return false; }
</span><del>-    virtual bool isTransformFeedback() const { return false; }
-    virtual bool isVertexArrayObject() const { return false; }
</del><span class="cx"> 
</span><span class="cx">     bool validate(const WebGLContextGroup* contextGroup, const WebGLRenderingContextBase&amp;) const override
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLSynch"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLSync.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLSync.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLSync.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -39,9 +39,6 @@
</span><span class="cx">     WebGLSync(WebGLRenderingContextBase&amp;);
</span><span class="cx"> 
</span><span class="cx">     void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
</span><del>-
-private:
-    bool isSync() const override { return true; }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLTransformFeedbackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLTransformFeedback.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLTransformFeedback.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLTransformFeedback.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -39,9 +39,6 @@
</span><span class="cx">     WebGLTransformFeedback(WebGLRenderingContextBase&amp;);
</span><span class="cx"> 
</span><span class="cx">     void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
</span><del>-
-private:
-    bool isTransformFeedback() const override { return true; }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,33 +24,33 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><del>-
-#if ENABLE(WEBGL) &amp;&amp; ENABLE(WEBGL2)
</del><span class="cx"> #include &quot;WebGLVertexArrayObject.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WEBGL2)
+
</ins><span class="cx"> #include &quot;WebGL2RenderingContext.h&quot;
</span><span class="cx"> #include &quot;WebGLContextGroup.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     
</span><del>-Ref&lt;WebGLVertexArrayObject&gt; WebGLVertexArrayObject::create(WebGLRenderingContextBase&amp; ctx, VAOType type)
</del><ins>+Ref&lt;WebGLVertexArrayObject&gt; WebGLVertexArrayObject::create(WebGLRenderingContextBase&amp; context, Type type)
</ins><span class="cx"> {
</span><del>-    return adoptRef(*new WebGLVertexArrayObject(ctx, type));
</del><ins>+    return adoptRef(*new WebGLVertexArrayObject(context, type));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebGLVertexArrayObject::~WebGLVertexArrayObject()
</span><span class="cx"> {
</span><del>-    deleteObject(0);
</del><ins>+    deleteObject(nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLVertexArrayObject::WebGLVertexArrayObject(WebGLRenderingContextBase&amp; ctx, VAOType type)
-    : WebGLVertexArrayObjectBase(ctx, type)
</del><ins>+WebGLVertexArrayObject::WebGLVertexArrayObject(WebGLRenderingContextBase&amp; context, Type type)
+    : WebGLVertexArrayObjectBase(context, type)
</ins><span class="cx"> {
</span><span class="cx">     switch (m_type) {
</span><del>-    case VAOTypeDefault:
</del><ins>+    case Type::Default:
</ins><span class="cx">         break;
</span><del>-    default:
-        setObject(context()-&gt;graphicsContext3D()-&gt;createVertexArray());
</del><ins>+    case Type::User:
+        setObject(this-&gt;context()-&gt;graphicsContext3D()-&gt;createVertexArray());
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -58,9 +58,9 @@
</span><span class="cx"> void WebGLVertexArrayObject::deleteObjectImpl(GraphicsContext3D* context3d, Platform3DObject object)
</span><span class="cx"> {
</span><span class="cx">     switch (m_type) {
</span><del>-    case VAOTypeDefault:
</del><ins>+    case Type::Default:
</ins><span class="cx">         break;
</span><del>-    default:
</del><ins>+    case Type::User:
</ins><span class="cx">         context3d-&gt;deleteVertexArray(object);
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObject.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -27,8 +27,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL2)
</span><span class="cx"> 
</span><del>-#include &quot;WebGLBuffer.h&quot;
-#include &quot;WebGLContextObject.h&quot;
</del><span class="cx"> #include &quot;WebGLVertexArrayObjectBase.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -37,12 +35,11 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGLVertexArrayObject final : public WebGLVertexArrayObjectBase {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;WebGLVertexArrayObject&gt; create(WebGLRenderingContextBase&amp;, VAOType);
</del><ins>+    static Ref&lt;WebGLVertexArrayObject&gt; create(WebGLRenderingContextBase&amp;, Type);
</ins><span class="cx">     virtual ~WebGLVertexArrayObject();
</span><span class="cx"> private:
</span><del>-    WebGLVertexArrayObject(WebGLRenderingContextBase&amp;, VAOType);
-    bool isTransformFeedback() const { return true; }
-    void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
</del><ins>+    WebGLVertexArrayObject(WebGLRenderingContextBase&amp;, Type);
+    void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) final;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,24 +24,22 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;WebGLVertexArrayObjectBase.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><del>-#include &quot;WebGLVertexArrayObjectBase.h&quot;
</del><span class="cx"> 
</span><span class="cx"> #include &quot;WebGLRenderingContextBase.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase(WebGLRenderingContextBase&amp; ctx, VAOType type)
-    : WebGLContextObject(ctx)
</del><ins>+WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase(WebGLRenderingContextBase&amp; context, Type type)
+    : WebGLContextObject(context)
</ins><span class="cx">     , m_type(type)
</span><del>-    , m_hasEverBeenBound(false)
-    , m_boundElementArrayBuffer(0)
</del><span class="cx"> {
</span><del>-    m_vertexAttribState.resize(ctx.getMaxVertexAttribs());
</del><ins>+    m_vertexAttribState.resize(context.getMaxVertexAttribs());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLVertexArrayObjectBase::setElementArrayBuffer(PassRefPtr&lt;WebGLBuffer&gt; buffer)
</del><ins>+void WebGLVertexArrayObjectBase::setElementArrayBuffer(WebGLBuffer* buffer)
</ins><span class="cx"> {
</span><span class="cx">     if (buffer)
</span><span class="cx">         buffer-&gt;onAttached();
</span><span class="lines">@@ -51,18 +49,17 @@
</span><span class="cx">     
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLVertexArrayObjectBase::setVertexAttribState(GC3Duint index, GC3Dsizei bytesPerElement, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptr offset, PassRefPtr&lt;WebGLBuffer&gt; buffer)
</del><ins>+void WebGLVertexArrayObjectBase::setVertexAttribState(GC3Duint index, GC3Dsizei bytesPerElement, GC3Dint size, GC3Denum type, GC3Dboolean normalized, GC3Dsizei stride, GC3Dintptr offset, WebGLBuffer&amp; buffer)
</ins><span class="cx"> {
</span><span class="cx">     GC3Dsizei validatedStride = stride ? stride : bytesPerElement;
</span><span class="cx">     
</span><del>-    VertexAttribState&amp; state = m_vertexAttribState[index];
</del><ins>+    auto&amp; state = m_vertexAttribState[index];
</ins><span class="cx">     
</span><del>-    if (buffer)
-        buffer-&gt;onAttached();
</del><ins>+    buffer.onAttached();
</ins><span class="cx">     if (state.bufferBinding)
</span><span class="cx">         state.bufferBinding-&gt;onDetached(context()-&gt;graphicsContext3D());
</span><span class="cx">     
</span><del>-    state.bufferBinding = buffer;
</del><ins>+    state.bufferBinding = &amp;buffer;
</ins><span class="cx">     state.bytesPerElement = bytesPerElement;
</span><span class="cx">     state.size = size;
</span><span class="cx">     state.type = type;
</span><span class="lines">@@ -72,17 +69,17 @@
</span><span class="cx">     state.offset = offset;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebGLVertexArrayObjectBase::unbindBuffer(PassRefPtr&lt;WebGLBuffer&gt; buffer)
</del><ins>+void WebGLVertexArrayObjectBase::unbindBuffer(WebGLBuffer&amp; buffer)
</ins><span class="cx"> {
</span><del>-    if (m_boundElementArrayBuffer == buffer) {
</del><ins>+    if (m_boundElementArrayBuffer == &amp;buffer) {
</ins><span class="cx">         m_boundElementArrayBuffer-&gt;onDetached(context()-&gt;graphicsContext3D());
</span><span class="cx">         m_boundElementArrayBuffer = nullptr;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     for (size_t i = 0; i &lt; m_vertexAttribState.size(); ++i) {
</span><del>-        VertexAttribState&amp; state = m_vertexAttribState[i];
-        if (state.bufferBinding == buffer) {
-            buffer-&gt;onDetached(context()-&gt;graphicsContext3D());
</del><ins>+        auto&amp; state = m_vertexAttribState[i];
+        if (state.bufferBinding == &amp;buffer) {
+            buffer.onDetached(context()-&gt;graphicsContext3D());
</ins><span class="cx">             
</span><span class="cx">             if (!i &amp;&amp; !context()-&gt;isGLES2Compliant()) {
</span><span class="cx">                 state.bufferBinding = context()-&gt;m_vertexAttrib0Buffer;
</span><span class="lines">@@ -102,8 +99,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebGLVertexArrayObjectBase::setVertexAttribDivisor(GC3Duint index, GC3Duint divisor)
</span><span class="cx"> {
</span><del>-    VertexAttribState&amp; state = m_vertexAttribState[index];
-    state.divisor = divisor;
</del><ins>+    m_vertexAttribState[index].divisor = divisor;
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectBase.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -32,65 +32,47 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGLVertexArrayObjectBase : public WebGLContextObject {
</span><span class="cx"> public:
</span><del>-    enum VAOType {
-        VAOTypeDefault,
-        VAOTypeUser,
-    };
-    
-    virtual ~WebGLVertexArrayObjectBase() { }
</del><ins>+    enum class Type { Default, User };
</ins><span class="cx"> 
</span><span class="cx">     // Cached values for vertex attrib range checks
</span><span class="cx">     struct VertexAttribState {
</span><del>-        VertexAttribState()
-            : enabled(false)
-            , bytesPerElement(0)
-            , size(4)
-            , type(GraphicsContext3D::FLOAT)
-            , normalized(false)
-            , stride(16)
-            , originalStride(0)
-            , offset(0)
-            , divisor(0)
-        {
-        }
-        
</del><span class="cx">         bool isBound() const { return bufferBinding &amp;&amp; bufferBinding-&gt;object(); }
</span><span class="cx">         bool validateBinding() const { return !enabled || isBound(); }
</span><span class="cx">         
</span><del>-        bool enabled;
</del><ins>+        bool enabled { false };
</ins><span class="cx">         RefPtr&lt;WebGLBuffer&gt; bufferBinding;
</span><del>-        GC3Dsizei bytesPerElement;
-        GC3Dint size;
-        GC3Denum type;
-        bool normalized;
-        GC3Dsizei stride;
-        GC3Dsizei originalStride;
-        GC3Dintptr offset;
-        GC3Duint divisor;
</del><ins>+        GC3Dsizei bytesPerElement { 0 };
+        GC3Dint size { 4 };
+        GC3Denum type { GraphicsContext3D::FLOAT };
+        bool normalized { false };
+        GC3Dsizei stride { 16 };
+        GC3Dsizei originalStride { 0 };
+        GC3Dintptr offset { 0 };
+        GC3Duint divisor { 0 };
</ins><span class="cx">     };
</span><del>-    
-    bool isDefaultObject() const { return m_type == VAOTypeDefault; }
-    
</del><ins>+
+    bool isDefaultObject() const { return m_type == Type::Default; }
+
</ins><span class="cx">     bool hasEverBeenBound() const { return object() &amp;&amp; m_hasEverBeenBound; }
</span><span class="cx">     void setHasEverBeenBound() { m_hasEverBeenBound = true; }
</span><del>-    
-    PassRefPtr&lt;WebGLBuffer&gt; getElementArrayBuffer() const { return m_boundElementArrayBuffer; }
-    void setElementArrayBuffer(PassRefPtr&lt;WebGLBuffer&gt;);
-    
</del><ins>+
+    WebGLBuffer* getElementArrayBuffer() const { return m_boundElementArrayBuffer.get(); }
+    void setElementArrayBuffer(WebGLBuffer*);
+
</ins><span class="cx">     VertexAttribState&amp; getVertexAttribState(int index) { return m_vertexAttribState[index]; }
</span><del>-    void setVertexAttribState(GC3Duint, GC3Dsizei, GC3Dint, GC3Denum, GC3Dboolean, GC3Dsizei, GC3Dintptr, PassRefPtr&lt;WebGLBuffer&gt;);
-    void unbindBuffer(PassRefPtr&lt;WebGLBuffer&gt;);
-    
</del><ins>+    void setVertexAttribState(GC3Duint, GC3Dsizei, GC3Dint, GC3Denum, GC3Dboolean, GC3Dsizei, GC3Dintptr, WebGLBuffer&amp;);
+    void unbindBuffer(WebGLBuffer&amp;);
+
</ins><span class="cx">     void setVertexAttribDivisor(GC3Duint index, GC3Duint divisor);
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    WebGLVertexArrayObjectBase(WebGLRenderingContextBase&amp;, VAOType);
</del><ins>+    WebGLVertexArrayObjectBase(WebGLRenderingContextBase&amp;, Type);
</ins><span class="cx">     void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override = 0;
</span><del>-    
-    VAOType m_type;
-    bool m_hasEverBeenBound;
</del><ins>+
+    Type m_type;
+    bool m_hasEverBeenBound { false };
</ins><span class="cx">     RefPtr&lt;WebGLBuffer&gt; m_boundElementArrayBuffer;
</span><span class="cx">     Vector&lt;VertexAttribState&gt; m_vertexAttribState;
</span><span class="cx"> };
</span><del>-    
</del><ins>+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectOEScpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -34,20 +34,19 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-Ref&lt;WebGLVertexArrayObjectOES&gt; WebGLVertexArrayObjectOES::create(WebGLRenderingContextBase&amp; ctx, VAOType type)
</del><ins>+Ref&lt;WebGLVertexArrayObjectOES&gt; WebGLVertexArrayObjectOES::create(WebGLRenderingContextBase&amp; context, Type type)
</ins><span class="cx"> {
</span><del>-    return adoptRef(*new WebGLVertexArrayObjectOES(ctx, type));
</del><ins>+    return adoptRef(*new WebGLVertexArrayObjectOES(context, type));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES(WebGLRenderingContextBase&amp; ctx, VAOType type)
-    : WebGLVertexArrayObjectBase(ctx, type)
</del><ins>+WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES(WebGLRenderingContextBase&amp; context, Type type)
+    : WebGLVertexArrayObjectBase(context, type)
</ins><span class="cx"> {
</span><del>-    Extensions3D&amp; extensions = context()-&gt;graphicsContext3D()-&gt;getExtensions();
-    switch (m_type) {
-    case VAOTypeDefault:
</del><ins>+    switch (type) {
+    case Type::Default:
</ins><span class="cx">         break;
</span><del>-    default:
-        setObject(extensions.createVertexArrayOES());
</del><ins>+    case Type::User:
+        setObject(this-&gt;context()-&gt;graphicsContext3D()-&gt;getExtensions().createVertexArrayOES());
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -54,17 +53,16 @@
</span><span class="cx"> 
</span><span class="cx"> WebGLVertexArrayObjectOES::~WebGLVertexArrayObjectOES()
</span><span class="cx"> {
</span><del>-    deleteObject(0);
</del><ins>+    deleteObject(nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebGLVertexArrayObjectOES::deleteObjectImpl(GraphicsContext3D* context3d, Platform3DObject object)
</span><span class="cx"> {
</span><del>-    Extensions3D&amp; extensions = context3d-&gt;getExtensions();
</del><span class="cx">     switch (m_type) {
</span><del>-    case VAOTypeDefault:
</del><ins>+    case Type::Default:
</ins><span class="cx">         break;
</span><del>-    default:
-        extensions.deleteVertexArrayOES(object);
</del><ins>+    case Type::User:
+        context3d-&gt;getExtensions().deleteVertexArrayOES(object);
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLVertexArrayObjectOESh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -25,8 +25,6 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include &quot;WebGLBuffer.h&quot;
-#include &quot;WebGLContextObject.h&quot;
</del><span class="cx"> #include &quot;WebGLVertexArrayObjectBase.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -33,11 +31,11 @@
</span><span class="cx"> 
</span><span class="cx"> class WebGLVertexArrayObjectOES final : public WebGLVertexArrayObjectBase {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;WebGLVertexArrayObjectOES&gt; create(WebGLRenderingContextBase&amp;, VAOType);
</del><ins>+    static Ref&lt;WebGLVertexArrayObjectOES&gt; create(WebGLRenderingContextBase&amp;, Type);
</ins><span class="cx">     virtual ~WebGLVertexArrayObjectOES();
</span><span class="cx"> private:
</span><del>-    WebGLVertexArrayObjectOES(WebGLRenderingContextBase&amp;, VAOType);
-    void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) override;
</del><ins>+    WebGLVertexArrayObjectOES(WebGLRenderingContextBase&amp;, Type);
+    void deleteObjectImpl(GraphicsContext3D*, Platform3DObject) final;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlformsFileIconLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/forms/FileIconLoader.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/forms/FileIconLoader.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/forms/FileIconLoader.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -37,13 +37,13 @@
</span><span class="cx"> void FileIconLoader::invalidate()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_client);
</span><del>-    m_client = 0;
</del><ins>+    m_client = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FileIconLoader::notifyFinished(PassRefPtr&lt;Icon&gt; icon)
</del><ins>+void FileIconLoader::iconLoaded(RefPtr&lt;Icon&gt;&amp;&amp; icon)
</ins><span class="cx"> {
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;updateRendering(icon);
</del><ins>+        m_client-&gt;iconLoaded(WTFMove(icon));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FileIconLoader::FileIconLoader(FileIconLoaderClient&amp; client)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlformsFileIconLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/forms/FileIconLoader.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/forms/FileIconLoader.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/forms/FileIconLoader.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -34,13 +34,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class FileIconLoader;
</del><span class="cx"> class Icon;
</span><span class="cx"> 
</span><span class="cx"> class FileIconLoaderClient {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~FileIconLoaderClient() { }
</span><del>-    virtual void updateRendering(PassRefPtr&lt;Icon&gt;) = 0;
</del><ins>+    virtual void iconLoaded(RefPtr&lt;Icon&gt;&amp;&amp;) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class FileIconLoader {
</span><span class="lines">@@ -48,7 +47,7 @@
</span><span class="cx">     explicit FileIconLoader(FileIconLoaderClient&amp;);
</span><span class="cx"> 
</span><span class="cx">     void invalidate();
</span><del>-    WEBCORE_EXPORT void notifyFinished(PassRefPtr&lt;Icon&gt;);
</del><ins>+    WEBCORE_EXPORT void iconLoaded(RefPtr&lt;Icon&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     FileIconLoaderClient* m_client;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLConstructionSitecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google, Inc. All Rights Reserved.
</span><del>- * Copyright (C) 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLConstructionSite::attachLater(ContainerNode&amp; parent, Ref&lt;Node&gt;&amp;&amp; child, bool selfClosing)
</span><span class="cx"> {
</span><del>-    ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || !is&lt;Element&gt;(child.get()) || !toScriptElementIfPossible(downcast&lt;Element&gt;(child.ptr())));
</del><ins>+    ASSERT(scriptingContentIsAllowed(m_parserContentPolicy) || !is&lt;Element&gt;(child.get()) || !isScriptElement(downcast&lt;Element&gt;(child.get())));
</ins><span class="cx">     ASSERT(pluginContentIsAllowed(m_parserContentPolicy) || !child-&gt;isPluginElement());
</span><span class="cx"> 
</span><span class="cx">     if (shouldFosterParent()) {
</span><span class="lines">@@ -541,7 +541,7 @@
</span><span class="cx">     notImplemented(); // parseError when xmlns or xmlns:xlink are wrong.
</span><span class="cx"> 
</span><span class="cx">     auto element = createElement(token, namespaceURI);
</span><del>-    if (scriptingContentIsAllowed(m_parserContentPolicy) || !toScriptElementIfPossible(element.ptr()))
</del><ins>+    if (scriptingContentIsAllowed(m_parserContentPolicy) || !isScriptElement(element.get()))
</ins><span class="cx">         attachLater(currentNode(), element.copyRef(), token.selfClosing());
</span><span class="cx">     if (!token.selfClosing())
</span><span class="cx">         m_openElements.push(HTMLStackItem::create(WTFMove(element), WTFMove(token), namespaceURI));
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLDocumentParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/parser/HTMLDocumentParser.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google, Inc. All Rights Reserved.
</span><del>- * Copyright (C) 2015 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &quot;HTMLTreeBuilder.h&quot;
</span><span class="cx"> #include &quot;HTMLUnknownElement.h&quot;
</span><span class="cx"> #include &quot;JSCustomElementInterface.h&quot;
</span><ins>+#include &quot;ScriptElement.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -205,7 +206,7 @@
</span><span class="cx">         ASSERT(!m_treeBuilder-&gt;hasParserBlockingScriptWork());
</span><span class="cx">         // We will not have a scriptRunner when parsing a DocumentFragment.
</span><span class="cx">         if (m_scriptRunner)
</span><del>-            m_scriptRunner-&gt;execute(WTFMove(scriptElement), scriptStartPosition);
</del><ins>+            m_scriptRunner-&gt;execute(scriptElement.releaseNonNull(), scriptStartPosition);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -500,7 +501,7 @@
</span><span class="cx">     // setClient would call notifyFinished if the load were complete.
</span><span class="cx">     // Callers do not expect to be re-entered from this call, so they should
</span><span class="cx">     // not an already-loaded PendingScript.
</span><del>-    pendingScript.setClient(this);
</del><ins>+    pendingScript.setClient(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLDocumentParser::stopWatchingForLoad(PendingScript&amp; pendingScript)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLScriptRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLScriptRunner.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLScriptRunner.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/parser/HTMLScriptRunner.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google, Inc. All Rights Reserved.
</span><ins>+ * Copyright (C) 2010-2017 Apple Inc. All Rights Reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -70,7 +71,7 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLScriptRunner::detach()
</span><span class="cx"> {
</span><del>-    m_document = 0;
</del><ins>+    m_document = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static URL documentURLForScriptExecution(Document* document)
</span><span class="lines">@@ -99,29 +100,18 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLScriptRunner::executeParsingBlockingScript()
</del><ins>+void HTMLScriptRunner::executePendingScriptAndDispatchEvent(PendingScript&amp; pendingScript)
</ins><span class="cx"> {
</span><del>-    ASSERT(m_document);
-    ASSERT(!isExecutingScript());
-    ASSERT(m_document-&gt;haveStylesheetsLoaded());
-    ASSERT(isPendingScriptReady(*m_parserBlockingScript));
-
-    InsertionPointRecord insertionPointRecord(m_host.inputStream());
-    executePendingScriptAndDispatchEvent(WTFMove(m_parserBlockingScript));
-}
-
-void HTMLScriptRunner::executePendingScriptAndDispatchEvent(RefPtr&lt;PendingScript&gt; pendingScript)
-{
</del><span class="cx">     // Stop watching loads before executeScript to prevent recursion if the script reloads itself.
</span><del>-    if (pendingScript-&gt;watchingForLoad())
-        stopWatchingForLoad(*pendingScript);
</del><ins>+    if (pendingScript.watchingForLoad())
+        stopWatchingForLoad(pendingScript);
</ins><span class="cx"> 
</span><span class="cx">     if (!isExecutingScript())
</span><span class="cx">         MicrotaskQueue::mainThreadQueue().performMicrotaskCheckpoint();
</span><span class="cx"> 
</span><del>-    if (auto* scriptElement = toScriptElementIfPossible(&amp;pendingScript-&gt;element())) {
</del><ins>+    {
</ins><span class="cx">         NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
</span><del>-        scriptElement-&gt;executePendingScript(*pendingScript);
</del><ins>+        pendingScript.element().executePendingScript(pendingScript);
</ins><span class="cx">     }
</span><span class="cx">     ASSERT(!isExecutingScript());
</span><span class="cx"> }
</span><span class="lines">@@ -140,15 +130,14 @@
</span><span class="cx"> 
</span><span class="cx"> // This function should match 10.2.5.11 &quot;An end tag whose tag name is 'script'&quot;
</span><span class="cx"> // Script handling lives outside the tree builder to keep the each class simple.
</span><del>-void HTMLScriptRunner::execute(PassRefPtr&lt;Element&gt; scriptElement, const TextPosition&amp; scriptStartPosition)
</del><ins>+void HTMLScriptRunner::execute(Ref&lt;ScriptElement&gt;&amp;&amp; element, const TextPosition&amp; scriptStartPosition)
</ins><span class="cx"> {
</span><del>-    ASSERT(scriptElement);
</del><span class="cx">     // FIXME: If scripting is disabled, always just return.
</span><span class="cx"> 
</span><span class="cx">     bool hadPreloadScanner = m_host.hasPreloadScanner();
</span><span class="cx"> 
</span><span class="cx">     // Try to execute the script given to us.
</span><del>-    runScript(scriptElement.get(), scriptStartPosition);
</del><ins>+    runScript(element.get(), scriptStartPosition);
</ins><span class="cx"> 
</span><span class="cx">     if (hasParserBlockingScript()) {
</span><span class="cx">         if (isExecutingScript())
</span><span class="lines">@@ -167,8 +156,13 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLScriptRunner::executeParsingBlockingScripts()
</span><span class="cx"> {
</span><del>-    while (hasParserBlockingScript() &amp;&amp; isPendingScriptReady(*m_parserBlockingScript))
-        executeParsingBlockingScript();
</del><ins>+    while (hasParserBlockingScript() &amp;&amp; isPendingScriptReady(*m_parserBlockingScript)) {
+        ASSERT(m_document);
+        ASSERT(!isExecutingScript());
+        ASSERT(m_document-&gt;haveStylesheetsLoaded());
+        InsertionPointRecord insertionPointRecord(m_host.inputStream());
+        executePendingScriptAndDispatchEvent(m_parserBlockingScript.releaseNonNull().get());
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLScriptRunner::executeScriptsWaitingForLoad(PendingScript&amp; pendingScript)
</span><span class="lines">@@ -201,7 +195,7 @@
</span><span class="cx">             watchForLoad(m_scriptsToExecuteAfterParsing.first());
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><del>-        executePendingScriptAndDispatchEvent(m_scriptsToExecuteAfterParsing.takeFirst());
</del><ins>+        executePendingScriptAndDispatchEvent(m_scriptsToExecuteAfterParsing.takeFirst().get());
</ins><span class="cx">         // FIXME: What is this m_document check for?
</span><span class="cx">         if (!m_document)
</span><span class="cx">             return false;
</span><span class="lines">@@ -209,18 +203,17 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Ref&lt;PendingScript&gt; requestPendingScript(Element* script)
</del><ins>+static Ref&lt;PendingScript&gt; requestPendingScript(ScriptElement&amp; scriptElement)
</ins><span class="cx"> {
</span><del>-    auto&amp; scriptElement = *toScriptElementIfPossible(script);
</del><span class="cx">     ASSERT(scriptElement.willBeParserExecuted());
</span><span class="cx">     ASSERT(scriptElement.loadableScript());
</span><del>-    return PendingScript::create(*script, *scriptElement.loadableScript());
</del><ins>+    return PendingScript::create(scriptElement, *scriptElement.loadableScript());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLScriptRunner::requestParsingBlockingScript(Element* element)
</del><ins>+void HTMLScriptRunner::requestParsingBlockingScript(ScriptElement&amp; scriptElement)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!m_parserBlockingScript);
</span><del>-    m_parserBlockingScript = requestPendingScript(element);
</del><ins>+    m_parserBlockingScript = requestPendingScript(scriptElement);
</ins><span class="cx">     ASSERT(m_parserBlockingScript-&gt;needsLoading());
</span><span class="cx"> 
</span><span class="cx">     // We only care about a load callback if LoadableScript is not already
</span><span class="lines">@@ -230,9 +223,9 @@
</span><span class="cx">         watchForLoad(*m_parserBlockingScript);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLScriptRunner::requestDeferredScript(Element* element)
</del><ins>+void HTMLScriptRunner::requestDeferredScript(ScriptElement&amp; scriptElement)
</ins><span class="cx"> {
</span><del>-    auto pendingScript = requestPendingScript(element);
</del><ins>+    auto pendingScript = requestPendingScript(scriptElement);
</ins><span class="cx">     ASSERT(pendingScript-&gt;needsLoading());
</span><span class="cx">     m_scriptsToExecuteAfterParsing.append(WTFMove(pendingScript));
</span><span class="cx"> }
</span><span class="lines">@@ -239,46 +232,35 @@
</span><span class="cx"> 
</span><span class="cx"> // This method is meant to match the HTML5 definition of &quot;running a script&quot;
</span><span class="cx"> // http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#running-a-script
</span><del>-void HTMLScriptRunner::runScript(Element* script, const TextPosition&amp; scriptStartPosition)
</del><ins>+void HTMLScriptRunner::runScript(ScriptElement&amp; scriptElement, const TextPosition&amp; scriptStartPosition)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_document);
</span><span class="cx">     ASSERT(!hasParserBlockingScript());
</span><del>-    {
-        ScriptElement* scriptElement = toScriptElementIfPossible(script);
</del><span class="cx"> 
</span><del>-        // This contains both and ASSERTION and a null check since we should not
-        // be getting into the case of a null script element, but seem to be from
-        // time to time. The assertion is left in to help find those cases and
-        // is being tracked by &lt;https://bugs.webkit.org/show_bug.cgi?id=60559&gt;.
-        ASSERT(scriptElement);
-        if (!scriptElement)
-            return;
</del><ins>+    // FIXME: This may be too agressive as we always deliver mutations at
+    // every script element, even if it's not ready to execute yet. There's
+    // unfortunately no obvious way to tell if prepareScript is going to
+    // execute the script before calling it.
+    if (!isExecutingScript())
+        MicrotaskQueue::mainThreadQueue().performMicrotaskCheckpoint();
</ins><span class="cx"> 
</span><del>-        // FIXME: This may be too agressive as we always deliver mutations at
-        // every script element, even if it's not ready to execute yet. There's
-        // unfortuantely no obvious way to tell if prepareScript is going to
-        // execute the script from out here.
-        if (!isExecutingScript())
-            MicrotaskQueue::mainThreadQueue().performMicrotaskCheckpoint();
</del><ins>+    InsertionPointRecord insertionPointRecord(m_host.inputStream());
+    NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
</ins><span class="cx"> 
</span><del>-        InsertionPointRecord insertionPointRecord(m_host.inputStream());
-        NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
</del><ins>+    scriptElement.prepareScript(scriptStartPosition);
</ins><span class="cx"> 
</span><del>-        scriptElement-&gt;prepareScript(scriptStartPosition);
</del><ins>+    if (!scriptElement.willBeParserExecuted())
+        return;
</ins><span class="cx"> 
</span><del>-        if (!scriptElement-&gt;willBeParserExecuted())
-            return;
-
-        if (scriptElement-&gt;willExecuteWhenDocumentFinishedParsing())
-            requestDeferredScript(script);
-        else if (scriptElement-&gt;readyToBeParserExecuted()) {
-            if (m_scriptNestingLevel == 1)
-                m_parserBlockingScript = PendingScript::create(*script, scriptStartPosition);
-            else
-                scriptElement-&gt;executeClassicScript(ScriptSourceCode(script-&gt;textContent(), documentURLForScriptExecution(m_document), scriptStartPosition));
-        } else
-            requestParsingBlockingScript(script);
-    }
</del><ins>+    if (scriptElement.willExecuteWhenDocumentFinishedParsing())
+        requestDeferredScript(scriptElement);
+    else if (scriptElement.readyToBeParserExecuted()) {
+        if (m_scriptNestingLevel == 1)
+            m_parserBlockingScript = PendingScript::create(scriptElement, scriptStartPosition);
+        else
+            scriptElement.executeClassicScript(ScriptSourceCode(scriptElement.element().textContent(), documentURLForScriptExecution(m_document), scriptStartPosition));
+    } else
+        requestParsingBlockingScript(scriptElement);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLScriptRunnerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLScriptRunner.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLScriptRunner.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/parser/HTMLScriptRunner.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google, Inc. All Rights Reserved.
</span><ins>+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -32,13 +33,12 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Document;
</span><del>-class Element;
</del><span class="cx"> class Frame;
</span><span class="cx"> class HTMLScriptRunnerHost;
</span><span class="cx"> class ScriptSourceCode;
</span><span class="cx"> 
</span><span class="cx"> class HTMLScriptRunner {
</span><del>-    WTF_MAKE_NONCOPYABLE(HTMLScriptRunner); WTF_MAKE_FAST_ALLOCATED;
</del><ins>+    WTF_MAKE_FAST_ALLOCATED;
</ins><span class="cx"> public:
</span><span class="cx">     HTMLScriptRunner(Document&amp;, HTMLScriptRunnerHost&amp;);
</span><span class="cx">     ~HTMLScriptRunner();
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     void detach();
</span><span class="cx"> 
</span><span class="cx">     // Processes the passed in script and any pending scripts if possible.
</span><del>-    void execute(PassRefPtr&lt;Element&gt; scriptToProcess, const TextPosition&amp; scriptStartPosition);
</del><ins>+    void execute(Ref&lt;ScriptElement&gt;&amp;&amp;, const TextPosition&amp; scriptStartPosition);
</ins><span class="cx"> 
</span><span class="cx">     void executeScriptsWaitingForLoad(PendingScript&amp;);
</span><span class="cx">     bool hasScriptsWaitingForStylesheets() const { return m_hasScriptsWaitingForStylesheets; }
</span><span class="lines">@@ -59,16 +59,14 @@
</span><span class="cx"> private:
</span><span class="cx">     Frame* frame() const;
</span><span class="cx"> 
</span><del>-    void executeParsingBlockingScript();
-    void executePendingScriptAndDispatchEvent(RefPtr&lt;PendingScript&gt;);
</del><ins>+    void executePendingScriptAndDispatchEvent(PendingScript&amp;);
</ins><span class="cx">     void executeParsingBlockingScripts();
</span><span class="cx"> 
</span><del>-    void requestParsingBlockingScript(Element*);
-    void requestDeferredScript(Element*);
</del><ins>+    void requestParsingBlockingScript(ScriptElement&amp;);
+    void requestDeferredScript(ScriptElement&amp;);
</ins><span class="cx"> 
</span><del>-    void runScript(Element*, const TextPosition&amp; scriptStartPosition);
</del><ins>+    void runScript(ScriptElement&amp;, const TextPosition&amp; scriptStartPosition);
</ins><span class="cx"> 
</span><del>-    // Helpers for dealing with HTMLScriptRunnerHost
</del><span class="cx">     void watchForLoad(PendingScript&amp;);
</span><span class="cx">     void stopWatchingForLoad(PendingScript&amp;);
</span><span class="cx">     bool isPendingScriptReady(const PendingScript&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLTreeBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google, Inc. All Rights Reserved.
</span><del>- * Copyright (C) 2011, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -35,10 +35,12 @@
</span><span class="cx"> #include &quot;HTMLOptGroupElement.h&quot;
</span><span class="cx"> #include &quot;HTMLOptionElement.h&quot;
</span><span class="cx"> #include &quot;HTMLParserIdioms.h&quot;
</span><ins>+#include &quot;HTMLScriptElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLTableElement.h&quot;
</span><span class="cx"> #include &quot;JSCustomElementInterface.h&quot;
</span><span class="cx"> #include &quot;LocalizedStrings.h&quot;
</span><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><ins>+#include &quot;SVGScriptElement.h&quot;
</ins><span class="cx"> #include &quot;XLinkNames.h&quot;
</span><span class="cx"> #include &quot;XMLNSNames.h&quot;
</span><span class="cx"> #include &quot;XMLNames.h&quot;
</span><span class="lines">@@ -57,10 +59,12 @@
</span><span class="cx">     : elementInterface(WTFMove(customElementInterface))
</span><span class="cx">     , name(name)
</span><span class="cx">     , attributes(WTFMove(attributes))
</span><del>-{ }
</del><ins>+{
+}
</ins><span class="cx"> 
</span><span class="cx"> CustomElementConstructionData::~CustomElementConstructionData()
</span><del>-{ }
</del><ins>+{
+}
</ins><span class="cx"> 
</span><span class="cx"> namespace {
</span><span class="cx"> 
</span><span class="lines">@@ -318,7 +322,7 @@
</span><span class="cx">     return *m_contextElementStackItem;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;Element&gt; HTMLTreeBuilder::takeScriptToProcess(TextPosition&amp; scriptStartPosition)
</del><ins>+RefPtr&lt;ScriptElement&gt; HTMLTreeBuilder::takeScriptToProcess(TextPosition&amp; scriptStartPosition)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!m_destroyed);
</span><span class="cx"> 
</span><span class="lines">@@ -2057,7 +2061,7 @@
</span><span class="cx">             // Pause ourselves so that parsing stops until the script can be processed by the caller.
</span><span class="cx">             ASSERT(m_tree.currentStackItem().hasTagName(scriptTag));
</span><span class="cx">             if (scriptingContentIsAllowed(m_tree.parserContentPolicy()))
</span><del>-                m_scriptToProcess = &amp;m_tree.currentElement();
</del><ins>+                m_scriptToProcess = &amp;downcast&lt;HTMLScriptElement&gt;(m_tree.currentElement());
</ins><span class="cx">             m_tree.openElements().pop();
</span><span class="cx">             m_insertionMode = m_originalInsertionMode;
</span><span class="cx"> 
</span><span class="lines">@@ -2787,7 +2791,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (token.name() == SVGNames::scriptTag &amp;&amp; m_tree.currentStackItem().hasTagName(SVGNames::scriptTag)) {
</span><span class="cx">             if (scriptingContentIsAllowed(m_tree.parserContentPolicy()))
</span><del>-                m_scriptToProcess = &amp;m_tree.currentElement();
</del><ins>+                m_scriptToProcess = &amp;downcast&lt;SVGScriptElement&gt;(m_tree.currentElement());
</ins><span class="cx">             m_tree.openElements().pop();
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLTreeBuilderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/parser/HTMLTreeBuilder.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google, Inc. All Rights Reserved.
</span><del>- * Copyright (C) 2011, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> class JSCustomElementInterface;
</span><span class="cx"> class HTMLDocumentParser;
</span><ins>+class ScriptElement;
</ins><span class="cx"> 
</span><span class="cx"> struct CustomElementConstructionData {
</span><span class="cx">     CustomElementConstructionData(Ref&lt;JSCustomElementInterface&gt;&amp;&amp;, const AtomicString&amp; name, Vector&lt;Attribute&gt;&amp;&amp;);
</span><span class="lines">@@ -62,7 +63,7 @@
</span><span class="cx">     bool hasParserBlockingScriptWork() const;
</span><span class="cx"> 
</span><span class="cx">     // Must be called to take the parser-blocking script before calling the parser again.
</span><del>-    RefPtr&lt;Element&gt; takeScriptToProcess(TextPosition&amp; scriptStartPosition);
</del><ins>+    RefPtr&lt;ScriptElement&gt; takeScriptToProcess(TextPosition&amp; scriptStartPosition);
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;CustomElementConstructionData&gt; takeCustomElementConstructionData() { return WTFMove(m_customElementToConstruct); }
</span><span class="cx">     void didCreateCustomOrCallbackElement(Ref&lt;Element&gt;&amp;&amp;, CustomElementConstructionData&amp;);
</span><span class="lines">@@ -206,7 +207,7 @@
</span><span class="cx">     // https://html.spec.whatwg.org/multipage/syntax.html#concept-pending-table-char-tokens
</span><span class="cx">     StringBuilder m_pendingTableCharacters;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Element&gt; m_scriptToProcess; // &lt;script&gt; tag which needs processing before resuming the parser.
</del><ins>+    RefPtr&lt;ScriptElement&gt; m_scriptToProcess; // &lt;script&gt; tag which needs processing before resuming the parser.
</ins><span class="cx">     TextPosition m_scriptToProcessStartPosition; // Starting line number of the script tag needing processing.
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;CustomElementConstructionData&gt; m_customElementToConstruct;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserTextDocumentParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/TextDocumentParser.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/TextDocumentParser.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/parser/TextDocumentParser.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;TextDocumentParser.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;HTMLTreeBuilder.h&quot;
</span><ins>+#include &quot;ScriptElement.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserXSSAuditorDelegatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/XSSAuditorDelegate.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/XSSAuditorDelegate.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/parser/XSSAuditorDelegate.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2013 Google, Inc. All Rights Reserved.
</span><ins>+ * Copyright (C) 2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -45,7 +46,6 @@
</span><span class="cx"> 
</span><span class="cx"> XSSAuditorDelegate::XSSAuditorDelegate(Document&amp; document)
</span><span class="cx">     : m_document(document)
</span><del>-    , m_didSendNotifications(false)
</del><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> }
</span><span class="lines">@@ -69,22 +69,22 @@
</span><span class="cx">     return message.toString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;FormData&gt; XSSAuditorDelegate::generateViolationReport(const XSSInfo&amp; xssInfo)
</del><ins>+Ref&lt;FormData&gt; XSSAuditorDelegate::generateViolationReport(const XSSInfo&amp; xssInfo)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><del>-    FrameLoader&amp; frameLoader = m_document.frame()-&gt;loader();
</del><ins>+    auto&amp; frameLoader = m_document.frame()-&gt;loader();
</ins><span class="cx">     String httpBody;
</span><span class="cx">     if (frameLoader.documentLoader()) {
</span><del>-        if (FormData* formData = frameLoader.documentLoader()-&gt;originalRequest().httpBody())
</del><ins>+        if (auto* formData = frameLoader.documentLoader()-&gt;originalRequest().httpBody())
</ins><span class="cx">             httpBody = formData-&gt;flattenToString();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Ref&lt;InspectorObject&gt; reportDetails = InspectorObject::create();
</del><ins>+    auto reportDetails = InspectorObject::create();
</ins><span class="cx">     reportDetails-&gt;setString(&quot;request-url&quot;, xssInfo.m_originalURL);
</span><span class="cx">     reportDetails-&gt;setString(&quot;request-body&quot;, httpBody);
</span><span class="cx"> 
</span><del>-    Ref&lt;InspectorObject&gt; reportObject = InspectorObject::create();
</del><ins>+    auto reportObject = InspectorObject::create();
</ins><span class="cx">     reportObject-&gt;setObject(&quot;xss-report&quot;, WTFMove(reportDetails));
</span><span class="cx"> 
</span><span class="cx">     return FormData::create(reportObject-&gt;toJSONString().utf8().data());
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserXSSAuditorDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/XSSAuditorDelegate.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/XSSAuditorDelegate.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/parser/XSSAuditorDelegate.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2013 Google, Inc. All Rights Reserved.
</span><ins>+ * Copyright (C) 2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -27,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;URL.h&quot;
</span><span class="cx"> #include &lt;wtf/text/TextPosition.h&gt;
</span><del>-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -34,6 +34,8 @@
</span><span class="cx"> class Document;
</span><span class="cx"> class FormData;
</span><span class="cx"> 
</span><ins>+// FIXME: Should change into a struct.
+// FIXME: Should return by value instead of using a unique_ptr.
</ins><span class="cx"> class XSSInfo {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="lines">@@ -51,7 +53,6 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class XSSAuditorDelegate {
</span><del>-    WTF_MAKE_NONCOPYABLE(XSSAuditorDelegate);
</del><span class="cx"> public:
</span><span class="cx">     explicit XSSAuditorDelegate(Document&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -59,10 +60,10 @@
</span><span class="cx">     void setReportURL(const URL&amp; url) { m_reportURL = url; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    PassRefPtr&lt;FormData&gt; generateViolationReport(const XSSInfo&amp;);
</del><ins>+    Ref&lt;FormData&gt; generateViolationReport(const XSSInfo&amp;);
</ins><span class="cx"> 
</span><span class="cx">     Document&amp; m_document;
</span><del>-    bool m_didSendNotifications;
</del><ins>+    bool m_didSendNotifications { false };
</ins><span class="cx">     URL m_reportURL;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackAudioTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/AudioTrack.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/AudioTrack.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/AudioTrack.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Google Inc.  All rights reserved.
- * Copyright (C) 2011, 2012, 2013 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -30,13 +30,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;AudioTrack.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><del>-#include &quot;AudioTrack.h&quot;
-
-#include &quot;AudioTrackList.h&quot;
-#include &quot;Event.h&quot;
</del><span class="cx"> #include &quot;HTMLMediaElement.h&quot;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -78,10 +75,10 @@
</span><span class="cx">     return commentary;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AudioTrack::AudioTrack(AudioTrackClient* client, PassRefPtr&lt;AudioTrackPrivate&gt; trackPrivate)
-    : MediaTrackBase(MediaTrackBase::AudioTrack, trackPrivate-&gt;id(), trackPrivate-&gt;label(), trackPrivate-&gt;language())
-    , m_enabled(trackPrivate-&gt;enabled())
-    , m_client(client)
</del><ins>+AudioTrack::AudioTrack(AudioTrackClient&amp; client, AudioTrackPrivate&amp; trackPrivate)
+    : MediaTrackBase(MediaTrackBase::AudioTrack, trackPrivate.id(), trackPrivate.label(), trackPrivate.language())
+    , m_enabled(trackPrivate.enabled())
+    , m_client(&amp;client)
</ins><span class="cx">     , m_private(trackPrivate)
</span><span class="cx"> {
</span><span class="cx">     m_private-&gt;setClient(this);
</span><span class="lines">@@ -93,19 +90,16 @@
</span><span class="cx">     m_private-&gt;setClient(nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AudioTrack::setPrivate(PassRefPtr&lt;AudioTrackPrivate&gt; trackPrivate)
</del><ins>+void AudioTrack::setPrivate(AudioTrackPrivate&amp; trackPrivate)
</ins><span class="cx"> {
</span><del>-    ASSERT(m_private);
-    ASSERT(trackPrivate);
-
-    if (m_private == trackPrivate)
</del><ins>+    if (m_private.ptr() == &amp;trackPrivate)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_private-&gt;setClient(nullptr);
</span><span class="cx">     m_private = trackPrivate;
</span><ins>+    m_private-&gt;setEnabled(m_enabled);
</ins><span class="cx">     m_private-&gt;setClient(this);
</span><span class="cx"> 
</span><del>-    m_private-&gt;setEnabled(m_enabled);
</del><span class="cx">     updateKindFromPrivate();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -112,61 +106,54 @@
</span><span class="cx"> bool AudioTrack::isValidKind(const AtomicString&amp; value) const
</span><span class="cx"> {
</span><span class="cx">     return value == alternativeKeyword()
</span><ins>+        || value == commentaryKeyword()
</ins><span class="cx">         || value == descriptionKeyword()
</span><span class="cx">         || value == mainKeyword()
</span><span class="cx">         || value == mainDescKeyword()
</span><del>-        || value == translationKeyword()
-        || value == commentaryKeyword();
</del><ins>+        || value == translationKeyword();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AudioTrack::setEnabled(const bool enabled)
</del><ins>+void AudioTrack::setEnabled(bool enabled)
</ins><span class="cx"> {
</span><span class="cx">     if (m_enabled == enabled)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_enabled = enabled;
</del><span class="cx">     m_private-&gt;setEnabled(enabled);
</span><del>-
-    if (m_client)
-        m_client-&gt;audioTrackEnabledChanged(this);
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-size_t AudioTrack::inbandTrackIndex()
</del><ins>+size_t AudioTrack::inbandTrackIndex() const
</ins><span class="cx"> {
</span><del>-    ASSERT(m_private);
</del><span class="cx">     return m_private-&gt;trackIndex();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AudioTrack::enabledChanged(AudioTrackPrivate* trackPrivate, bool enabled)
</del><ins>+void AudioTrack::enabledChanged(bool enabled)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><ins>+    if (m_enabled == enabled)
+        return;
+
</ins><span class="cx">     m_enabled = enabled;
</span><span class="cx"> 
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;audioTrackEnabledChanged(this);
</del><ins>+        m_client-&gt;audioTrackEnabledChanged(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AudioTrack::idChanged(TrackPrivateBase* trackPrivate, const AtomicString&amp; id)
</del><ins>+void AudioTrack::idChanged(const AtomicString&amp; id)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     setId(id);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AudioTrack::labelChanged(TrackPrivateBase* trackPrivate, const AtomicString&amp; label)
</del><ins>+void AudioTrack::labelChanged(const AtomicString&amp; label)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     setLabel(label);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AudioTrack::languageChanged(TrackPrivateBase* trackPrivate, const AtomicString&amp; language)
</del><ins>+void AudioTrack::languageChanged(const AtomicString&amp; language)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     setLanguage(language);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AudioTrack::willRemove(TrackPrivateBase* trackPrivate)
</del><ins>+void AudioTrack::willRemove()
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     mediaElement()-&gt;removeAudioTrack(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackAudioTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/AudioTrack.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/AudioTrack.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/AudioTrack.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2011, 2012, 2013 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,9 +29,7 @@
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AudioTrackPrivate.h&quot;
</span><del>-#include &quot;PlatformExportMacros.h&quot;
</del><span class="cx"> #include &quot;TrackBase.h&quot;
</span><del>-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -40,12 +38,12 @@
</span><span class="cx"> class AudioTrackClient {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~AudioTrackClient() { }
</span><del>-    virtual void audioTrackEnabledChanged(AudioTrack*) = 0;
</del><ins>+    virtual void audioTrackEnabledChanged(AudioTrack&amp;) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-class AudioTrack final : public MediaTrackBase, public AudioTrackPrivateClient {
</del><ins>+class AudioTrack final : public MediaTrackBase, private AudioTrackPrivateClient {
</ins><span class="cx"> public:
</span><del>-    static Ref&lt;AudioTrack&gt; create(AudioTrackClient* client, PassRefPtr&lt;AudioTrackPrivate&gt; trackPrivate)
</del><ins>+    static Ref&lt;AudioTrack&gt; create(AudioTrackClient&amp; client, AudioTrackPrivate&amp; trackPrivate)
</ins><span class="cx">     {
</span><span class="cx">         return adoptRef(*new AudioTrack(client, trackPrivate));
</span><span class="cx">     }
</span><span class="lines">@@ -57,32 +55,30 @@
</span><span class="cx">     static const AtomicString&amp; mainDescKeyword();
</span><span class="cx">     static const AtomicString&amp; translationKeyword();
</span><span class="cx">     static const AtomicString&amp; commentaryKeyword();
</span><del>-    const AtomicString&amp; defaultKindKeyword() const override { return emptyAtom; }
</del><span class="cx"> 
</span><del>-    bool enabled() const override { return m_enabled; }
</del><ins>+    bool enabled() const final { return m_enabled; }
</ins><span class="cx">     void setEnabled(const bool);
</span><span class="cx"> 
</span><del>-    void clearClient() override { m_client = nullptr; }
</del><ins>+    void clearClient() final { m_client = nullptr; }
</ins><span class="cx">     AudioTrackClient* client() const { return m_client; }
</span><span class="cx"> 
</span><del>-    size_t inbandTrackIndex();
</del><ins>+    size_t inbandTrackIndex() const;
</ins><span class="cx"> 
</span><del>-    void setPrivate(PassRefPtr&lt;AudioTrackPrivate&gt;);
</del><ins>+    void setPrivate(AudioTrackPrivate&amp;);
</ins><span class="cx"> 
</span><del>-protected:
-    AudioTrack(AudioTrackClient*, PassRefPtr&lt;AudioTrackPrivate&gt;);
-
</del><span class="cx"> private:
</span><del>-    bool isValidKind(const AtomicString&amp;) const override;
</del><ins>+    AudioTrack(AudioTrackClient&amp;, AudioTrackPrivate&amp;);
</ins><span class="cx"> 
</span><ins>+    bool isValidKind(const AtomicString&amp;) const final;
+
</ins><span class="cx">     // AudioTrackPrivateClient
</span><del>-    void enabledChanged(AudioTrackPrivate*, bool) override;
</del><ins>+    void enabledChanged(bool) final;
</ins><span class="cx"> 
</span><span class="cx">     // TrackPrivateBaseClient
</span><del>-    void idChanged(TrackPrivateBase*, const AtomicString&amp;) override;
-    void labelChanged(TrackPrivateBase*, const AtomicString&amp;) override;
-    void languageChanged(TrackPrivateBase*, const AtomicString&amp;) override;
-    void willRemove(TrackPrivateBase*) override;
</del><ins>+    void idChanged(const AtomicString&amp;) final;
+    void labelChanged(const AtomicString&amp;) final;
+    void languageChanged(const AtomicString&amp;) final;
+    void willRemove() final;
</ins><span class="cx"> 
</span><span class="cx">     void updateKindFromPrivate();
</span><span class="cx"> 
</span><span class="lines">@@ -89,7 +85,7 @@
</span><span class="cx">     bool m_enabled;
</span><span class="cx">     AudioTrackClient* m_client;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;AudioTrackPrivate&gt; m_private;
</del><ins>+    Ref&lt;AudioTrackPrivate&gt; m_private;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandDataTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2014 Cable Television Labs Inc.  All rights reserved.
</span><del>- * Copyright (C) 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -33,18 +33,17 @@
</span><span class="cx"> #include &quot;HTMLMediaElement.h&quot;
</span><span class="cx"> #include &quot;InbandTextTrackPrivate.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><del>-#include &lt;runtime/ArrayBuffer.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-Ref&lt;InbandDataTextTrack&gt; InbandDataTextTrack::create(ScriptExecutionContext* context, TextTrackClient* client, RefPtr&lt;InbandTextTrackPrivate&gt;&amp;&amp; trackPrivate)
</del><ins>+inline InbandDataTextTrack::InbandDataTextTrack(ScriptExecutionContext&amp; context, TextTrackClient&amp; client, InbandTextTrackPrivate&amp; trackPrivate)
+    : InbandTextTrack(context, client, trackPrivate)
</ins><span class="cx"> {
</span><del>-    return adoptRef(*new InbandDataTextTrack(context, client, WTFMove(trackPrivate)));
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-InbandDataTextTrack::InbandDataTextTrack(ScriptExecutionContext* context, TextTrackClient* client, RefPtr&lt;InbandTextTrackPrivate&gt;&amp;&amp; trackPrivate)
-    : InbandTextTrack(context, client, trackPrivate)
</del><ins>+Ref&lt;InbandDataTextTrack&gt; InbandDataTextTrack::create(ScriptExecutionContext&amp; context, TextTrackClient&amp; client, InbandTextTrackPrivate&amp; trackPrivate)
</ins><span class="cx"> {
</span><ins>+    return adoptRef(*new InbandDataTextTrack(context, client, trackPrivate));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InbandDataTextTrack::~InbandDataTextTrack()
</span><span class="lines">@@ -51,7 +50,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, const void* data, unsigned length)
</del><ins>+void InbandDataTextTrack::addDataCue(const MediaTime&amp; start, const MediaTime&amp; end, const void* data, unsigned length)
</ins><span class="cx"> {
</span><span class="cx">     addCue(DataCue::create(*scriptExecutionContext(), start, end, data, length));
</span><span class="cx"> }
</span><span class="lines">@@ -58,10 +57,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><span class="cx"> 
</span><del>-void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt; prpPlatformValue, const String&amp; type)
</del><ins>+void InbandDataTextTrack::addDataCue(const MediaTime&amp; start, const MediaTime&amp; end, Ref&lt;SerializedPlatformRepresentation&gt;&amp;&amp; platformValue, const String&amp; type)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;SerializedPlatformRepresentation&gt; platformValue = prpPlatformValue;
-    if (m_incompleteCueMap.find(platformValue.get()) != m_incompleteCueMap.end())
</del><ins>+    if (m_incompleteCueMap.contains(platformValue.ptr()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     auto cue = DataCue::create(*scriptExecutionContext(), start, end, platformValue.copyRef(), type);
</span><span class="lines">@@ -78,25 +76,19 @@
</span><span class="cx">     addCue(WTFMove(cue));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandDataTextTrack::updateDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; inEnd, PassRefPtr&lt;SerializedPlatformRepresentation&gt; prpPlatformValue)
</del><ins>+void InbandDataTextTrack::updateDataCue(const MediaTime&amp; start, const MediaTime&amp; inEnd, SerializedPlatformRepresentation&amp; platformValue)
</ins><span class="cx"> {
</span><del>-    MediaTime end = inEnd;
-
-    RefPtr&lt;SerializedPlatformRepresentation&gt; platformValue = prpPlatformValue;
-    auto iter = m_incompleteCueMap.find(platformValue.get());
-    if (iter == m_incompleteCueMap.end())
-        return;
-
-    RefPtr&lt;DataCue&gt; cue = iter-&gt;value;
</del><ins>+    RefPtr&lt;DataCue&gt; cue = m_incompleteCueMap.get(&amp;platformValue);
</ins><span class="cx">     if (!cue)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     cue-&gt;willChange();
</span><span class="cx"> 
</span><ins>+    MediaTime end = inEnd;
</ins><span class="cx">     if (end.isPositiveInfinite() &amp;&amp; mediaElement())
</span><span class="cx">         end = mediaElement()-&gt;durationMediaTime();
</span><span class="cx">     else
</span><del>-        m_incompleteCueMap.remove(platformValue.get());
</del><ins>+        m_incompleteCueMap.remove(&amp;platformValue);
</ins><span class="cx"> 
</span><span class="cx">     LOG(Media, &quot;InbandDataTextTrack::updateDataCue: was start=%s, end=%s, will be start=%s, end=%s\n&quot;, toString(cue-&gt;startTime()).utf8().data(), toString(cue-&gt;endTime()).utf8().data(), toString(start).utf8().data(), toString(end).utf8().data());
</span><span class="cx"> 
</span><span class="lines">@@ -106,14 +98,9 @@
</span><span class="cx">     cue-&gt;didChange();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandDataTextTrack::removeDataCue(InbandTextTrackPrivate*, const MediaTime&amp;, const MediaTime&amp;, PassRefPtr&lt;SerializedPlatformRepresentation&gt; prpPlatformValue)
</del><ins>+void InbandDataTextTrack::removeDataCue(const MediaTime&amp;, const MediaTime&amp;, SerializedPlatformRepresentation&amp; platformValue)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;SerializedPlatformRepresentation&gt; platformValue = prpPlatformValue;
-    auto iter = m_incompleteCueMap.find(platformValue.get());
-    if (iter == m_incompleteCueMap.end())
-        return;
-
-    if (RefPtr&lt;DataCue&gt; cue = iter-&gt;value) {
</del><ins>+    if (auto* cue = m_incompleteCueMap.get(&amp;platformValue)) {
</ins><span class="cx">         LOG(Media, &quot;InbandDataTextTrack::removeDataCue removing cue: start=%s, end=%s\n&quot;, toString(cue-&gt;startTime()).utf8().data(), toString(cue-&gt;endTime()).utf8().data());
</span><span class="cx">         removeCue(*cue);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandDataTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandDataTextTrack.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandDataTextTrack.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/InbandDataTextTrack.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2014 Cable Television Labs Inc. All rights reserved.
</span><del>- * Copyright (C) 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -33,23 +33,21 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class DataCue;
</span><del>-class InbandTextTrackPrivate;
-class SerializedPlatformRepresentation;
</del><span class="cx"> 
</span><span class="cx"> class InbandDataTextTrack final : public InbandTextTrack {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;InbandDataTextTrack&gt; create(ScriptExecutionContext*, TextTrackClient*, RefPtr&lt;InbandTextTrackPrivate&gt;&amp;&amp;);
</del><ins>+    static Ref&lt;InbandDataTextTrack&gt; create(ScriptExecutionContext&amp;, TextTrackClient&amp;, InbandTextTrackPrivate&amp;);
</ins><span class="cx">     virtual ~InbandDataTextTrack();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    InbandDataTextTrack(ScriptExecutionContext*, TextTrackClient*, RefPtr&lt;InbandTextTrackPrivate&gt;&amp;&amp;);
</del><ins>+    InbandDataTextTrack(ScriptExecutionContext&amp;, TextTrackClient&amp;, InbandTextTrackPrivate&amp;);
</ins><span class="cx"> 
</span><del>-    void addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, const void*, unsigned) final;
</del><ins>+    void addDataCue(const MediaTime&amp; start, const MediaTime&amp; end, const void*, unsigned) final;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>-    void addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;, const String&amp;) final;
-    void updateDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) final;
-    void removeDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) final;
</del><ins>+    void addDataCue(const MediaTime&amp; start, const MediaTime&amp; end, Ref&lt;SerializedPlatformRepresentation&gt;&amp;&amp;, const String&amp;) final;
+    void updateDataCue(const MediaTime&amp; start, const MediaTime&amp; end, SerializedPlatformRepresentation&amp;) final;
+    void removeDataCue(const MediaTime&amp; start, const MediaTime&amp; end, SerializedPlatformRepresentation&amp;) final;
</ins><span class="cx">     ExceptionOr&lt;void&gt; removeCue(TextTrackCue&amp;) final;
</span><span class="cx"> 
</span><span class="cx">     HashMap&lt;RefPtr&lt;SerializedPlatformRepresentation&gt;, RefPtr&lt;DataCue&gt;&gt; m_incompleteCueMap;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandGenericTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/InbandGenericTextTrack.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012-2014 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -65,14 +65,14 @@
</span><span class="cx">         m_dataToCueMap.remove(data);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;InbandGenericTextTrack&gt; InbandGenericTextTrack::create(ScriptExecutionContext* context, TextTrackClient* client, PassRefPtr&lt;InbandTextTrackPrivate&gt; playerPrivate)
</del><ins>+inline InbandGenericTextTrack::InbandGenericTextTrack(ScriptExecutionContext&amp; context, TextTrackClient&amp; client, InbandTextTrackPrivate&amp; trackPrivate)
+    : InbandTextTrack(context, client, trackPrivate)
</ins><span class="cx"> {
</span><del>-    return adoptRef(*new InbandGenericTextTrack(context, client, playerPrivate));
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-InbandGenericTextTrack::InbandGenericTextTrack(ScriptExecutionContext* context, TextTrackClient* client, PassRefPtr&lt;InbandTextTrackPrivate&gt; trackPrivate)
-    : InbandTextTrack(context, client, trackPrivate)
</del><ins>+Ref&lt;InbandGenericTextTrack&gt; InbandGenericTextTrack::create(ScriptExecutionContext&amp; context, TextTrackClient&amp; client, InbandTextTrackPrivate&amp; trackPrivate)
</ins><span class="cx"> {
</span><ins>+    return adoptRef(*new InbandGenericTextTrack(context, client, trackPrivate));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InbandGenericTextTrack::~InbandGenericTextTrack()
</span><span class="lines">@@ -79,88 +79,85 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandGenericTextTrack::updateCueFromCueData(TextTrackCueGeneric* cue, GenericCueData* cueData)
</del><ins>+void InbandGenericTextTrack::updateCueFromCueData(TextTrackCueGeneric&amp; cue, GenericCueData&amp; cueData)
</ins><span class="cx"> {
</span><del>-    cue-&gt;willChange();
</del><ins>+    cue.willChange();
</ins><span class="cx"> 
</span><del>-    cue-&gt;setStartTime(cueData-&gt;startTime());
-    MediaTime endTime = cueData-&gt;endTime();
</del><ins>+    cue.setStartTime(cueData.startTime());
+    MediaTime endTime = cueData.endTime();
</ins><span class="cx">     if (endTime.isPositiveInfinite() &amp;&amp; mediaElement())
</span><span class="cx">         endTime = mediaElement()-&gt;durationMediaTime();
</span><del>-    cue-&gt;setEndTime(endTime);
-    cue-&gt;setText(cueData-&gt;content());
-    cue-&gt;setId(cueData-&gt;id());
-    cue-&gt;setBaseFontSizeRelativeToVideoHeight(cueData-&gt;baseFontSize());
-    cue-&gt;setFontSizeMultiplier(cueData-&gt;relativeFontSize());
-    cue-&gt;setFontName(cueData-&gt;fontName());
</del><ins>+    cue.setEndTime(endTime);
+    cue.setText(cueData.content());
+    cue.setId(cueData.id());
+    cue.setBaseFontSizeRelativeToVideoHeight(cueData.baseFontSize());
+    cue.setFontSizeMultiplier(cueData.relativeFontSize());
+    cue.setFontName(cueData.fontName());
</ins><span class="cx"> 
</span><del>-    if (cueData-&gt;position() &gt; 0)
-        cue-&gt;setPosition(std::round(cueData-&gt;position()));
-    if (cueData-&gt;line() &gt; 0)
-        cue-&gt;setLine(std::round(cueData-&gt;line()));
-    if (cueData-&gt;size() &gt; 0)
-        cue-&gt;setSize(std::round(cueData-&gt;size()));
-    if (cueData-&gt;backgroundColor().isValid())
-        cue-&gt;setBackgroundColor(cueData-&gt;backgroundColor().rgb());
-    if (cueData-&gt;foregroundColor().isValid())
-        cue-&gt;setForegroundColor(cueData-&gt;foregroundColor().rgb());
-    if (cueData-&gt;highlightColor().isValid())
-        cue-&gt;setHighlightColor(cueData-&gt;highlightColor().rgb());
</del><ins>+    if (cueData.position() &gt; 0)
+        cue.setPosition(std::round(cueData.position()));
+    if (cueData.line() &gt; 0)
+        cue.setLine(std::round(cueData.line()));
+    if (cueData.size() &gt; 0)
+        cue.setSize(std::round(cueData.size()));
+    if (cueData.backgroundColor().isValid())
+        cue.setBackgroundColor(cueData.backgroundColor().rgb());
+    if (cueData.foregroundColor().isValid())
+        cue.setForegroundColor(cueData.foregroundColor().rgb());
+    if (cueData.highlightColor().isValid())
+        cue.setHighlightColor(cueData.highlightColor().rgb());
</ins><span class="cx"> 
</span><del>-    if (cueData-&gt;align() == GenericCueData::Start)
-        cue-&gt;setAlign(ASCIILiteral(&quot;start&quot;));
-    else if (cueData-&gt;align() == GenericCueData::Middle)
-        cue-&gt;setAlign(ASCIILiteral(&quot;middle&quot;));
-    else if (cueData-&gt;align() == GenericCueData::End)
-        cue-&gt;setAlign(ASCIILiteral(&quot;end&quot;));
-    cue-&gt;setSnapToLines(false);
</del><ins>+    if (cueData.align() == GenericCueData::Start)
+        cue.setAlign(ASCIILiteral(&quot;start&quot;));
+    else if (cueData.align() == GenericCueData::Middle)
+        cue.setAlign(ASCIILiteral(&quot;middle&quot;));
+    else if (cueData.align() == GenericCueData::End)
+        cue.setAlign(ASCIILiteral(&quot;end&quot;));
+    cue.setSnapToLines(false);
</ins><span class="cx"> 
</span><del>-    cue-&gt;didChange();
</del><ins>+    cue.didChange();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandGenericTextTrack::addGenericCue(InbandTextTrackPrivate* trackPrivate, PassRefPtr&lt;GenericCueData&gt; prpCueData)
</del><ins>+void InbandGenericTextTrack::addGenericCue(GenericCueData&amp; cueData)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
-
-    RefPtr&lt;GenericCueData&gt; cueData = prpCueData;
-    if (m_cueMap.find(*cueData))
</del><ins>+    if (m_cueMap.find(cueData))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    auto cue = TextTrackCueGeneric::create(*scriptExecutionContext(), cueData-&gt;startTime(), cueData-&gt;endTime(), cueData-&gt;content());
-    updateCueFromCueData(cue.ptr(), cueData.get());
</del><ins>+    auto cue = TextTrackCueGeneric::create(*scriptExecutionContext(), cueData.startTime(), cueData.endTime(), cueData.content());
+    updateCueFromCueData(cue.get(), cueData);
</ins><span class="cx">     if (hasCue(cue.ptr(), TextTrackCue::IgnoreDuration)) {
</span><del>-        LOG(Media, &quot;InbandGenericTextTrack::addGenericCue ignoring already added cue: start=%s, end=%s, content=\&quot;%s\&quot;\n&quot;, toString(cueData-&gt;startTime()).utf8().data(), toString(cueData-&gt;endTime()).utf8().data(), cueData-&gt;content().utf8().data());
</del><ins>+        LOG(Media, &quot;InbandGenericTextTrack::addGenericCue ignoring already added cue: start=%s, end=%s, content=\&quot;%s\&quot;\n&quot;, toString(cueData.startTime()).utf8().data(), toString(cueData.endTime()).utf8().data(), cueData.content().utf8().data());
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    LOG(Media, &quot;InbandGenericTextTrack::addGenericCue added cue: start=%.2f, end=%.2f, content=\&quot;%s\&quot;\n&quot;, cueData-&gt;startTime().toDouble(), cueData-&gt;endTime().toDouble(), cueData-&gt;content().utf8().data());
</del><ins>+    LOG(Media, &quot;InbandGenericTextTrack::addGenericCue added cue: start=%.2f, end=%.2f, content=\&quot;%s\&quot;\n&quot;, cueData.startTime().toDouble(), cueData.endTime().toDouble(), cueData.content().utf8().data());
</ins><span class="cx"> 
</span><del>-    if (cueData-&gt;status() != GenericCueData::Complete)
-        m_cueMap.add(*cueData, cue);
</del><ins>+    if (cueData.status() != GenericCueData::Complete)
+        m_cueMap.add(cueData, cue);
</ins><span class="cx"> 
</span><span class="cx">     addCue(WTFMove(cue));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandGenericTextTrack::updateGenericCue(InbandTextTrackPrivate*, GenericCueData* cueData)
</del><ins>+void InbandGenericTextTrack::updateGenericCue(GenericCueData&amp; cueData)
</ins><span class="cx"> {
</span><del>-    auto* cue = m_cueMap.find(*cueData);
</del><ins>+    auto* cue = m_cueMap.find(cueData);
</ins><span class="cx">     if (!cue)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    updateCueFromCueData(cue, cueData);
</del><ins>+    updateCueFromCueData(*cue, cueData);
</ins><span class="cx"> 
</span><del>-    if (cueData-&gt;status() == GenericCueData::Complete)
-        m_cueMap.remove(*cueData);
</del><ins>+    if (cueData.status() == GenericCueData::Complete)
+        m_cueMap.remove(cueData);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandGenericTextTrack::removeGenericCue(InbandTextTrackPrivate*, GenericCueData* cueData)
</del><ins>+void InbandGenericTextTrack::removeGenericCue(GenericCueData&amp; cueData)
</ins><span class="cx"> {
</span><del>-    auto* cue = m_cueMap.find(*cueData);
</del><ins>+    auto* cue = m_cueMap.find(cueData);
</ins><span class="cx">     if (cue) {
</span><del>-        LOG(Media, &quot;InbandGenericTextTrack::removeGenericCue removing cue: start=%s, end=%s, content=\&quot;%s\&quot;\n&quot;,  toString(cueData-&gt;startTime()).utf8().data(), toString(cueData-&gt;endTime()).utf8().data(), cueData-&gt;content().utf8().data());
</del><ins>+        LOG(Media, &quot;InbandGenericTextTrack::removeGenericCue removing cue: start=%s, end=%s, content=\&quot;%s\&quot;\n&quot;,  toString(cueData.startTime()).utf8().data(), toString(cueData.endTime()).utf8().data(), cueData.content().utf8().data());
</ins><span class="cx">         removeCue(*cue);
</span><span class="cx">     } else {
</span><del>-        LOG(Media, &quot;InbandGenericTextTrack::removeGenericCue UNABLE to find cue: start=%.2f, end=%.2f, content=\&quot;%s\&quot;\n&quot;, cueData-&gt;startTime().toDouble(), cueData-&gt;endTime().toDouble(), cueData-&gt;content().utf8().data());
</del><ins>+        LOG(Media, &quot;InbandGenericTextTrack::removeGenericCue UNABLE to find cue: start=%.2f, end=%.2f, content=\&quot;%s\&quot;\n&quot;, cueData.startTime().toDouble(), cueData.endTime().toDouble(), cueData.content().utf8().data());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -179,15 +176,13 @@
</span><span class="cx">     return *m_webVTTParser;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandGenericTextTrack::parseWebVTTCueData(InbandTextTrackPrivate* trackPrivate, const ISOWebVTTCue&amp; cueData)
</del><ins>+void InbandGenericTextTrack::parseWebVTTCueData(const ISOWebVTTCue&amp; cueData)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     parser().parseCueData(cueData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandGenericTextTrack::parseWebVTTFileHeader(InbandTextTrackPrivate* trackPrivate, String&amp;&amp; header)
</del><ins>+void InbandGenericTextTrack::parseWebVTTFileHeader(String&amp;&amp; header)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     parser().parseFileHeader(WTFMove(header));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -214,7 +209,7 @@
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; region : newRegions) {
</span><span class="cx">         region-&gt;setTrack(this);
</span><del>-        regions()-&gt;add(region);
</del><ins>+        regions()-&gt;add(region.releaseNonNull());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandGenericTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandGenericTextTrack.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandGenericTextTrack.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/InbandGenericTextTrack.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -33,9 +33,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class Document;
-class InbandTextTrackPrivate;
-
</del><span class="cx"> class GenericTextTrackCueMap {
</span><span class="cx"> public:
</span><span class="cx">     void add(GenericCueData&amp;, TextTrackCueGeneric&amp;);
</span><span class="lines">@@ -56,23 +53,22 @@
</span><span class="cx"> 
</span><span class="cx"> class InbandGenericTextTrack final : public InbandTextTrack, private WebVTTParserClient {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;InbandGenericTextTrack&gt; create(ScriptExecutionContext*, TextTrackClient*, PassRefPtr&lt;InbandTextTrackPrivate&gt;);
</del><ins>+    static Ref&lt;InbandGenericTextTrack&gt; create(ScriptExecutionContext&amp;, TextTrackClient&amp;, InbandTextTrackPrivate&amp;);
</ins><span class="cx">     virtual ~InbandGenericTextTrack();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    InbandGenericTextTrack(ScriptExecutionContext*, TextTrackClient*, PassRefPtr&lt;InbandTextTrackPrivate&gt;);
</del><ins>+    InbandGenericTextTrack(ScriptExecutionContext&amp;, TextTrackClient&amp;, InbandTextTrackPrivate&amp;);
</ins><span class="cx"> 
</span><del>-    void addGenericCue(InbandTextTrackPrivate*, PassRefPtr&lt;GenericCueData&gt;) final;
-    void updateGenericCue(InbandTextTrackPrivate*, GenericCueData*) final;
-    void removeGenericCue(InbandTextTrackPrivate*, GenericCueData*) final;
</del><ins>+    void addGenericCue(GenericCueData&amp;) final;
+    void updateGenericCue(GenericCueData&amp;) final;
+    void removeGenericCue(GenericCueData&amp;) final;
</ins><span class="cx">     ExceptionOr&lt;void&gt; removeCue(TextTrackCue&amp;) final;
</span><span class="cx"> 
</span><del>-    PassRefPtr&lt;TextTrackCueGeneric&gt; createCue(PassRefPtr&lt;GenericCueData&gt;);
-    void updateCueFromCueData(TextTrackCueGeneric*, GenericCueData*);
</del><ins>+    void updateCueFromCueData(TextTrackCueGeneric&amp;, GenericCueData&amp;);
</ins><span class="cx"> 
</span><span class="cx">     WebVTTParser&amp; parser();
</span><del>-    void parseWebVTTCueData(InbandTextTrackPrivate*, const ISOWebVTTCue&amp;) final;
-    void parseWebVTTFileHeader(InbandTextTrackPrivate*, String&amp;&amp;) final;
</del><ins>+    void parseWebVTTCueData(const ISOWebVTTCue&amp;) final;
+    void parseWebVTTFileHeader(String&amp;&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     void newCuesParsed() final;
</span><span class="cx">     void newRegionsParsed() final;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandTextTrack.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandTextTrack.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/InbandTextTrack.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,29 +24,21 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;InbandTextTrack.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><del>-#include &quot;InbandTextTrack.h&quot;
-
-#include &quot;Document.h&quot;
-#include &quot;Event.h&quot;
</del><span class="cx"> #include &quot;HTMLMediaElement.h&quot;
</span><span class="cx"> #include &quot;InbandDataTextTrack.h&quot;
</span><span class="cx"> #include &quot;InbandGenericTextTrack.h&quot;
</span><span class="cx"> #include &quot;InbandTextTrackPrivate.h&quot;
</span><span class="cx"> #include &quot;InbandWebVTTTextTrack.h&quot;
</span><del>-#include &quot;Logging.h&quot;
-#include &quot;TextTrackCueList.h&quot;
-#include &lt;math.h&gt;
-#include &lt;wtf/text/CString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;InbandTextTrack&gt; InbandTextTrack::create(ScriptExecutionContext* context,
-    TextTrackClient* client, PassRefPtr&lt;InbandTextTrackPrivate&gt; trackPrivate)
</del><ins>+Ref&lt;InbandTextTrack&gt; InbandTextTrack::create(ScriptExecutionContext&amp; context, TextTrackClient&amp; client, InbandTextTrackPrivate&amp; trackPrivate)
</ins><span class="cx"> {
</span><del>-    switch (trackPrivate-&gt;cueFormat()) {
</del><ins>+    switch (trackPrivate.cueFormat()) {
</ins><span class="cx">     case InbandTextTrackPrivate::Data:
</span><span class="cx">         return InbandDataTextTrack::create(context, client, trackPrivate);
</span><span class="cx">     case InbandTextTrackPrivate::Generic:
</span><span class="lines">@@ -53,14 +45,13 @@
</span><span class="cx">         return InbandGenericTextTrack::create(context, client, trackPrivate);
</span><span class="cx">     case InbandTextTrackPrivate::WebVTT:
</span><span class="cx">         return InbandWebVTTTextTrack::create(context, client, trackPrivate);
</span><del>-    default:
-        ASSERT_NOT_REACHED();
-        return 0;
</del><span class="cx">     }
</span><ins>+    ASSERT_NOT_REACHED();
+    return InbandDataTextTrack::create(context, client, trackPrivate);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-InbandTextTrack::InbandTextTrack(ScriptExecutionContext* context, TextTrackClient* client, PassRefPtr&lt;InbandTextTrackPrivate&gt; trackPrivate)
-    : TextTrack(context, client, emptyAtom, trackPrivate-&gt;id(), trackPrivate-&gt;label(), trackPrivate-&gt;language(), InBand)
</del><ins>+InbandTextTrack::InbandTextTrack(ScriptExecutionContext&amp; context, TextTrackClient&amp; client, InbandTextTrackPrivate&amp; trackPrivate)
+    : TextTrack(&amp;context, &amp;client, emptyAtom, trackPrivate.id(), trackPrivate.label(), trackPrivate.language(), InBand)
</ins><span class="cx">     , m_private(trackPrivate)
</span><span class="cx"> {
</span><span class="cx">     m_private-&gt;setClient(this);
</span><span class="lines">@@ -72,12 +63,9 @@
</span><span class="cx">     m_private-&gt;setClient(nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandTextTrack::setPrivate(PassRefPtr&lt;InbandTextTrackPrivate&gt; trackPrivate)
</del><ins>+void InbandTextTrack::setPrivate(InbandTextTrackPrivate&amp; trackPrivate)
</ins><span class="cx"> {
</span><del>-    ASSERT(m_private);
-    ASSERT(trackPrivate);
-
-    if (m_private == trackPrivate)
</del><ins>+    if (m_private.ptr() == &amp;trackPrivate)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_private-&gt;setClient(nullptr);
</span><span class="lines">@@ -115,80 +103,60 @@
</span><span class="cx"> 
</span><span class="cx"> bool InbandTextTrack::isClosedCaptions() const
</span><span class="cx"> {
</span><del>-    if (!m_private)
-        return false;
-
</del><span class="cx">     return m_private-&gt;isClosedCaptions();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool InbandTextTrack::isSDH() const
</span><span class="cx"> {
</span><del>-    if (!m_private)
-        return false;
-    
</del><span class="cx">     return m_private-&gt;isSDH();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool InbandTextTrack::containsOnlyForcedSubtitles() const
</span><span class="cx"> {
</span><del>-    if (!m_private)
-        return false;
-    
</del><span class="cx">     return m_private-&gt;containsOnlyForcedSubtitles();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool InbandTextTrack::isMainProgramContent() const
</span><span class="cx"> {
</span><del>-    if (!m_private)
-        return false;
-    
</del><span class="cx">     return m_private-&gt;isMainProgramContent();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool InbandTextTrack::isEasyToRead() const
</span><span class="cx"> {
</span><del>-    if (!m_private)
-        return false;
-    
</del><span class="cx">     return m_private-&gt;isEasyToRead();
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> size_t InbandTextTrack::inbandTrackIndex()
</span><span class="cx"> {
</span><del>-    ASSERT(m_private);
</del><span class="cx">     return m_private-&gt;trackIndex();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AtomicString InbandTextTrack::inBandMetadataTrackDispatchType() const
</span><span class="cx"> {
</span><del>-    ASSERT(m_private);
</del><span class="cx">     return m_private-&gt;inBandMetadataTrackDispatchType();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandTextTrack::idChanged(TrackPrivateBase* trackPrivate, const AtomicString&amp; id)
</del><ins>+void InbandTextTrack::idChanged(const AtomicString&amp; id)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     setId(id);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandTextTrack::labelChanged(TrackPrivateBase* trackPrivate, const AtomicString&amp; label)
</del><ins>+void InbandTextTrack::labelChanged(const AtomicString&amp; label)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     setLabel(label);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandTextTrack::languageChanged(TrackPrivateBase* trackPrivate, const AtomicString&amp; language)
</del><ins>+void InbandTextTrack::languageChanged(const AtomicString&amp; language)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     setLanguage(language);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandTextTrack::willRemove(TrackPrivateBase* trackPrivate)
</del><ins>+void InbandTextTrack::willRemove()
</ins><span class="cx"> {
</span><del>-    if (!mediaElement())
</del><ins>+    auto* element = mediaElement();
+    if (!element)
</ins><span class="cx">         return;
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
-    mediaElement()-&gt;removeTextTrack(*this);
</del><ins>+    element-&gt;removeTextTrack(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InbandTextTrack::updateKindFromPrivate()
</span><span class="lines">@@ -196,34 +164,30 @@
</span><span class="cx">     switch (m_private-&gt;kind()) {
</span><span class="cx">     case InbandTextTrackPrivate::Subtitles:
</span><span class="cx">         setKind(Kind::Subtitles);
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case InbandTextTrackPrivate::Captions:
</span><span class="cx">         setKind(Kind::Captions);
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case InbandTextTrackPrivate::Descriptions:
</span><span class="cx">         setKind(Kind::Descriptions);
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case InbandTextTrackPrivate::Chapters:
</span><span class="cx">         setKind(Kind::Chapters);
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case InbandTextTrackPrivate::Metadata:
</span><span class="cx">         setKind(Kind::Metadata);
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case InbandTextTrackPrivate::Forced:
</span><span class="cx">         setKind(Kind::Forced);
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case InbandTextTrackPrivate::None:
</span><del>-    default:
-        ASSERT_NOT_REACHED();
</del><span class="cx">         break;
</span><span class="cx">     }
</span><ins>+    ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MediaTime InbandTextTrack::startTimeVariance() const
</span><span class="cx"> {
</span><del>-    if (!m_private)
-        return MediaTime::zeroTime();
-    
</del><span class="cx">     return m_private-&gt;startTimeVariance();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandTextTrack.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandTextTrack.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/InbandTextTrack.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,15 +29,12 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;InbandTextTrackPrivateClient.h&quot;
</span><span class="cx"> #include &quot;TextTrack.h&quot;
</span><del>-#include &quot;TextTrackCueGeneric.h&quot;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/TypeCasts.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class InbandTextTrack : public TextTrack, public InbandTextTrackPrivateClient {
</del><ins>+class InbandTextTrack : public TextTrack, private InbandTextTrackPrivateClient {
</ins><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;InbandTextTrack&gt; create(ScriptExecutionContext*, TextTrackClient*, PassRefPtr&lt;InbandTextTrackPrivate&gt;);
</del><ins>+    static Ref&lt;InbandTextTrack&gt; create(ScriptExecutionContext&amp;, TextTrackClient&amp;, InbandTextTrackPrivate&amp;);
</ins><span class="cx">     virtual ~InbandTextTrack();
</span><span class="cx"> 
</span><span class="cx">     bool isClosedCaptions() const override;
</span><span class="lines">@@ -50,38 +47,38 @@
</span><span class="cx"> 
</span><span class="cx">     AtomicString inBandMetadataTrackDispatchType() const override;
</span><span class="cx"> 
</span><del>-    void setPrivate(PassRefPtr&lt;InbandTextTrackPrivate&gt;);
</del><ins>+    void setPrivate(InbandTextTrackPrivate&amp;);
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    InbandTextTrack(ScriptExecutionContext*, TextTrackClient*, PassRefPtr&lt;InbandTextTrackPrivate&gt;);
</del><ins>+    InbandTextTrack(ScriptExecutionContext&amp;, TextTrackClient&amp;, InbandTextTrackPrivate&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void setModeInternal(Mode);
</span><span class="cx">     void updateKindFromPrivate();
</span><span class="cx"> 
</span><del>-    RefPtr&lt;InbandTextTrackPrivate&gt; m_private;
</del><ins>+    Ref&lt;InbandTextTrackPrivate&gt; m_private;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     bool isInband() const final { return true; }
</span><del>-    void idChanged(TrackPrivateBase*, const AtomicString&amp;) override;
-    void labelChanged(TrackPrivateBase*, const AtomicString&amp;) override;
-    void languageChanged(TrackPrivateBase*, const AtomicString&amp;) override;
-    void willRemove(TrackPrivateBase*) override;
</del><ins>+    void idChanged(const AtomicString&amp;) override;
+    void labelChanged(const AtomicString&amp;) override;
+    void languageChanged(const AtomicString&amp;) override;
+    void willRemove() override;
</ins><span class="cx"> 
</span><del>-    void addDataCue(InbandTextTrackPrivate*, const MediaTime&amp;, const MediaTime&amp;, const void*, unsigned) override { ASSERT_NOT_REACHED(); }
</del><ins>+    void addDataCue(const MediaTime&amp;, const MediaTime&amp;, const void*, unsigned) override { ASSERT_NOT_REACHED(); }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>-    void addDataCue(InbandTextTrackPrivate*, const MediaTime&amp;, const MediaTime&amp;, PassRefPtr&lt;SerializedPlatformRepresentation&gt;, const String&amp;) override { ASSERT_NOT_REACHED(); }
-    void updateDataCue(InbandTextTrackPrivate*, const MediaTime&amp;, const MediaTime&amp;, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) override  { ASSERT_NOT_REACHED(); }
-    void removeDataCue(InbandTextTrackPrivate*, const MediaTime&amp;, const MediaTime&amp;, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) override  { ASSERT_NOT_REACHED(); }
</del><ins>+    void addDataCue(const MediaTime&amp;, const MediaTime&amp;, Ref&lt;SerializedPlatformRepresentation&gt;&amp;&amp;, const String&amp;) override { ASSERT_NOT_REACHED(); }
+    void updateDataCue(const MediaTime&amp;, const MediaTime&amp;, SerializedPlatformRepresentation&amp;) override  { ASSERT_NOT_REACHED(); }
+    void removeDataCue(const MediaTime&amp;, const MediaTime&amp;, SerializedPlatformRepresentation&amp;) override  { ASSERT_NOT_REACHED(); }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void addGenericCue(InbandTextTrackPrivate*, PassRefPtr&lt;GenericCueData&gt;) override { ASSERT_NOT_REACHED(); }
-    void updateGenericCue(InbandTextTrackPrivate*, GenericCueData*) override { ASSERT_NOT_REACHED(); }
-    void removeGenericCue(InbandTextTrackPrivate*, GenericCueData*) override { ASSERT_NOT_REACHED(); }
</del><ins>+    void addGenericCue(GenericCueData&amp;) override { ASSERT_NOT_REACHED(); }
+    void updateGenericCue(GenericCueData&amp;) override { ASSERT_NOT_REACHED(); }
+    void removeGenericCue(GenericCueData&amp;) override { ASSERT_NOT_REACHED(); }
</ins><span class="cx"> 
</span><del>-    void parseWebVTTFileHeader(InbandTextTrackPrivate*, String&amp;&amp;) override { ASSERT_NOT_REACHED(); }
-    void parseWebVTTCueData(InbandTextTrackPrivate*, const char*, unsigned) override { ASSERT_NOT_REACHED(); }
-    void parseWebVTTCueData(InbandTextTrackPrivate*, const ISOWebVTTCue&amp;) override { ASSERT_NOT_REACHED(); }
</del><ins>+    void parseWebVTTFileHeader(String&amp;&amp;) override { ASSERT_NOT_REACHED(); }
+    void parseWebVTTCueData(const char*, unsigned) override { ASSERT_NOT_REACHED(); }
+    void parseWebVTTCueData(const ISOWebVTTCue&amp;) override { ASSERT_NOT_REACHED(); }
</ins><span class="cx"> 
</span><span class="cx">     MediaTime startTimeVariance() const override;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandWebVTTTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2014 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,27 +24,26 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;InbandWebVTTTextTrack.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><del>-#include &quot;InbandWebVTTTextTrack.h&quot;
-
</del><span class="cx"> #include &quot;InbandTextTrackPrivate.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><del>-#include &quot;NotImplemented.h&quot;
</del><ins>+#include &quot;VTTCue.h&quot;
</ins><span class="cx"> #include &quot;VTTRegionList.h&quot;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-Ref&lt;InbandTextTrack&gt; InbandWebVTTTextTrack::create(ScriptExecutionContext* context, TextTrackClient* client, PassRefPtr&lt;InbandTextTrackPrivate&gt; playerPrivate)
</del><ins>+inline InbandWebVTTTextTrack::InbandWebVTTTextTrack(ScriptExecutionContext&amp; context, TextTrackClient&amp; client, InbandTextTrackPrivate&amp; trackPrivate)
+    : InbandTextTrack(context, client, trackPrivate)
</ins><span class="cx"> {
</span><del>-    return adoptRef(*new InbandWebVTTTextTrack(context, client, playerPrivate));
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-InbandWebVTTTextTrack::InbandWebVTTTextTrack(ScriptExecutionContext* context, TextTrackClient* client, PassRefPtr&lt;InbandTextTrackPrivate&gt; trackPrivate)
-    : InbandTextTrack(context, client, trackPrivate)
</del><ins>+Ref&lt;InbandTextTrack&gt; InbandWebVTTTextTrack::create(ScriptExecutionContext&amp; context, TextTrackClient&amp; client, InbandTextTrackPrivate&amp; trackPrivate)
</ins><span class="cx"> {
</span><ins>+    return adoptRef(*new InbandWebVTTTextTrack(context, client, trackPrivate));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InbandWebVTTTextTrack::~InbandWebVTTTextTrack()
</span><span class="lines">@@ -58,15 +57,13 @@
</span><span class="cx">     return *m_webVTTParser;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandWebVTTTextTrack::parseWebVTTCueData(InbandTextTrackPrivate* trackPrivate, const char* data, unsigned length)
</del><ins>+void InbandWebVTTTextTrack::parseWebVTTCueData(const char* data, unsigned length)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     parser().parseBytes(data, length);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InbandWebVTTTextTrack::parseWebVTTCueData(InbandTextTrackPrivate* trackPrivate, const ISOWebVTTCue&amp; cueData)
</del><ins>+void InbandWebVTTTextTrack::parseWebVTTCueData(const ISOWebVTTCue&amp; cueData)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     parser().parseCueData(cueData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -74,10 +71,8 @@
</span><span class="cx"> {
</span><span class="cx">     Vector&lt;RefPtr&lt;WebVTTCueData&gt;&gt; cues;
</span><span class="cx">     parser().getNewCues(cues);
</span><del>-
</del><span class="cx">     for (auto&amp; cueData : cues) {
</span><span class="cx">         auto vttCue = VTTCue::create(*scriptExecutionContext(), *cueData);
</span><del>-
</del><span class="cx">         if (hasCue(vttCue.ptr(), TextTrackCue::IgnoreDuration)) {
</span><span class="cx">             LOG(Media, &quot;InbandWebVTTTextTrack::newCuesParsed ignoring already added cue: start=%.2f, end=%.2f, content=\&quot;%s\&quot;\n&quot;, vttCue-&gt;startTime(), vttCue-&gt;endTime(), vttCue-&gt;text().utf8().data());
</span><span class="cx">             return;
</span><span class="lines">@@ -90,13 +85,12 @@
</span><span class="cx"> {
</span><span class="cx">     Vector&lt;RefPtr&lt;VTTRegion&gt;&gt; newRegions;
</span><span class="cx">     parser().getNewRegions(newRegions);
</span><del>-
</del><span class="cx">     for (auto&amp; region : newRegions) {
</span><span class="cx">         region-&gt;setTrack(this);
</span><del>-        regions()-&gt;add(region);
</del><ins>+        regions()-&gt;add(region.releaseNonNull());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><del>-    
</del><ins>+
</ins><span class="cx"> void InbandWebVTTTextTrack::fileFailedToParse()
</span><span class="cx"> {
</span><span class="cx">     LOG(Media, &quot;Error parsing WebVTT stream.&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackInbandWebVTTTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/InbandWebVTTTextTrack.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -30,25 +30,24 @@
</span><span class="cx"> #include &quot;InbandTextTrack.h&quot;
</span><span class="cx"> #include &quot;WebVTTParser.h&quot;
</span><span class="cx"> #include &lt;memory&gt;
</span><del>-#include &lt;wtf/RefPtr.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class InbandWebVTTTextTrack final : public InbandTextTrack, private WebVTTParserClient {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;InbandTextTrack&gt; create(ScriptExecutionContext*, TextTrackClient*, PassRefPtr&lt;InbandTextTrackPrivate&gt;);
</del><ins>+    static Ref&lt;InbandTextTrack&gt; create(ScriptExecutionContext&amp;, TextTrackClient&amp;, InbandTextTrackPrivate&amp;);
</ins><span class="cx">     virtual ~InbandWebVTTTextTrack();
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    InbandWebVTTTextTrack(ScriptExecutionContext*, TextTrackClient*, PassRefPtr&lt;InbandTextTrackPrivate&gt;);
</del><ins>+    InbandWebVTTTextTrack(ScriptExecutionContext&amp;, TextTrackClient&amp;, InbandTextTrackPrivate&amp;);
</ins><span class="cx"> 
</span><span class="cx">     WebVTTParser&amp; parser();
</span><del>-    void parseWebVTTCueData(InbandTextTrackPrivate*, const char* data, unsigned length) override;
-    void parseWebVTTCueData(InbandTextTrackPrivate*, const ISOWebVTTCue&amp;) override;
</del><ins>+    void parseWebVTTCueData(const char* data, unsigned length) final;
+    void parseWebVTTCueData(const ISOWebVTTCue&amp;) final;
</ins><span class="cx"> 
</span><del>-    void newCuesParsed() override;
-    void newRegionsParsed() override;
-    void fileFailedToParse() override;
</del><ins>+    void newCuesParsed() final;
+    void newRegionsParsed() final;
+    void fileFailedToParse() final;
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;WebVTTParser&gt; m_webVTTParser;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackLoadableTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/LoadableTextTrack.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/LoadableTextTrack.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/LoadableTextTrack.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011, 2013 Google Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011, 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,14 +25,11 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;LoadableTextTrack.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><del>-#include &quot;LoadableTextTrack.h&quot;
-
-#include &quot;Event.h&quot;
</del><span class="cx"> #include &quot;HTMLTrackElement.h&quot;
</span><del>-#include &quot;ScriptExecutionContext.h&quot;
</del><span class="cx"> #include &quot;TextTrackCueList.h&quot;
</span><span class="cx"> #include &quot;VTTRegionList.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -96,11 +94,11 @@
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; newCue : newCues) {
</span><span class="cx">         newCue-&gt;setTrack(this);
</span><del>-        m_cues-&gt;add(newCue);
</del><ins>+        m_cues-&gt;add(newCue.releaseNonNull());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (client())
</span><del>-        client()-&gt;textTrackAddCues(this, m_cues.get());
</del><ins>+        client()-&gt;textTrackAddCues(*this, *m_cues);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void LoadableTextTrack::cueLoadingCompleted(TextTrackLoader* loader, bool loadingFailed)
</span><span class="lines">@@ -122,7 +120,7 @@
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; newRegion : newRegions) {
</span><span class="cx">         newRegion-&gt;setTrack(this);
</span><del>-        regions()-&gt;add(newRegion);
</del><ins>+        regions()-&gt;add(newRegion.releaseNonNull());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackLoadableTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/LoadableTextTrack.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/LoadableTextTrack.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/LoadableTextTrack.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,12 +30,10 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;TextTrack.h&quot;
</span><span class="cx"> #include &quot;TextTrackLoader.h&quot;
</span><del>-#include &lt;wtf/TypeCasts.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class HTMLTrackElement;
</span><del>-class LoadableTextTrack;
</del><span class="cx"> 
</span><span class="cx"> class LoadableTextTrack final : public TextTrack, private TextTrackLoaderClient {
</span><span class="cx"> public:
</span><span class="lines">@@ -49,7 +48,7 @@
</span><span class="cx">     HTMLTrackElement* trackElement() const { return m_trackElement; }
</span><span class="cx">     void clearElement() { m_trackElement = nullptr; }
</span><span class="cx"> 
</span><del>-    void setIsDefault(bool isDefault) final  { m_isDefault = isDefault; }
</del><ins>+    void setIsDefault(bool isDefault) final { m_isDefault = isDefault; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     LoadableTextTrack(HTMLTrackElement&amp;, const String&amp; kind, const String&amp; label, const String&amp; language);
</span><span class="lines">@@ -68,7 +67,7 @@
</span><span class="cx">     Timer m_loadTimer;
</span><span class="cx">     std::unique_ptr&lt;TextTrackLoader&gt; m_loader;
</span><span class="cx">     URL m_url;
</span><del>-    bool m_isDefault;
</del><ins>+    bool m_isDefault { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/TextTrack.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011, 2013 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2011-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -30,11 +30,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;TextTrack.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><del>-#include &quot;TextTrack.h&quot;
-
</del><span class="cx"> #include &quot;Event.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;HTMLMediaElement.h&quot;
</span><span class="lines">@@ -46,8 +45,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static const int invalidTrackIndex = -1;
-
</del><span class="cx"> const AtomicString&amp; TextTrack::subtitlesKeyword()
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const AtomicString&gt; subtitles(&quot;subtitles&quot;, AtomicString::ConstructFromLiteral);
</span><span class="lines">@@ -101,8 +98,6 @@
</span><span class="cx">     , m_scriptExecutionContext(context)
</span><span class="cx">     , m_client(client)
</span><span class="cx">     , m_trackType(type)
</span><del>-    , m_trackIndex(invalidTrackIndex)
-    , m_renderedTrackIndex(invalidTrackIndex)
</del><span class="cx"> {
</span><span class="cx">     if (kind == captionsKeyword())
</span><span class="cx">         m_kind = Kind::Captions;
</span><span class="lines">@@ -120,8 +115,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (m_cues) {
</span><span class="cx">         if (m_client)
</span><del>-            m_client-&gt;textTrackRemoveCues(this, m_cues.get());
-
</del><ins>+            m_client-&gt;textTrackRemoveCues(*this, *m_cues);
</ins><span class="cx">         for (size_t i = 0; i &lt; m_cues-&gt;length(); ++i)
</span><span class="cx">             m_cues-&gt;item(i)-&gt;setTrack(nullptr);
</span><span class="cx">     }
</span><span class="lines">@@ -189,7 +183,7 @@
</span><span class="cx">     // 3. If the sourceBuffer attribute on this track is not null, then queue a task to fire a simple
</span><span class="cx">     // event named change at sourceBuffer.textTracks.
</span><span class="cx">     if (m_sourceBuffer)
</span><del>-        m_sourceBuffer-&gt;textTracks()-&gt;scheduleChangeEvent();
</del><ins>+        m_sourceBuffer-&gt;textTracks().scheduleChangeEvent();
</ins><span class="cx"> 
</span><span class="cx">     // 4. Queue a task to fire a simple event named change at the TextTrackList object referenced by
</span><span class="cx">     // the textTracks attribute on the HTMLMediaElement.
</span><span class="lines">@@ -198,7 +192,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (m_client &amp;&amp; oldKind != m_kind)
</span><del>-        m_client-&gt;textTrackKindChanged(this);
</del><ins>+        m_client-&gt;textTrackKindChanged(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TextTrack::setKindKeywordIgnoringASCIICase(StringView keyword)
</span><span class="lines">@@ -236,7 +230,7 @@
</span><span class="cx">     // If mode changes to disabled, remove this track's cues from the client
</span><span class="cx">     // because they will no longer be accessible from the cues() function.
</span><span class="cx">     if (mode == Mode::Disabled &amp;&amp; m_client &amp;&amp; m_cues)
</span><del>-        m_client-&gt;textTrackRemoveCues(this, m_cues.get());
</del><ins>+        m_client-&gt;textTrackRemoveCues(*this, *m_cues);
</ins><span class="cx"> 
</span><span class="cx">     if (mode != Mode::Showing &amp;&amp; m_cues) {
</span><span class="cx">         for (size_t i = 0; i &lt; m_cues-&gt;length(); ++i) {
</span><span class="lines">@@ -249,7 +243,7 @@
</span><span class="cx">     m_mode = mode;
</span><span class="cx"> 
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;textTrackModeChanged(this);
</del><ins>+        m_client-&gt;textTrackModeChanged(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TextTrackCueList* TextTrack::cues()
</span><span class="lines">@@ -270,7 +264,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;textTrackRemoveCues(this, m_cues.get());
</del><ins>+        m_client-&gt;textTrackRemoveCues(*this, *m_cues);
</ins><span class="cx">     
</span><span class="cx">     for (size_t i = 0; i &lt; m_cues-&gt;length(); ++i)
</span><span class="cx">         m_cues-&gt;item(i)-&gt;setTrack(nullptr);
</span><span class="lines">@@ -288,7 +282,7 @@
</span><span class="cx">     // http://www.whatwg.org/specs/web-apps/current-work/#dom-texttrack-activecues
</span><span class="cx">     if (!m_cues || m_mode == Mode::Disabled)
</span><span class="cx">         return nullptr;
</span><del>-    return m_cues-&gt;activeCues();
</del><ins>+    return &amp;m_cues-&gt;activeCues();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;void&gt; TextTrack::addCue(Ref&lt;TextTrackCue&gt;&amp;&amp; cue)
</span><span class="lines">@@ -310,18 +304,21 @@
</span><span class="cx"> 
</span><span class="cx">     // The addCue(cue) method of TextTrack objects, when invoked, must run the following steps:
</span><span class="cx"> 
</span><ins>+    auto* cueTrack = cue-&gt;track();
+    if (cueTrack == this)
+        return { };
+
</ins><span class="cx">     // 1. If the given cue is in a text track list of cues, then remove cue from that text track
</span><span class="cx">     // list of cues.
</span><del>-    TextTrack* cueTrack = cue-&gt;track();
-    if (cueTrack &amp;&amp; cueTrack != this)
</del><ins>+    if (cueTrack)
</ins><span class="cx">         cueTrack-&gt;removeCue(cue.get());
</span><span class="cx"> 
</span><span class="cx">     // 2. Add cue to the method's TextTrack object's text track's text track list of cues.
</span><span class="cx">     cue-&gt;setTrack(this);
</span><del>-    ensureTextTrackCueList().add(cue.ptr());
</del><ins>+    ensureTextTrackCueList().add(cue.copyRef());
</ins><span class="cx">     
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;textTrackAddCue(this, cue);
</del><ins>+        m_client-&gt;textTrackAddCue(*this, cue);
</ins><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="lines">@@ -338,12 +335,12 @@
</span><span class="cx">         return Exception { NOT_FOUND_ERR };
</span><span class="cx"> 
</span><span class="cx">     // 2. Remove cue from the method's TextTrack object's text track's text track list of cues.
</span><del>-    if (!m_cues || !m_cues-&gt;remove(&amp;cue))
-        return Exception { INVALID_STATE_ERR };
-
</del><ins>+    ASSERT(m_cues);
+    m_cues-&gt;remove(cue);
+    cue.setIsActive(false);
</ins><span class="cx">     cue.setTrack(nullptr);
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;textTrackRemoveCue(this, cue);
</del><ins>+        m_client-&gt;textTrackRemoveCue(*this, cue);
</ins><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="lines">@@ -392,10 +389,9 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // Otherwise: add region to the method's TextTrack object's text track
-    // list of regions.
</del><ins>+    // Otherwise: add region to the method's TextTrack object's text track list of regions.
</ins><span class="cx">     region-&gt;setTrack(this);
</span><del>-    regionList.add(WTFMove(region));
</del><ins>+    regionList.add(region.releaseNonNull());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr&lt;void&gt; TextTrack::removeRegion(VTTRegion* region)
</span><span class="lines">@@ -408,9 +404,8 @@
</span><span class="cx">     if (region-&gt;track() != this)
</span><span class="cx">         return Exception { NOT_FOUND_ERR };
</span><span class="cx"> 
</span><del>-    if (!m_regions || !m_regions-&gt;remove(region))
-        return Exception { INVALID_STATE_ERR };
-
</del><ins>+    ASSERT(m_regions);
+    m_regions-&gt;remove(*region);
</ins><span class="cx">     region-&gt;setTrack(nullptr);
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="lines">@@ -422,7 +417,7 @@
</span><span class="cx"> 
</span><span class="cx">     // The cue may need to be repositioned in the media element's interval tree, may need to
</span><span class="cx">     // be re-rendered, etc, so remove it before the modification...
</span><del>-    m_client-&gt;textTrackRemoveCue(this, *cue);
</del><ins>+    m_client-&gt;textTrackRemoveCue(*this, *cue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TextTrack::cueDidChange(TextTrackCue* cue)
</span><span class="lines">@@ -431,26 +426,24 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Make sure the TextTrackCueList order is up-to-date.
</span><del>-    ensureTextTrackCueList().updateCueIndex(cue);
</del><ins>+    ensureTextTrackCueList().updateCueIndex(*cue);
</ins><span class="cx"> 
</span><span class="cx">     // ... and add it back again.
</span><del>-    m_client-&gt;textTrackAddCue(this, *cue);
</del><ins>+    m_client-&gt;textTrackAddCue(*this, *cue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int TextTrack::trackIndex()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_mediaElement);
</span><del>-
-    if (m_trackIndex == invalidTrackIndex)
</del><ins>+    if (!m_trackIndex)
</ins><span class="cx">         m_trackIndex = m_mediaElement-&gt;textTracks().getTrackIndex(*this);
</span><del>-
-    return m_trackIndex;
</del><ins>+    return m_trackIndex.value();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TextTrack::invalidateTrackIndex()
</span><span class="cx"> {
</span><del>-    m_trackIndex = invalidTrackIndex;
-    m_renderedTrackIndex = invalidTrackIndex;
</del><ins>+    m_trackIndex = std::nullopt;
+    m_renderedTrackIndex = std::nullopt;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool TextTrack::isRendered()
</span><span class="lines">@@ -469,11 +462,9 @@
</span><span class="cx"> int TextTrack::trackIndexRelativeToRenderedTracks()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_mediaElement);
</span><del>-    
-    if (m_renderedTrackIndex == invalidTrackIndex)
</del><ins>+    if (!m_renderedTrackIndex)
</ins><span class="cx">         m_renderedTrackIndex = m_mediaElement-&gt;textTracks().getTrackIndexRelativeToRenderedTracks(*this);
</span><del>-    
-    return m_renderedTrackIndex;
</del><ins>+    return m_renderedTrackIndex.value();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool TextTrack::hasCue(TextTrackCue* cue, TextTrackCue::CueMatchRules match)
</span><span class="lines">@@ -565,7 +556,7 @@
</span><span class="cx">     // 3. If the sourceBuffer attribute on this track is not null, then queue a task to fire a simple
</span><span class="cx">     // event named change at sourceBuffer.textTracks.
</span><span class="cx">     if (m_sourceBuffer)
</span><del>-        m_sourceBuffer-&gt;textTracks()-&gt;scheduleChangeEvent();
</del><ins>+        m_sourceBuffer-&gt;textTracks().scheduleChangeEvent();
</ins><span class="cx"> 
</span><span class="cx">     // 4. Queue a task to fire a simple event named change at the TextTrackList object referenced by
</span><span class="cx">     // the textTracks attribute on the HTMLMediaElement.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrack.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrack.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/TextTrack.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2011, 2012, 2013, 2014 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc.  All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -30,8 +30,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;TextTrackCue.h&quot;
</span><span class="cx"> #include &quot;TrackBase.h&quot;
</span><del>-#include &quot;VTTCue.h&quot;
-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -44,12 +42,12 @@
</span><span class="cx"> class TextTrackClient {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~TextTrackClient() { }
</span><del>-    virtual void textTrackKindChanged(TextTrack*) = 0;
-    virtual void textTrackModeChanged(TextTrack*) = 0;
-    virtual void textTrackAddCues(TextTrack*, const TextTrackCueList*) = 0;
-    virtual void textTrackRemoveCues(TextTrack*, const TextTrackCueList*) = 0;
-    virtual void textTrackAddCue(TextTrack*, TextTrackCue&amp;) = 0;
-    virtual void textTrackRemoveCue(TextTrack*, TextTrackCue&amp;) = 0;
</del><ins>+    virtual void textTrackKindChanged(TextTrack&amp;) = 0;
+    virtual void textTrackModeChanged(TextTrack&amp;) = 0;
+    virtual void textTrackAddCues(TextTrack&amp;, const TextTrackCueList&amp;) = 0;
+    virtual void textTrackRemoveCues(TextTrack&amp;, const TextTrackCueList&amp;) = 0;
+    virtual void textTrackAddCue(TextTrack&amp;, TextTrackCue&amp;) = 0;
+    virtual void textTrackRemoveCue(TextTrack&amp;, TextTrackCue&amp;) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class TextTrack : public TrackBase, public EventTargetWithInlineData {
</span><span class="lines">@@ -167,8 +165,8 @@
</span><span class="cx">     TextTrackClient* m_client;
</span><span class="cx">     TextTrackType m_trackType;
</span><span class="cx">     ReadinessState m_readinessState { NotLoaded };
</span><del>-    int m_trackIndex;
-    int m_renderedTrackIndex;
</del><ins>+    std::optional&lt;int&gt; m_trackIndex;
+    std::optional&lt;int&gt; m_renderedTrackIndex;
</ins><span class="cx">     bool m_hasBeenConfigured { false };
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCue.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCue.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/TextTrackCue.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011, 2013 Google Inc.  All rights reserved.
</span><del>- * Copyright (C) 2011, 2012, 2013, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -30,11 +30,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;TextTrackCue.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><del>-#include &quot;TextTrackCue.h&quot;
-
</del><span class="cx"> #include &quot;CSSPropertyNames.h&quot;
</span><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><span class="cx"> #include &quot;Event.h&quot;
</span><span class="lines">@@ -49,8 +48,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static const int invalidCueIndex = -1;
-
</del><span class="cx"> const AtomicString&amp; TextTrackCue::cueShadowPseudoId()
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;const AtomicString&gt; cue(&quot;cue&quot;, AtomicString::ConstructFromLiteral);
</span><span class="lines">@@ -60,9 +57,6 @@
</span><span class="cx"> TextTrackCue::TextTrackCue(ScriptExecutionContext&amp; context, const MediaTime&amp; start, const MediaTime&amp; end)
</span><span class="cx">     : m_startTime(start)
</span><span class="cx">     , m_endTime(end)
</span><del>-    , m_cueIndex(invalidCueIndex)
-    , m_processingCueChanges(0)
-    , m_track(0)
</del><span class="cx">     , m_scriptExecutionContext(context)
</span><span class="cx">     , m_isActive(false)
</span><span class="cx">     , m_pauseOnExit(false)
</span><span class="lines">@@ -149,23 +143,6 @@
</span><span class="cx">     m_pauseOnExit = value;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int TextTrackCue::cueIndex()
-{
-    if (m_cueIndex == invalidCueIndex) {
-        ASSERT(track());
-        ASSERT(track()-&gt;cues());
-        if (TextTrackCueList* cueList = track()-&gt;cues())
-            m_cueIndex = cueList-&gt;getCueIndex(this);
-    }
-
-    return m_cueIndex;
-}
-
-void TextTrackCue::invalidateCueIndex()
-{
-    m_cueIndex = invalidCueIndex;
-}
-
</del><span class="cx"> bool TextTrackCue::dispatchEvent(Event&amp; event)
</span><span class="cx"> {
</span><span class="cx">     // When a TextTrack's mode is disabled: no cues are active, no events fired.
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCue.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCue.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/TextTrackCue.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2012, 2013, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -65,9 +65,6 @@
</span><span class="cx">     MediaTime endMediaTime() const { return m_endTime; }
</span><span class="cx">     void setEndTime(const MediaTime&amp;);
</span><span class="cx"> 
</span><del>-    int cueIndex();
-    void invalidateCueIndex();
-
</del><span class="cx">     bool isActive();
</span><span class="cx">     virtual void setIsActive(bool);
</span><span class="cx"> 
</span><span class="lines">@@ -82,9 +79,6 @@
</span><span class="cx"> 
</span><span class="cx">     enum CueMatchRules { MatchAllFields, IgnoreDuration };
</span><span class="cx">     virtual bool isEqual(const TextTrackCue&amp;, CueMatchRules) const;
</span><del>-private:
-    virtual bool cueContentsMatch(const TextTrackCue&amp;) const;
-public:
</del><span class="cx">     virtual bool doesExtendCue(const TextTrackCue&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     void willChange();
</span><span class="lines">@@ -108,13 +102,14 @@
</span><span class="cx">     EventTargetInterface eventTargetInterface() const final { return TextTrackCueEventTargetInterfaceType; }
</span><span class="cx">     ScriptExecutionContext* scriptExecutionContext() const final { return &amp;m_scriptExecutionContext; }
</span><span class="cx"> 
</span><ins>+    virtual bool cueContentsMatch(const TextTrackCue&amp;) const;
+
</ins><span class="cx">     String m_id;
</span><span class="cx">     MediaTime m_startTime;
</span><span class="cx">     MediaTime m_endTime;
</span><del>-    int m_cueIndex;
-    int m_processingCueChanges;
</del><ins>+    int m_processingCueChanges { 0 };
</ins><span class="cx"> 
</span><del>-    TextTrack* m_track;
</del><ins>+    TextTrack* m_track { nullptr };
</ins><span class="cx"> 
</span><span class="cx">     ScriptExecutionContext&amp; m_scriptExecutionContext;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCueList.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCueList.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/TextTrackCueList.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Google Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,119 +30,102 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;TextTrackCueList.h&quot;
</span><span class="cx"> 
</span><ins>+// Checking sorting is too slow for general use; turn it on explicitly when working on this class.
+#undef CHECK_SORTING
+
+#ifdef CHECK_SORTING
+#define ASSERT_SORTED(begin, end) ASSERT(std::is_sorted(begin, end, compareCues))
+#else
+#define ASSERT_SORTED(begin, end) ((void)0)
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-TextTrackCueList::TextTrackCueList()
</del><ins>+static inline bool compareCues(const RefPtr&lt;TextTrackCue&gt;&amp; a, const RefPtr&lt;TextTrackCue&gt;&amp; b)
</ins><span class="cx"> {
</span><ins>+    return a-&gt;isOrderedBefore(b.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned long TextTrackCueList::length() const
</del><ins>+unsigned TextTrackCueList::cueIndex(TextTrackCue&amp; cue) const
</ins><span class="cx"> {
</span><del>-    return m_list.size();
</del><ins>+    ASSERT(m_vector.contains(&amp;cue));
+    return m_vector.find(&amp;cue);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned long TextTrackCueList::getCueIndex(TextTrackCue* cue) const
-{
-    return m_list.find(cue);
-}
-
</del><span class="cx"> TextTrackCue* TextTrackCueList::item(unsigned index) const
</span><span class="cx"> {
</span><del>-    if (index &lt; m_list.size())
-        return m_list[index].get();
-    return 0;
</del><ins>+    if (index &gt;= m_vector.size())
+        return nullptr;
+    return m_vector[index].get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TextTrackCue* TextTrackCueList::getCueById(const String&amp; id) const
</span><span class="cx"> {
</span><del>-    for (auto&amp; cue : m_list) {
</del><ins>+    for (auto&amp; cue : m_vector) {
</ins><span class="cx">         if (cue-&gt;id() == id)
</span><span class="cx">             return cue.get();
</span><span class="cx">     }
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-TextTrackCueList* TextTrackCueList::activeCues()
</del><ins>+TextTrackCueList&amp; TextTrackCueList::activeCues()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_activeCues)
</span><span class="cx">         m_activeCues = create();
</span><span class="cx"> 
</span><del>-    m_activeCues-&gt;clear();
-    for (auto&amp; cue : m_list) {
</del><ins>+    Vector&lt;RefPtr&lt;TextTrackCue&gt;&gt; activeCuesVector;
+    for (auto&amp; cue : m_vector) {
</ins><span class="cx">         if (cue-&gt;isActive())
</span><del>-            m_activeCues-&gt;add(cue);
</del><ins>+            activeCuesVector.append(cue);
</ins><span class="cx">     }
</span><del>-    return m_activeCues.get();
</del><ins>+    ASSERT_SORTED(activeCuesVector.begin(), activeCuesVector.end());
+    m_activeCues-&gt;m_vector = WTFMove(activeCuesVector);
+
+    // FIXME: This list of active cues is not updated as cues are added, removed, become active, and become inactive.
+    // Instead it is only updated each time this function is called again. That is not consistent with other dynamic DOM lists.
+    return *m_activeCues;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool TextTrackCueList::add(PassRefPtr&lt;TextTrackCue&gt; cue)
</del><ins>+void TextTrackCueList::add(Ref&lt;TextTrackCue&gt;&amp;&amp; cue)
</ins><span class="cx"> {
</span><ins>+    ASSERT(!m_vector.contains(cue.ptr()));
</ins><span class="cx">     ASSERT(cue-&gt;startMediaTime() &gt;= MediaTime::zeroTime());
</span><span class="cx">     ASSERT(cue-&gt;endMediaTime() &gt;= MediaTime::zeroTime());
</span><span class="cx"> 
</span><del>-    return add(cue, 0, m_list.size());
</del><ins>+    RefPtr&lt;TextTrackCue&gt; cueRefPtr { WTFMove(cue) };
+    unsigned insertionPosition = std::upper_bound(m_vector.begin(), m_vector.end(), cueRefPtr, compareCues) - m_vector.begin();
+    ASSERT_SORTED(m_vector.begin(), m_vector.end());
+    m_vector.insert(insertionPosition, WTFMove(cueRefPtr));
+    ASSERT_SORTED(m_vector.begin(), m_vector.end());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool TextTrackCueList::add(PassRefPtr&lt;TextTrackCue&gt; prpCue, size_t start, size_t end)
</del><ins>+void TextTrackCueList::remove(TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><del>-    ASSERT_WITH_SECURITY_IMPLICATION(start &lt;= m_list.size());
-    ASSERT_WITH_SECURITY_IMPLICATION(end &lt;= m_list.size());
-
-    // Maintain text track cue order:
-    // http://www.whatwg.org/specs/web-apps/current-work/#text-track-cue-order
-    RefPtr&lt;TextTrackCue&gt; cue = prpCue;
-    if (start == end) {
-        if (!m_list.isEmpty() &amp;&amp; (start &gt; 0) &amp;&amp; (m_list[start - 1].get() == cue.get()))
-            return false;
-
-        m_list.insert(start, cue);
-        invalidateCueIndexes(start);
-        return true;
-    }
-
-    size_t index = (start + end) / 2;
-    if (cue-&gt;isOrderedBefore(m_list[index].get()))
-        return add(WTFMove(cue), start, index);
-
-    return add(WTFMove(cue), index + 1, end);
</del><ins>+    ASSERT_SORTED(m_vector.begin(), m_vector.end());
+    m_vector.remove(cueIndex(cue));
+    ASSERT_SORTED(m_vector.begin(), m_vector.end());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool TextTrackCueList::remove(TextTrackCue* cue)
</del><ins>+void TextTrackCueList::updateCueIndex(TextTrackCue&amp; cue)
</ins><span class="cx"> {
</span><del>-    size_t index = m_list.find(cue);
-    if (index == notFound)
-        return false;
</del><ins>+    auto cuePosition = m_vector.begin() + cueIndex(cue);
+    auto afterCuePosition = cuePosition + 1;
</ins><span class="cx"> 
</span><del>-    cue-&gt;setIsActive(false);
-    m_list.remove(index);
-    return true;
-}
</del><ins>+    ASSERT_SORTED(m_vector.begin(), cuePosition);
+    ASSERT_SORTED(afterCuePosition, m_vector.end());
</ins><span class="cx"> 
</span><del>-bool TextTrackCueList::contains(TextTrackCue* cue) const
-{
-    return m_list.contains(cue);
-}
</del><ins>+    auto reinsertionPosition = std::upper_bound(m_vector.begin(), cuePosition, *cuePosition, compareCues);
+    if (reinsertionPosition != cuePosition)
+        std::rotate(reinsertionPosition, cuePosition, afterCuePosition);
+    else {
+        reinsertionPosition = std::upper_bound(afterCuePosition, m_vector.end(), *cuePosition, compareCues);
+        if (reinsertionPosition != afterCuePosition)
+            std::rotate(cuePosition, afterCuePosition, reinsertionPosition);
+    }
</ins><span class="cx"> 
</span><del>-bool TextTrackCueList::updateCueIndex(TextTrackCue* cue)
-{
-    if (!contains(cue))
-        return false;
-    
-    remove(cue);
-    return add(cue);
</del><ins>+    ASSERT_SORTED(m_vector.begin(), m_vector.end());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextTrackCueList::clear()
-{
-    m_list.clear();
-}
-
-void TextTrackCueList::invalidateCueIndexes(size_t start)
-{
-    for (size_t i = start; i &lt; m_list.size(); ++i)
-        m_list[i]-&gt;invalidateCueIndex();
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTextTrackCueListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TextTrackCueList.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TextTrackCueList.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/TextTrackCueList.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,44 +29,42 @@
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;TextTrackCue.h&quot;
</span><del>-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/Vector.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class TextTrackCueList : public RefCounted&lt;TextTrackCueList&gt; {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;TextTrackCueList&gt; create()
-    {
-        return adoptRef(*new TextTrackCueList);
-    }
</del><ins>+    static Ref&lt;TextTrackCueList&gt; create();
</ins><span class="cx"> 
</span><del>-    ~TextTrackCueList() { }
-
-    unsigned long length() const;
-    unsigned long getCueIndex(TextTrackCue*) const;
-
</del><ins>+    unsigned length() const;
</ins><span class="cx">     TextTrackCue* item(unsigned index) const;
</span><span class="cx">     TextTrackCue* getCueById(const String&amp;) const;
</span><del>-    TextTrackCueList* activeCues();
</del><span class="cx"> 
</span><del>-    bool add(PassRefPtr&lt;TextTrackCue&gt;);
-    bool remove(TextTrackCue*);
-    bool contains(TextTrackCue*) const;
-    
-    bool updateCueIndex(TextTrackCue*);
</del><ins>+    unsigned cueIndex(TextTrackCue&amp;) const;
</ins><span class="cx"> 
</span><ins>+    void add(Ref&lt;TextTrackCue&gt;&amp;&amp;);
+    void remove(TextTrackCue&amp;);
+    void updateCueIndex(TextTrackCue&amp;);
+
+    TextTrackCueList&amp; activeCues();
+
</ins><span class="cx"> private:
</span><del>-    TextTrackCueList();
-    bool add(PassRefPtr&lt;TextTrackCue&gt;, size_t, size_t);
-    void clear();
-    void invalidateCueIndexes(size_t);
</del><ins>+    TextTrackCueList() = default;
</ins><span class="cx"> 
</span><del>-    Vector&lt;RefPtr&lt;TextTrackCue&gt;&gt; m_list;
</del><ins>+    Vector&lt;RefPtr&lt;TextTrackCue&gt;&gt; m_vector;
</ins><span class="cx">     RefPtr&lt;TextTrackCueList&gt; m_activeCues;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline Ref&lt;TextTrackCueList&gt; TextTrackCueList::create()
+{
+    return adoptRef(*new TextTrackCueList);
+}
+
+inline unsigned TextTrackCueList::length() const
+{
+    return m_vector.size();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(VIDEO_TRACK)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTrackBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TrackBase.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TrackBase.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/TrackBase.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx">     if (isValidKind(kind))
</span><span class="cx">         m_kind = kind;
</span><span class="cx">     else
</span><del>-        m_kind = defaultKindKeyword();
</del><ins>+        m_kind = emptyAtom;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackTrackBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/TrackBase.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/TrackBase.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/TrackBase.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -27,9 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><del>-#include &quot;EventTarget.h&quot;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/TypeCasts.h&gt;
</del><ins>+#include &lt;wtf/text/AtomicString.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -99,7 +97,6 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     virtual bool isValidKind(const AtomicString&amp;) const = 0;
</span><del>-    virtual const AtomicString&amp; defaultKindKeyword() const = 0;
</del><span class="cx"> 
</span><span class="cx">     AtomicString m_kind;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegionListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTRegionList.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegionList.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/VTTRegionList.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2013 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2014 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,59 +29,43 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-VTTRegionList::VTTRegionList()
-{
-}
-
-unsigned long VTTRegionList::length() const
-{
-    return m_list.size();
-}
-
</del><span class="cx"> VTTRegion* VTTRegionList::item(unsigned index) const
</span><span class="cx"> {
</span><del>-    if (index &lt; m_list.size())
-        return m_list[index].get();
-
-    return 0;
</del><ins>+    if (index &gt;= m_vector.size())
+        return nullptr;
+    return const_cast&lt;VTTRegion*&gt;(m_vector[index].ptr());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> VTTRegion* VTTRegionList::getRegionById(const String&amp; id) const
</span><span class="cx"> {
</span><ins>+    // FIXME: Why is this special case needed?
</ins><span class="cx">     if (id.isEmpty())
</span><del>-        return 0;
-
-    for (const auto&amp; region : m_list) {
</del><ins>+        return nullptr;
+    for (auto&amp; region : m_vector) {
</ins><span class="cx">         if (region-&gt;id() == id)
</span><del>-            return region.get();
</del><ins>+            return const_cast&lt;VTTRegion*&gt;(region.ptr());
</ins><span class="cx">     }
</span><del>-
-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTRegionList::add(PassRefPtr&lt;VTTRegion&gt; region)
</del><ins>+void VTTRegionList::add(Ref&lt;VTTRegion&gt;&amp;&amp; region)
</ins><span class="cx"> {
</span><del>-    m_list.append(region);
</del><ins>+    m_vector.append(WTFMove(region));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool VTTRegionList::remove(VTTRegion* region)
</del><ins>+void VTTRegionList::remove(VTTRegion&amp; region)
</ins><span class="cx"> {
</span><del>-    size_t index = m_list.find(region);
-    if (index == notFound)
-        return false;
-
-    m_list.remove(index);
-    return true;
</del><ins>+    for (unsigned i = 0, size = m_vector.size(); i &lt; size; ++i) {
+        if (m_vector[i].ptr() == &amp;region) {
+            m_vector.remove(i);
+            return;
+        }
+    }
+    ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VTTRegionList::clear()
-{
-    m_list.clear();
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegionListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTRegionList.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegionList.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/VTTRegionList.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2013 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2014 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,36 +29,43 @@
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;VTTRegion.h&quot;
</span><del>-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/Vector.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class VTTRegionList : public RefCounted&lt;VTTRegionList&gt; {
</span><span class="cx"> public:
</span><del>-    static Ref&lt;VTTRegionList&gt; create()
-    {
-        return adoptRef(*new VTTRegionList);
-    }
</del><ins>+    static Ref&lt;VTTRegionList&gt; create();
</ins><span class="cx"> 
</span><del>-    ~VTTRegionList() { }
-
-    unsigned long length() const;
-
</del><ins>+    unsigned length() const;
</ins><span class="cx">     VTTRegion* item(unsigned index) const;
</span><span class="cx">     VTTRegion* getRegionById(const String&amp;) const;
</span><span class="cx"> 
</span><del>-    void add(PassRefPtr&lt;VTTRegion&gt;);
-    bool remove(VTTRegion*);
</del><ins>+    void add(Ref&lt;VTTRegion&gt;&amp;&amp;);
+    void remove(VTTRegion&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    VTTRegionList();
</del><ins>+    VTTRegionList() = default;
+
</ins><span class="cx">     void clear();
</span><span class="cx"> 
</span><del>-    Vector&lt;RefPtr&lt;VTTRegion&gt;&gt; m_list;
</del><ins>+    Vector&lt;Ref&lt;VTTRegion&gt;&gt; m_vector;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline Ref&lt;VTTRegionList&gt; VTTRegionList::create()
+{
+    return adoptRef(*new VTTRegionList);
+}
+
+inline unsigned VTTRegionList::length() const
+{
+    return m_vector.size();
+}
+
+inline void VTTRegionList::clear()
+{
+    m_vector.clear();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(VIDEO_TRACK)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVTTRegionListidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VTTRegionList.idl (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VTTRegionList.idl        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/VTTRegionList.idl        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Google Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,12 +25,11 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><del>-    NoInterfaceObject,
</del><span class="cx">     Conditional=VIDEO_TRACK,
</span><span class="cx">     ImplementationLacksVTable,
</span><ins>+    NoInterfaceObject,
</ins><span class="cx"> ] interface VTTRegionList {
</span><span class="cx">     readonly attribute unsigned long length;
</span><del>-    getter VTTRegion item(unsigned long index);
-    VTTRegion getRegionById(DOMString id);
</del><ins>+    getter VTTRegion? item(unsigned long index);
+    VTTRegion? getRegionById(DOMString id);
</ins><span class="cx"> };
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVideoTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VideoTrack.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VideoTrack.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/VideoTrack.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011 Google Inc.  All rights reserved.
- * Copyright (C) 2011, 2012, 2013 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -30,12 +30,10 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;VideoTrack.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><del>-#include &quot;VideoTrack.h&quot;
-
-#include &quot;Event.h&quot;
</del><span class="cx"> #include &quot;HTMLMediaElement.h&quot;
</span><span class="cx"> #include &quot;VideoTrackList.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -81,10 +79,10 @@
</span><span class="cx">     return commentary;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-VideoTrack::VideoTrack(VideoTrackClient* client, PassRefPtr&lt;VideoTrackPrivate&gt; trackPrivate)
-    : MediaTrackBase(MediaTrackBase::VideoTrack, trackPrivate-&gt;id(), trackPrivate-&gt;label(), trackPrivate-&gt;language())
-    , m_selected(trackPrivate-&gt;selected())
-    , m_client(client)
</del><ins>+VideoTrack::VideoTrack(VideoTrackClient&amp; client, VideoTrackPrivate&amp; trackPrivate)
+    : MediaTrackBase(MediaTrackBase::VideoTrack, trackPrivate.id(), trackPrivate.label(), trackPrivate.language())
+    , m_selected(trackPrivate.selected())
+    , m_client(&amp;client)
</ins><span class="cx">     , m_private(trackPrivate)
</span><span class="cx"> {
</span><span class="cx">     m_private-&gt;setClient(this);
</span><span class="lines">@@ -93,15 +91,12 @@
</span><span class="cx"> 
</span><span class="cx"> VideoTrack::~VideoTrack()
</span><span class="cx"> {
</span><del>-    m_private-&gt;setClient(0);
</del><ins>+    m_private-&gt;setClient(nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VideoTrack::setPrivate(PassRefPtr&lt;VideoTrackPrivate&gt; trackPrivate)
</del><ins>+void VideoTrack::setPrivate(VideoTrackPrivate&amp; trackPrivate)
</ins><span class="cx"> {
</span><del>-    ASSERT(m_private);
-    ASSERT(trackPrivate);
-
-    if (m_private == trackPrivate)
</del><ins>+    if (m_private.ptr() == &amp;trackPrivate)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_private-&gt;setClient(nullptr);
</span><span class="lines">@@ -114,20 +109,12 @@
</span><span class="cx"> 
</span><span class="cx"> bool VideoTrack::isValidKind(const AtomicString&amp; value) const
</span><span class="cx"> {
</span><del>-    if (value == alternativeKeyword())
-        return true;
-    if (value == captionsKeyword())
-        return true;
-    if (value == mainKeyword())
-        return true;
-    if (value == signKeyword())
-        return true;
-    if (value == subtitlesKeyword())
-        return true;
-    if (value == commentaryKeyword())
-        return true;
-
-    return false;
</del><ins>+    return value == alternativeKeyword()
+        || value == commentaryKeyword()
+        || value == captionsKeyword()
+        || value == mainKeyword()
+        || value == signKeyword()
+        || value == subtitlesKeyword();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void VideoTrack::setSelected(const bool selected)
</span><span class="lines">@@ -139,46 +126,44 @@
</span><span class="cx">     m_private-&gt;setSelected(selected);
</span><span class="cx"> 
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;videoTrackSelectedChanged(this);
</del><ins>+        m_client-&gt;videoTrackSelectedChanged(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> size_t VideoTrack::inbandTrackIndex()
</span><span class="cx"> {
</span><del>-    ASSERT(m_private);
</del><span class="cx">     return m_private-&gt;trackIndex();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VideoTrack::selectedChanged(VideoTrackPrivate* trackPrivate, bool selected)
</del><ins>+void VideoTrack::selectedChanged(bool selected)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     setSelected(selected);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VideoTrack::idChanged(TrackPrivateBase* trackPrivate, const AtomicString&amp; id)
</del><ins>+void VideoTrack::idChanged(const AtomicString&amp; id)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     setId(id);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VideoTrack::labelChanged(TrackPrivateBase* trackPrivate, const AtomicString&amp; label)
</del><ins>+void VideoTrack::labelChanged(const AtomicString&amp; label)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     setLabel(label);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VideoTrack::languageChanged(TrackPrivateBase* trackPrivate, const AtomicString&amp; language)
</del><ins>+void VideoTrack::languageChanged(const AtomicString&amp; language)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
</del><span class="cx">     setLanguage(language);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VideoTrack::willRemove(TrackPrivateBase* trackPrivate)
</del><ins>+void VideoTrack::willRemove()
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(trackPrivate, trackPrivate == m_private);
-    mediaElement()-&gt;removeVideoTrack(*this);
</del><ins>+    auto* element = mediaElement();
+    if (!element)
+        return;
+    element-&gt;removeVideoTrack(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><ins>+
</ins><span class="cx"> void VideoTrack::setKind(const AtomicString&amp; kind)
</span><span class="cx"> {
</span><span class="cx">     // 10.1 kind, on setting:
</span><span class="lines">@@ -193,7 +178,7 @@
</span><span class="cx">     // 3. If the sourceBuffer attribute on this track is not null, then queue a task to fire a simple
</span><span class="cx">     // event named change at sourceBuffer.videoTracks.
</span><span class="cx">     if (m_sourceBuffer)
</span><del>-        m_sourceBuffer-&gt;videoTracks()-&gt;scheduleChangeEvent();
</del><ins>+        m_sourceBuffer-&gt;videoTracks().scheduleChangeEvent();
</ins><span class="cx"> 
</span><span class="cx">     // 4. Queue a task to fire a simple event named change at the VideoTrackList object referenced by
</span><span class="cx">     // the videoTracks attribute on the HTMLMediaElement.
</span><span class="lines">@@ -214,12 +199,13 @@
</span><span class="cx">     // 3. If the sourceBuffer attribute on this track is not null, then queue a task to fire a simple
</span><span class="cx">     // event named change at sourceBuffer.videoTracks.
</span><span class="cx">     if (m_sourceBuffer)
</span><del>-        m_sourceBuffer-&gt;videoTracks()-&gt;scheduleChangeEvent();
</del><ins>+        m_sourceBuffer-&gt;videoTracks().scheduleChangeEvent();
</ins><span class="cx"> 
</span><span class="cx">     // 4. Queue a task to fire a simple event named change at the VideoTrackList object referenced by
</span><span class="cx">     // the videoTracks attribute on the HTMLMediaElement.
</span><span class="cx">     mediaElement()-&gt;videoTracks().scheduleChangeEvent();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void VideoTrack::updateKindFromPrivate()
</span><span class="lines">@@ -227,29 +213,27 @@
</span><span class="cx">     switch (m_private-&gt;kind()) {
</span><span class="cx">     case VideoTrackPrivate::Alternative:
</span><span class="cx">         setKindInternal(VideoTrack::alternativeKeyword());
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case VideoTrackPrivate::Captions:
</span><span class="cx">         setKindInternal(VideoTrack::captionsKeyword());
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case VideoTrackPrivate::Main:
</span><span class="cx">         setKindInternal(VideoTrack::mainKeyword());
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case VideoTrackPrivate::Sign:
</span><span class="cx">         setKindInternal(VideoTrack::signKeyword());
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case VideoTrackPrivate::Subtitles:
</span><span class="cx">         setKindInternal(VideoTrack::subtitlesKeyword());
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case VideoTrackPrivate::Commentary:
</span><span class="cx">         setKindInternal(VideoTrack::commentaryKeyword());
</span><del>-        break;
</del><ins>+        return;
</ins><span class="cx">     case VideoTrackPrivate::None:
</span><span class="cx">         setKindInternal(emptyString());
</span><del>-        break;
-    default:
-        ASSERT_NOT_REACHED();
-        break;
</del><ins>+        return;
</ins><span class="cx">     }
</span><ins>+    ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmltrackVideoTrackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/track/VideoTrack.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/track/VideoTrack.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/html/track/VideoTrack.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2011, 2012, 2013 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -39,12 +39,12 @@
</span><span class="cx"> class VideoTrackClient {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~VideoTrackClient() { }
</span><del>-    virtual void videoTrackSelectedChanged(VideoTrack*) = 0;
</del><ins>+    virtual void videoTrackSelectedChanged(VideoTrack&amp;) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-class VideoTrack final : public MediaTrackBase, public VideoTrackPrivateClient {
</del><ins>+class VideoTrack final : public MediaTrackBase, private VideoTrackPrivateClient {
</ins><span class="cx"> public:
</span><del>-    static Ref&lt;VideoTrack&gt; create(VideoTrackClient* client, PassRefPtr&lt;VideoTrackPrivate&gt; trackPrivate)
</del><ins>+    static Ref&lt;VideoTrack&gt; create(VideoTrackClient&amp; client, VideoTrackPrivate&amp; trackPrivate)
</ins><span class="cx">     {
</span><span class="cx">         return adoptRef(*new VideoTrack(client, trackPrivate));
</span><span class="cx">     }
</span><span class="lines">@@ -56,41 +56,39 @@
</span><span class="cx">     static const AtomicString&amp; signKeyword();
</span><span class="cx">     static const AtomicString&amp; subtitlesKeyword();
</span><span class="cx">     static const AtomicString&amp; commentaryKeyword();
</span><del>-    const AtomicString&amp; defaultKindKeyword() const override { return emptyAtom; }
</del><span class="cx"> 
</span><span class="cx">     bool selected() const { return m_selected; }
</span><span class="cx">     virtual void setSelected(const bool);
</span><span class="cx"> 
</span><del>-    void clearClient() override { m_client = 0; }
</del><ins>+    void clearClient() final { m_client = nullptr; }
</ins><span class="cx">     VideoTrackClient* client() const { return m_client; }
</span><span class="cx"> 
</span><span class="cx">     size_t inbandTrackIndex();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><del>-    void setKind(const AtomicString&amp;) override;
-    void setLanguage(const AtomicString&amp;) override;
</del><ins>+    void setKind(const AtomicString&amp;) final;
+    void setLanguage(const AtomicString&amp;) final;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     const MediaDescription&amp; description() const;
</span><span class="cx"> 
</span><del>-    void setPrivate(PassRefPtr&lt;VideoTrackPrivate&gt;);
</del><ins>+    void setPrivate(VideoTrackPrivate&amp;);
</ins><span class="cx"> 
</span><del>-protected:
-    VideoTrack(VideoTrackClient*, PassRefPtr&lt;VideoTrackPrivate&gt; privateTrack);
-
</del><span class="cx"> private:
</span><del>-    bool isValidKind(const AtomicString&amp;) const override;
</del><ins>+    VideoTrack(VideoTrackClient&amp;, VideoTrackPrivate&amp;);
</ins><span class="cx"> 
</span><ins>+    bool isValidKind(const AtomicString&amp;) const final;
+
</ins><span class="cx">     // VideoTrackPrivateClient
</span><del>-    void selectedChanged(VideoTrackPrivate*, bool) override;
</del><ins>+    void selectedChanged(bool) final;
</ins><span class="cx"> 
</span><span class="cx">     // TrackPrivateBaseClient
</span><del>-    void idChanged(TrackPrivateBase*, const AtomicString&amp;) override;
-    void labelChanged(TrackPrivateBase*, const AtomicString&amp;) override;
-    void languageChanged(TrackPrivateBase*, const AtomicString&amp;) override;
-    void willRemove(TrackPrivateBase*) override;
</del><ins>+    void idChanged(const AtomicString&amp;) final;
+    void labelChanged(const AtomicString&amp;) final;
+    void languageChanged(const AtomicString&amp;) final;
+    void willRemove() final;
</ins><span class="cx"> 
</span><del>-    bool enabled() const override { return selected(); }
</del><ins>+    bool enabled() const final { return selected(); }
</ins><span class="cx"> 
</span><span class="cx">     void updateKindFromPrivate();
</span><span class="cx"> 
</span><span class="lines">@@ -97,7 +95,7 @@
</span><span class="cx">     bool m_selected;
</span><span class="cx">     VideoTrackClient* m_client;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;VideoTrackPrivate&gt; m_private;
</del><ins>+    Ref&lt;VideoTrackPrivate&gt; m_private;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/loader/EmptyClients.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2006 Eric Seidel (eric@webkit.org)
</span><del>- * Copyright (C) 2008-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
</span><span class="cx">  * Copyright (C) 2012 Samsung Electronics. All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -172,7 +172,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void runOpenPanel(Frame*, PassRefPtr&lt;FileChooser&gt;) override;
</span><del>-    void loadIconForFiles(const Vector&lt;String&gt;&amp;, FileIconLoader*) override { }
</del><ins>+    void loadIconForFiles(const Vector&lt;String&gt;&amp;, FileIconLoader&amp;) override { }
</ins><span class="cx"> 
</span><span class="cx">     void elementDidFocus(const Node*) override { }
</span><span class="cx">     void elementDidBlur(const Node*) override { }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderPingLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/PingLoader.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/PingLoader.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/loader/PingLoader.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2015 Roopesh Chander (roop@roopc.net)
</span><del>- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -57,38 +57,50 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-#if ENABLE(CONTENT_EXTENSIONS)
-static ContentExtensions::BlockedStatus processContentExtensionRulesForLoad(const Frame&amp; frame, const URL&amp; url, ResourceType resourceType)
</del><ins>+#if !ENABLE(CONTENT_EXTENSIONS)
+
+// Returns true if we should block the load.
+static inline bool processContentExtensionRulesForLoad(const Frame&amp;, ResourceRequest&amp;, ResourceType)
</ins><span class="cx"> {
</span><del>-    if (DocumentLoader* documentLoader = frame.loader().documentLoader()) {
-        if (Page* page = frame.page())
-            return page-&gt;userContentProvider().processContentExtensionRulesForLoad(url, resourceType, *documentLoader);
-    }
-    return { };
</del><ins>+    return false;
</ins><span class="cx"> }
</span><ins>+
+#else
+
+// Returns true if we should block the load.
+static bool processContentExtensionRulesForLoad(const Frame&amp; frame, ResourceRequest&amp; request, ResourceType resourceType)
+{
+    auto* documentLoader = frame.loader().documentLoader();
+    if (!documentLoader)
+        return false;
+    auto* page = frame.page();
+    if (!page)
+        return false;
+    auto status = page-&gt;userContentProvider().processContentExtensionRulesForLoad(request.url(), resourceType, *documentLoader);
+    applyBlockedStatusToRequest(status, request);
+    return status.blockedLoad;
+}
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void PingLoader::loadImage(Frame&amp; frame, const URL&amp; url)
</span><span class="cx"> {
</span><del>-    if (!frame.document()-&gt;securityOrigin()-&gt;canDisplay(url)) {
</del><ins>+    ASSERT(frame.document());
+    auto&amp; document = *frame.document();
+
+    if (!document.securityOrigin()-&gt;canDisplay(url)) {
</ins><span class="cx">         FrameLoader::reportLocalLoadFailed(&amp;frame, url);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ResourceRequest request(url);
</span><del>-
-#if ENABLE(CONTENT_EXTENSIONS)
-    auto blockedStatus = processContentExtensionRulesForLoad(frame, url, ResourceType::Image);
-    applyBlockedStatusToRequest(blockedStatus, request);
-    if (blockedStatus.blockedLoad)
</del><ins>+    if (processContentExtensionRulesForLoad(frame, request, ResourceType::Image))
</ins><span class="cx">         return;
</span><del>-#endif
</del><span class="cx"> 
</span><del>-    if (Document* document = frame.document())
-        document-&gt;contentSecurityPolicy()-&gt;upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
</del><ins>+    document.contentSecurityPolicy()-&gt;upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
</ins><span class="cx"> 
</span><span class="cx">     request.setHTTPHeaderField(HTTPHeaderName::CacheControl, &quot;max-age=0&quot;);
</span><del>-    String referrer = SecurityPolicy::generateReferrerHeader(frame.document()-&gt;referrerPolicy(), request.url(), frame.loader().outgoingReferrer());
</del><ins>+    String referrer = SecurityPolicy::generateReferrerHeader(document.referrerPolicy(), request.url(), frame.loader().outgoingReferrer());
</ins><span class="cx">     if (!referrer.isEmpty())
</span><span class="cx">         request.setHTTPReferrer(referrer);
</span><span class="cx">     frame.loader().addExtraFieldsToSubresourceRequest(request);
</span><span class="lines">@@ -99,19 +111,17 @@
</span><span class="cx"> // http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing
</span><span class="cx"> void PingLoader::sendPing(Frame&amp; frame, const URL&amp; pingURL, const URL&amp; destinationURL)
</span><span class="cx"> {
</span><ins>+    ASSERT(frame.document());
+
</ins><span class="cx">     if (!pingURL.protocolIsInHTTPFamily())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ResourceRequest request(pingURL);
</span><del>-    
-#if ENABLE(CONTENT_EXTENSIONS)
-    auto blockedStatus = processContentExtensionRulesForLoad(frame, pingURL, ResourceType::Raw);
-    applyBlockedStatusToRequest(blockedStatus, request);
-    if (blockedStatus.blockedLoad)
</del><ins>+    if (processContentExtensionRulesForLoad(frame, request, ResourceType::Raw))
</ins><span class="cx">         return;
</span><del>-#endif
</del><span class="cx"> 
</span><del>-    frame.document()-&gt;contentSecurityPolicy()-&gt;upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
</del><ins>+    auto&amp; document = *frame.document();
+    document.contentSecurityPolicy()-&gt;upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
</ins><span class="cx"> 
</span><span class="cx">     request.setHTTPMethod(&quot;POST&quot;);
</span><span class="cx">     request.setHTTPContentType(&quot;text/ping&quot;);
</span><span class="lines">@@ -119,14 +129,14 @@
</span><span class="cx">     request.setHTTPHeaderField(HTTPHeaderName::CacheControl, &quot;max-age=0&quot;);
</span><span class="cx">     frame.loader().addExtraFieldsToSubresourceRequest(request);
</span><span class="cx"> 
</span><del>-    SecurityOrigin* sourceOrigin = frame.document()-&gt;securityOrigin();
-    Ref&lt;SecurityOrigin&gt; pingOrigin(SecurityOrigin::create(pingURL));
-    FrameLoader::addHTTPOriginIfNeeded(request, sourceOrigin-&gt;toString());
</del><ins>+    ASSERT(document.securityOrigin());
+    auto&amp; sourceOrigin = *document.securityOrigin();
+    FrameLoader::addHTTPOriginIfNeeded(request, sourceOrigin.toString());
</ins><span class="cx">     request.setHTTPHeaderField(HTTPHeaderName::PingTo, destinationURL);
</span><span class="cx">     if (!SecurityPolicy::shouldHideReferrer(pingURL, frame.loader().outgoingReferrer())) {
</span><del>-        request.setHTTPHeaderField(HTTPHeaderName::PingFrom, frame.document()-&gt;url());
-        if (!sourceOrigin-&gt;isSameSchemeHostPort(&amp;pingOrigin.get())) {
-            String referrer = SecurityPolicy::generateReferrerHeader(frame.document()-&gt;referrerPolicy(), pingURL, frame.loader().outgoingReferrer());
</del><ins>+        request.setHTTPHeaderField(HTTPHeaderName::PingFrom, document.url());
+        if (!sourceOrigin.isSameSchemeHostPort(SecurityOrigin::create(pingURL).ptr())) {
+            String referrer = SecurityPolicy::generateReferrerHeader(document.referrerPolicy(), pingURL, frame.loader().outgoingReferrer());
</ins><span class="cx">             if (!referrer.isEmpty())
</span><span class="cx">                 request.setHTTPReferrer(referrer);
</span><span class="cx">         }
</span><span class="lines">@@ -135,19 +145,16 @@
</span><span class="cx">     startPingLoad(frame, request, ShouldFollowRedirects::Yes);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PingLoader::sendViolationReport(Frame&amp; frame, const URL&amp; reportURL, RefPtr&lt;FormData&gt;&amp;&amp; report, ViolationReportType reportType)
</del><ins>+void PingLoader::sendViolationReport(Frame&amp; frame, const URL&amp; reportURL, Ref&lt;FormData&gt;&amp;&amp; report, ViolationReportType reportType)
</ins><span class="cx"> {
</span><ins>+    ASSERT(frame.document());
+
</ins><span class="cx">     ResourceRequest request(reportURL);
</span><del>-
-#if ENABLE(CONTENT_EXTENSIONS)
-    auto blockedStatus = processContentExtensionRulesForLoad(frame, reportURL, ResourceType::Raw);
-    applyBlockedStatusToRequest(blockedStatus, request);
-    if (blockedStatus.blockedLoad)
</del><ins>+    if (processContentExtensionRulesForLoad(frame, request, ResourceType::Raw))
</ins><span class="cx">         return;
</span><del>-#endif
</del><span class="cx"> 
</span><del>-    if (Document* document = frame.document())
-        document-&gt;contentSecurityPolicy()-&gt;upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
</del><ins>+    auto&amp; document = *frame.document();
+    document.contentSecurityPolicy()-&gt;upgradeInsecureRequestIfNeeded(request, ContentSecurityPolicy::InsecureRequestType::Load);
</ins><span class="cx"> 
</span><span class="cx">     request.setHTTPMethod(ASCIILiteral(&quot;POST&quot;));
</span><span class="cx">     request.setHTTPBody(WTFMove(report));
</span><span class="lines">@@ -161,11 +168,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool removeCookies = true;
</span><del>-    if (Document* document = frame.document()) {
-        if (SecurityOrigin* securityOrigin = document-&gt;securityOrigin()) {
-            if (securityOrigin-&gt;isSameSchemeHostPort(SecurityOrigin::create(reportURL).ptr()))
-                removeCookies = false;
-        }
</del><ins>+    if (auto* securityOrigin = document.securityOrigin()) {
+        if (securityOrigin-&gt;isSameSchemeHostPort(SecurityOrigin::create(reportURL).ptr()))
+            removeCookies = false;
</ins><span class="cx">     }
</span><span class="cx">     if (removeCookies)
</span><span class="cx">         request.setAllowCookies(false);
</span><span class="lines">@@ -172,7 +177,7 @@
</span><span class="cx"> 
</span><span class="cx">     frame.loader().addExtraFieldsToSubresourceRequest(request);
</span><span class="cx"> 
</span><del>-    String referrer = SecurityPolicy::generateReferrerHeader(frame.document()-&gt;referrerPolicy(), reportURL, frame.loader().outgoingReferrer());
</del><ins>+    String referrer = SecurityPolicy::generateReferrerHeader(document.referrerPolicy(), reportURL, frame.loader().outgoingReferrer());
</ins><span class="cx">     if (!referrer.isEmpty())
</span><span class="cx">         request.setHTTPReferrer(referrer);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderPingLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/PingLoader.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/PingLoader.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/loader/PingLoader.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2010 Google Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -31,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include &lt;wtf/RefPtr.h&gt;
</del><ins>+#include &lt;wtf/Ref.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -49,7 +50,7 @@
</span><span class="cx"> public:
</span><span class="cx">     static void loadImage(Frame&amp;, const URL&amp;);
</span><span class="cx">     static void sendPing(Frame&amp;, const URL&amp; pingURL, const URL&amp; destinationURL);
</span><del>-    static void sendViolationReport(Frame&amp;, const URL&amp; reportURL, RefPtr&lt;FormData&gt;&amp;&amp; report, ViolationReportType);
</del><ins>+    static void sendViolationReport(Frame&amp;, const URL&amp; reportURL, Ref&lt;FormData&gt;&amp;&amp; report, ViolationReportType);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     enum class ShouldFollowRedirects { No, Yes };
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Chrome.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Chrome.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/page/Chrome.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  * Copyright (C) 2012, Samsung Electronics. All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -438,7 +438,7 @@
</span><span class="cx">     m_client.runOpenPanel(frame, fileChooser);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Chrome::loadIconForFiles(const Vector&lt;String&gt;&amp; filenames, FileIconLoader* loader)
</del><ins>+void Chrome::loadIconForFiles(const Vector&lt;String&gt;&amp; filenames, FileIconLoader&amp; loader)
</ins><span class="cx"> {
</span><span class="cx">     m_client.loadIconForFiles(filenames, loader);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Chrome.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Chrome.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/page/Chrome.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
</span><span class="cx">  * Copyright (C) 2012, Samsung Electronics. All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -28,10 +28,8 @@
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>-#ifndef __OBJC__
-class NSView;
</del><ins>+OBJC_CLASS NSView;
</ins><span class="cx"> #endif
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -159,7 +157,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void runOpenPanel(Frame*, PassRefPtr&lt;FileChooser&gt;);
</span><del>-    void loadIconForFiles(const Vector&lt;String&gt;&amp;, FileIconLoader*);
</del><ins>+    void loadIconForFiles(const Vector&lt;String&gt;&amp;, FileIconLoader&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void dispatchViewportPropertiesDidChange(const ViewportArguments&amp;) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/page/ChromeClient.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple, Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple, Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
</span><span class="cx">  * Copyright (C) 2012 Samsung Electronics. All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -275,7 +275,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void runOpenPanel(Frame*, PassRefPtr&lt;FileChooser&gt;) = 0;
</span><span class="cx">     // Asynchronous request to load an icon for specified filenames.
</span><del>-    virtual void loadIconForFiles(const Vector&lt;String&gt;&amp;, FileIconLoader*) = 0;
</del><ins>+    virtual void loadIconForFiles(const Vector&lt;String&gt;&amp;, FileIconLoader&amp;) = 0;
</ins><span class="cx">         
</span><span class="cx">     virtual void elementDidFocus(const Node*) { };
</span><span class="cx">     virtual void elementDidBlur(const Node*) { };
</span></span></pre></div>
<a id="trunkSourceWebCorepagecspContentSecurityPolicycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Google, Inc. All rights reserved.
</span><del>- * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -625,8 +625,8 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!m_frame || effectiveViolatedDirective == ContentSecurityPolicyDirectiveNames::frameAncestors);
</span><span class="cx"> 
</span><del>-    Document&amp; document = is&lt;Document&gt;(m_scriptExecutionContext) ? downcast&lt;Document&gt;(*m_scriptExecutionContext) : *m_frame-&gt;document();
-    Frame* frame = document.frame();
</del><ins>+    auto&amp; document = is&lt;Document&gt;(m_scriptExecutionContext) ? downcast&lt;Document&gt;(*m_scriptExecutionContext) : *m_frame-&gt;document();
+    auto* frame = document.frame();
</ins><span class="cx">     ASSERT(!m_frame || m_frame == frame);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return;
</span><span class="lines">@@ -646,13 +646,14 @@
</span><span class="cx">     String originalPolicy = violatedDirectiveList.header();
</span><span class="cx">     String referrer = document.referrer();
</span><span class="cx">     ASSERT(document.loader());
</span><ins>+    // FIXME: Is it policy to not use the status code for HTTPS, or is that a bug?
</ins><span class="cx">     unsigned short statusCode = document.url().protocolIs(&quot;http&quot;) &amp;&amp; document.loader() ? document.loader()-&gt;response().httpStatusCode() : 0;
</span><span class="cx"> 
</span><span class="cx">     String sourceFile;
</span><span class="cx">     int lineNumber = 0;
</span><span class="cx">     int columnNumber = 0;
</span><del>-    RefPtr&lt;ScriptCallStack&gt; stack = createScriptCallStack(JSMainThreadExecState::currentState(), 2);
-    const ScriptCallFrame* callFrame = stack-&gt;firstNonNativeCallFrame();
</del><ins>+    auto stack = createScriptCallStack(JSMainThreadExecState::currentState(), 2);
+    auto* callFrame = stack-&gt;firstNonNativeCallFrame();
</ins><span class="cx">     if (callFrame &amp;&amp; callFrame-&gt;lineNumber()) {
</span><span class="cx">         sourceFile = stripURLForUseInReport(document, URL(URL(), callFrame-&gt;sourceURL()));
</span><span class="cx">         lineNumber = callFrame-&gt;lineNumber();
</span><span class="lines">@@ -665,7 +666,7 @@
</span><span class="cx">     document.enqueueDocumentEvent(SecurityPolicyViolationEvent::create(eventNames().securitypolicyviolationEvent, canBubble, cancelable, documentURI, referrer, blockedURI, violatedDirectiveText, effectiveViolatedDirective, originalPolicy, sourceFile, statusCode, lineNumber, columnNumber));
</span><span class="cx"> 
</span><span class="cx">     // 2. Send violation report (if applicable).
</span><del>-    const Vector&lt;String&gt;&amp; reportURIs = violatedDirectiveList.reportURIs();
</del><ins>+    auto&amp; reportURIs = violatedDirectiveList.reportURIs();
</ins><span class="cx">     if (reportURIs.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -693,10 +694,10 @@
</span><span class="cx">         cspReport-&gt;setInteger(ASCIILiteral(&quot;column-number&quot;), columnNumber);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;InspectorObject&gt; reportObject = InspectorObject::create();
</del><ins>+    auto reportObject = InspectorObject::create();
</ins><span class="cx">     reportObject-&gt;setObject(ASCIILiteral(&quot;csp-report&quot;), WTFMove(cspReport));
</span><span class="cx"> 
</span><del>-    RefPtr&lt;FormData&gt; report = FormData::create(reportObject-&gt;toJSONString().utf8());
</del><ins>+    auto report = FormData::create(reportObject-&gt;toJSONString().utf8());
</ins><span class="cx">     for (const auto&amp; url : reportURIs)
</span><span class="cx">         PingLoader::sendViolationReport(*frame, is&lt;Document&gt;(m_scriptExecutionContext) ? document.completeURL(url) : document.completeURL(url, blockedURL), report.copyRef(), ViolationReportType::ContentSecurityPolicy);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaWebPlaybackSessionModelMediaElementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,24 +28,24 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS) || (PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE))
</span><span class="cx"> 
</span><ins>+#import &quot;AudioTrackList.h&quot;
+#import &quot;Event.h&quot;
+#import &quot;EventListener.h&quot;
+#import &quot;EventNames.h&quot;
+#import &quot;HTMLElement.h&quot;
+#import &quot;HTMLMediaElement.h&quot;
</ins><span class="cx"> #import &quot;Logging.h&quot;
</span><span class="cx"> #import &quot;MediaControlsHost.h&quot;
</span><ins>+#import &quot;Page.h&quot;
+#import &quot;PageGroup.h&quot;
+#import &quot;SoftLinking.h&quot;
+#import &quot;TextTrackList.h&quot;
+#import &quot;TimeRanges.h&quot;
</ins><span class="cx"> #import &quot;WebVideoFullscreenInterface.h&quot;
</span><span class="cx"> #import &lt;QuartzCore/CoreAnimation.h&gt;
</span><del>-#import &lt;WebCore/AudioTrackList.h&gt;
-#import &lt;WebCore/Event.h&gt;
-#import &lt;WebCore/EventListener.h&gt;
-#import &lt;WebCore/EventNames.h&gt;
-#import &lt;WebCore/HTMLElement.h&gt;
-#import &lt;WebCore/HTMLMediaElement.h&gt;
-#import &lt;WebCore/Page.h&gt;
-#import &lt;WebCore/PageGroup.h&gt;
-#import &lt;WebCore/SoftLinking.h&gt;
-#import &lt;WebCore/TextTrackList.h&gt;
-#import &lt;WebCore/TimeRanges.h&gt;
</del><span class="cx"> #import &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><del>-using namespace WebCore;
</del><ins>+namespace WebCore {
</ins><span class="cx"> 
</span><span class="cx"> WebPlaybackSessionModelMediaElement::WebPlaybackSessionModelMediaElement()
</span><span class="cx">     : EventListener(EventListener::CPPEventListenerType)
</span><span class="lines">@@ -233,17 +233,8 @@
</span><span class="cx">     if (!m_mediaElement)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ASSERT(selectedAudioIndex &lt; std::numeric_limits&lt;size_t&gt;::max());
-    AudioTrack* selectedAudioTrack = nullptr;
-
-    for (size_t index = 0; index &lt; m_audioTracksForMenu.size(); ++index) {
-        auto&amp; audioTrack = m_audioTracksForMenu[index];
-        audioTrack-&gt;setEnabled(index == static_cast&lt;size_t&gt;(selectedAudioIndex));
-        if (audioTrack-&gt;enabled())
-            selectedAudioTrack = audioTrack.get();
-    }
-
-    m_mediaElement-&gt;audioTrackEnabledChanged(selectedAudioTrack);
</del><ins>+    for (size_t i = 0, size = m_audioTracksForMenu.size(); i &lt; size; ++i)
+        m_audioTracksForMenu[i]-&gt;setEnabled(i == selectedAudioIndex);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPlaybackSessionModelMediaElement::selectLegibleMediaOption(uint64_t index)
</span><span class="lines">@@ -251,9 +242,7 @@
</span><span class="cx">     if (!m_mediaElement)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ASSERT(index &lt; std::numeric_limits&lt;size_t&gt;::max());
-    TextTrack* textTrack = nullptr;
-
</del><ins>+    TextTrack* textTrack;
</ins><span class="cx">     if (index &lt; m_legibleTracksForMenu.size())
</span><span class="cx">         textTrack = m_legibleTracksForMenu[static_cast&lt;size_t&gt;(index)].get();
</span><span class="cx">     else
</span><span class="lines">@@ -471,4 +460,6 @@
</span><span class="cx">     return m_mediaElement &amp;&amp; m_mediaElement-&gt;mediaSession().wirelessVideoPlaybackDisabled(*m_mediaElement);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsAudioTrackPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/AudioTrackPrivate.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/AudioTrackPrivate.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/AudioTrackPrivate.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -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 AudioTrackPrivate_h
-#define AudioTrackPrivate_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;TrackPrivateBase.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -36,7 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> class AudioTrackPrivateClient : public TrackPrivateBaseClient {
</span><span class="cx"> public:
</span><del>-    virtual void enabledChanged(AudioTrackPrivate*, bool) = 0;
</del><ins>+    virtual void enabledChanged(bool) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class AudioTrackPrivate : public TrackPrivateBase {
</span><span class="lines">@@ -55,26 +54,22 @@
</span><span class="cx">             return;
</span><span class="cx">         m_enabled = enabled;
</span><span class="cx">         if (m_client)
</span><del>-            m_client-&gt;enabledChanged(this, enabled);
-    };
-    virtual bool enabled() const { return m_enabled; }
</del><ins>+            m_client-&gt;enabledChanged(enabled);
+    }
</ins><span class="cx"> 
</span><ins>+    bool enabled() const { return m_enabled; }
+
</ins><span class="cx">     enum Kind { Alternative, Description, Main, MainDesc, Translation, Commentary, None };
</span><span class="cx">     virtual Kind kind() const { return None; }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    AudioTrackPrivate()
-        : m_client(0)
-        , m_enabled(false)
-    {
-    }
</del><ins>+    AudioTrackPrivate() = default;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    AudioTrackPrivateClient* m_client;
-    bool m_enabled;
</del><ins>+    AudioTrackPrivateClient* m_client { nullptr };
+    bool m_enabled { 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="trunkSourceWebCoreplatformgraphicsInbandTextTrackPrivateClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,9 +23,10 @@
</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 InbandTextTrackPrivateClient_h
-#define InbandTextTrackPrivateClient_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO_TRACK)
+
</ins><span class="cx"> #include &quot;Color.h&quot;
</span><span class="cx"> #include &quot;TrackPrivateBase.h&quot;
</span><span class="cx"> #include &lt;wtf/MediaTime.h&gt;
</span><span class="lines">@@ -34,8 +35,6 @@
</span><span class="cx"> #include &quot;SerializedPlatformRepresentation.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO_TRACK)
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class InbandTextTrackPrivate;
</span><span class="lines">@@ -43,10 +42,8 @@
</span><span class="cx"> 
</span><span class="cx"> class GenericCueData : public RefCounted&lt;GenericCueData&gt; {
</span><span class="cx"> public:
</span><ins>+    static Ref&lt;GenericCueData&gt; create() { return adoptRef(*new GenericCueData); }
</ins><span class="cx"> 
</span><del>-    static PassRefPtr&lt;GenericCueData&gt; create() { return adoptRef(new GenericCueData()); }
-    virtual ~GenericCueData() { }
-
</del><span class="cx">     MediaTime startTime() const { return m_startTime; }
</span><span class="cx">     void setStartTime(const MediaTime&amp; startTime) { m_startTime = startTime; }
</span><span class="cx"> 
</span><span class="lines">@@ -53,11 +50,11 @@
</span><span class="cx">     MediaTime endTime() const { return m_endTime; }
</span><span class="cx">     void setEndTime(const MediaTime&amp; endTime) { m_endTime = endTime; }
</span><span class="cx"> 
</span><del>-    String id() const { return m_id; }
-    void setId(String id) { m_id = id; }
</del><ins>+    const String&amp; id() const { return m_id; }
+    void setId(const String&amp; id) { m_id = id; }
</ins><span class="cx"> 
</span><del>-    String content() const { return m_content; }
-    void setContent(String content) { m_content = content; }
</del><ins>+    const String&amp; content() const { return m_content; }
+    void setContent(const String&amp; content) { m_content = content; }
</ins><span class="cx"> 
</span><span class="cx">     double line() const { return m_line; }
</span><span class="cx">     void setLine(double line) { m_line = line; }
</span><span class="lines">@@ -68,17 +65,12 @@
</span><span class="cx">     double size() const { return m_size; }
</span><span class="cx">     void setSize(double size) { m_size = size; }
</span><span class="cx"> 
</span><del>-    enum Alignment {
-        None,
-        Start,
-        Middle,
-        End
-    };
</del><ins>+    enum Alignment { None, Start, Middle, End };
</ins><span class="cx">     Alignment align() const { return m_align; }
</span><span class="cx">     void setAlign(Alignment align) { m_align = align; }
</span><span class="cx"> 
</span><del>-    String fontName() const { return m_fontName; }
-    void setFontName(String fontName) { m_fontName = fontName; }
</del><ins>+    const String&amp; fontName() const { return m_fontName; }
+    void setFontName(const String&amp; fontName) { m_fontName = fontName; }
</ins><span class="cx"> 
</span><span class="cx">     double baseFontSize() const { return m_baseFontSize; }
</span><span class="cx">     void setBaseFontSize(double baseFontSize) { m_baseFontSize = baseFontSize; }
</span><span class="lines">@@ -95,11 +87,7 @@
</span><span class="cx">     const Color&amp; highlightColor() const { return m_highlightColor; }
</span><span class="cx">     void setHighlightColor(const Color&amp; color) { m_highlightColor = color; }
</span><span class="cx"> 
</span><del>-    enum Status {
-        Uninitialized,
-        Partial,
-        Complete,
-    };
</del><ins>+    enum Status { Uninitialized, Partial, Complete };
</ins><span class="cx">     Status status() { return m_status; }
</span><span class="cx">     void setStatus(Status status) { m_status = status; }
</span><span class="cx"> 
</span><span class="lines">@@ -106,32 +94,23 @@
</span><span class="cx">     bool doesExtendCueData(const GenericCueData&amp;) const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    GenericCueData()
-        : m_line(-1)
-        , m_position(-1)
-        , m_size(-1)
-        , m_align(None)
-        , m_baseFontSize(0)
-        , m_relativeFontSize(0)
-        , m_status(Uninitialized)
-    {
-    }
</del><ins>+    GenericCueData() = default;
</ins><span class="cx"> 
</span><span class="cx">     MediaTime m_startTime;
</span><span class="cx">     MediaTime m_endTime;
</span><span class="cx">     String m_id;
</span><span class="cx">     String m_content;
</span><del>-    double m_line;
-    double m_position;
-    double m_size;
-    Alignment m_align;
</del><ins>+    double m_line { -1 };
+    double m_position { -1 };
+    double m_size { -1 };
+    Alignment m_align { None };
</ins><span class="cx">     String m_fontName;
</span><del>-    double m_baseFontSize;
-    double m_relativeFontSize;
</del><ins>+    double m_baseFontSize { 0 };
+    double m_relativeFontSize { 0 };
</ins><span class="cx">     Color m_foregroundColor;
</span><span class="cx">     Color m_backgroundColor;
</span><span class="cx">     Color m_highlightColor;
</span><del>-    Status m_status;
</del><ins>+    Status m_status { Uninitialized };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline bool GenericCueData::doesExtendCueData(const GenericCueData&amp; other) const
</span><span class="lines">@@ -168,24 +147,23 @@
</span><span class="cx"> public:
</span><span class="cx">     virtual ~InbandTextTrackPrivateClient() { }
</span><span class="cx"> 
</span><del>-    virtual void addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, const void*, unsigned) = 0;
</del><ins>+    virtual void addDataCue(const MediaTime&amp; start, const MediaTime&amp; end, const void*, unsigned) = 0;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>-    virtual void addDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;, const String&amp;) = 0;
-    virtual void updateDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) = 0;
-    virtual void removeDataCue(InbandTextTrackPrivate*, const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt;) = 0;
</del><ins>+    virtual void addDataCue(const MediaTime&amp; start, const MediaTime&amp; end, Ref&lt;SerializedPlatformRepresentation&gt;&amp;&amp;, const String&amp;) = 0;
+    virtual void updateDataCue(const MediaTime&amp; start, const MediaTime&amp; end, SerializedPlatformRepresentation&amp;) = 0;
+    virtual void removeDataCue(const MediaTime&amp; start, const MediaTime&amp; end, SerializedPlatformRepresentation&amp;) = 0;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    virtual void addGenericCue(InbandTextTrackPrivate*, PassRefPtr&lt;GenericCueData&gt;) = 0;
-    virtual void updateGenericCue(InbandTextTrackPrivate*, GenericCueData*) = 0;
-    virtual void removeGenericCue(InbandTextTrackPrivate*, GenericCueData*) = 0;
</del><ins>+    virtual void addGenericCue(GenericCueData&amp;) = 0;
+    virtual void updateGenericCue(GenericCueData&amp;) = 0;
+    virtual void removeGenericCue(GenericCueData&amp;) = 0;
</ins><span class="cx"> 
</span><del>-    virtual void parseWebVTTFileHeader(InbandTextTrackPrivate*, String&amp;&amp;) { ASSERT_NOT_REACHED(); }
-    virtual void parseWebVTTCueData(InbandTextTrackPrivate*, const char* data, unsigned length) = 0;
-    virtual void parseWebVTTCueData(InbandTextTrackPrivate*, const ISOWebVTTCue&amp;) = 0;
</del><ins>+    virtual void parseWebVTTFileHeader(String&amp;&amp;) { ASSERT_NOT_REACHED(); }
+    virtual void parseWebVTTCueData(const char* data, unsigned length) = 0;
+    virtual void parseWebVTTCueData(const ISOWebVTTCue&amp;) = 0;
</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="trunkSourceWebCoreplatformgraphicsSourceBufferPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/SourceBufferPrivate.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2013 Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -28,21 +28,17 @@
</span><span class="cx">  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><del>-#ifndef SourceBufferPrivate_h
-#define SourceBufferPrivate_h
</del><span class="cx"> 
</span><ins>+#pragma once
+
</ins><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;MediaPlayer.h&quot;
</span><del>-#include &quot;TimeRanges.h&quot;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/Vector.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class MediaSample;
</span><span class="cx"> class SourceBufferPrivateClient;
</span><del>-class TimeRanges;
</del><span class="cx"> 
</span><span class="cx"> class SourceBufferPrivate : public RefCounted&lt;SourceBufferPrivate&gt; {
</span><span class="cx"> public:
</span><span class="lines">@@ -58,17 +54,16 @@
</span><span class="cx">     virtual MediaPlayer::ReadyState readyState() const = 0;
</span><span class="cx">     virtual void setReadyState(MediaPlayer::ReadyState) = 0;
</span><span class="cx"> 
</span><del>-    virtual void flush(AtomicString) { }
-    virtual void enqueueSample(PassRefPtr&lt;MediaSample&gt;, AtomicString) { }
-    virtual bool isReadyForMoreSamples(AtomicString) { return false; }
</del><ins>+    virtual void flush(const AtomicString&amp;) { }
+    virtual void enqueueSample(Ref&lt;MediaSample&gt;&amp;&amp;, const AtomicString&amp;) { }
+    virtual bool isReadyForMoreSamples(const AtomicString&amp;) { return false; }
</ins><span class="cx">     virtual void setActive(bool) { }
</span><del>-    virtual void stopAskingForMoreSamples(AtomicString) { }
-    virtual void notifyClientWhenReadyForMoreSamples(AtomicString) { }
</del><ins>+    virtual void stopAskingForMoreSamples(const AtomicString&amp;) { }
+    virtual void notifyClientWhenReadyForMoreSamples(const AtomicString&amp;) { }
</ins><span class="cx"> 
</span><del>-    virtual Vector&lt;String&gt; enqueuedSamplesForTrackID(AtomicString) { return {}; }
</del><ins>+    virtual Vector&lt;String&gt; enqueuedSamplesForTrackID(const AtomicString&amp;) { return { }; }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSourceBufferPrivateClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/SourceBufferPrivateClient.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -32,12 +32,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class SourceBufferPrivate;
</del><span class="cx"> class AudioTrackPrivate;
</span><del>-class VideoTrackPrivate;
</del><span class="cx"> class InbandTextTrackPrivate;
</span><span class="cx"> class MediaSample;
</span><span class="cx"> class MediaDescription;
</span><ins>+class VideoTrackPrivate;
</ins><span class="cx"> 
</span><span class="cx"> class SourceBufferPrivateClient {
</span><span class="cx"> public:
</span><span class="lines">@@ -64,23 +63,19 @@
</span><span class="cx">         };
</span><span class="cx">         Vector&lt;TextTrackInformation&gt; textTracks;
</span><span class="cx">     };
</span><del>-    virtual void sourceBufferPrivateDidReceiveInitializationSegment(SourceBufferPrivate*, const InitializationSegment&amp;) = 0;
-    virtual void sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, MediaSample&amp;) = 0;
-    virtual bool sourceBufferPrivateHasAudio(const SourceBufferPrivate*) const = 0;
-    virtual bool sourceBufferPrivateHasVideo(const SourceBufferPrivate*) const = 0;
</del><ins>+    virtual void sourceBufferPrivateDidReceiveInitializationSegment(const InitializationSegment&amp;) = 0;
+    virtual void sourceBufferPrivateDidReceiveSample(MediaSample&amp;) = 0;
+    virtual bool sourceBufferPrivateHasAudio() const = 0;
+    virtual bool sourceBufferPrivateHasVideo() const = 0;
</ins><span class="cx"> 
</span><del>-    virtual void sourceBufferPrivateDidBecomeReadyForMoreSamples(SourceBufferPrivate*, AtomicString trackID) = 0;
</del><ins>+    virtual void sourceBufferPrivateDidBecomeReadyForMoreSamples(const AtomicString&amp; trackID) = 0;
</ins><span class="cx"> 
</span><del>-    virtual MediaTime sourceBufferPrivateFastSeekTimeForMediaTime(SourceBufferPrivate*, const MediaTime&amp; time, const MediaTime&amp;, const MediaTime&amp;) { return time; }
-    virtual void sourceBufferPrivateSeekToTime(SourceBufferPrivate*, const MediaTime&amp;) { };
</del><ins>+    virtual MediaTime sourceBufferPrivateFastSeekTimeForMediaTime(const MediaTime&amp; time, const MediaTime&amp;, const MediaTime&amp;) { return time; }
+    virtual void sourceBufferPrivateSeekToTime(const MediaTime&amp;) { };
</ins><span class="cx"> 
</span><del>-    enum AppendResult {
-        AppendSucceeded,
-        ReadStreamFailed,
-        ParsingFailed,
-    };
-    virtual void sourceBufferPrivateAppendComplete(SourceBufferPrivate*, AppendResult) = 0;
-    virtual void sourceBufferPrivateDidReceiveRenderingError(SourceBufferPrivate*, int errocCode) = 0;
</del><ins>+    enum AppendResult { AppendSucceeded, ReadStreamFailed, ParsingFailed };
+    virtual void sourceBufferPrivateAppendComplete(AppendResult) = 0;
+    virtual void sourceBufferPrivateDidReceiveRenderingError(int errorCode) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsTrackPrivateBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2013 Cable Television Labs, Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -25,34 +25,29 @@
</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 TrackPrivateBase_h
-#define TrackPrivateBase_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><del>-#include &lt;wtf/Forward.h&gt;
</del><ins>+#if ENABLE(VIDEO_TRACK)
+
</ins><span class="cx"> #include &lt;wtf/MediaTime.h&gt;
</span><del>-#include &lt;wtf/Noncopyable.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
</del><span class="cx"> #include &lt;wtf/text/AtomicString.h&gt;
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO_TRACK)
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class TrackPrivateBase;
-
</del><span class="cx"> class TrackPrivateBaseClient {
</span><span class="cx"> public:
</span><span class="cx">     virtual ~TrackPrivateBaseClient() { }
</span><del>-    virtual void idChanged(TrackPrivateBase*, const AtomicString&amp;) = 0;
-    virtual void labelChanged(TrackPrivateBase*, const AtomicString&amp;) = 0;
-    virtual void languageChanged(TrackPrivateBase*, const AtomicString&amp;) = 0;
-    virtual void willRemove(TrackPrivateBase*) = 0;
</del><ins>+    virtual void idChanged(const AtomicString&amp;) = 0;
+    virtual void labelChanged(const AtomicString&amp;) = 0;
+    virtual void languageChanged(const AtomicString&amp;) = 0;
+    virtual void willRemove() = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class TrackPrivateBase : public RefCounted&lt;TrackPrivateBase&gt; {
</span><del>-    WTF_MAKE_NONCOPYABLE(TrackPrivateBase); WTF_MAKE_FAST_ALLOCATED;
</del><ins>+    WTF_MAKE_NONCOPYABLE(TrackPrivateBase);
+    WTF_MAKE_FAST_ALLOCATED;
</ins><span class="cx"> public:
</span><del>-    virtual ~TrackPrivateBase() { }
</del><ins>+    virtual ~TrackPrivateBase() = default;
</ins><span class="cx"> 
</span><span class="cx">     virtual TrackPrivateBaseClient* client() const = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -63,18 +58,17 @@
</span><span class="cx">     virtual int trackIndex() const { return 0; }
</span><span class="cx"> 
</span><span class="cx">     virtual MediaTime startTimeVariance() const { return MediaTime::zeroTime(); }
</span><del>-    
</del><ins>+
</ins><span class="cx">     void willBeRemoved()
</span><span class="cx">     {
</span><del>-        if (TrackPrivateBaseClient* client = this-&gt;client())
-            client-&gt;willRemove(this);
</del><ins>+        if (auto* client = this-&gt;client())
+            client-&gt;willRemove();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    TrackPrivateBase() { }
</del><ins>+    TrackPrivateBase() = default;
</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="trunkSourceWebCoreplatformgraphicsVideoTrackPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/VideoTrackPrivate.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/VideoTrackPrivate.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/VideoTrackPrivate.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,29 +23,21 @@
</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 VideoTrackPrivate_h
-#define VideoTrackPrivate_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><ins>+#if ENABLE(VIDEO_TRACK)
+
</ins><span class="cx"> #include &quot;TrackPrivateBase.h&quot;
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO_TRACK)
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class VideoTrackPrivate;
-
</del><span class="cx"> class VideoTrackPrivateClient : public TrackPrivateBaseClient {
</span><span class="cx"> public:
</span><del>-    virtual void selectedChanged(VideoTrackPrivate*, bool) = 0;
</del><ins>+    virtual void selectedChanged(bool) = 0;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class VideoTrackPrivate : public TrackPrivateBase {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;VideoTrackPrivate&gt; create()
-    {
-        return adoptRef(new VideoTrackPrivate());
-    }
-
</del><span class="cx">     void setClient(VideoTrackPrivateClient* client) { m_client = client; }
</span><span class="cx">     VideoTrackPrivateClient* client() const override { return m_client; }
</span><span class="cx"> 
</span><span class="lines">@@ -55,8 +47,8 @@
</span><span class="cx">             return;
</span><span class="cx">         m_selected = selected;
</span><span class="cx">         if (m_client)
</span><del>-            m_client-&gt;selectedChanged(this, m_selected);
-    };
</del><ins>+            m_client-&gt;selectedChanged(m_selected);
+    }
</ins><span class="cx">     virtual bool selected() const { return m_selected; }
</span><span class="cx"> 
</span><span class="cx">     enum Kind { Alternative, Captions, Main, Sign, Subtitles, Commentary, None };
</span><span class="lines">@@ -63,18 +55,13 @@
</span><span class="cx">     virtual Kind kind() const { return None; }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><del>-    VideoTrackPrivate()
-        : m_client(0)
-        , m_selected(false)
-    {
-    }
</del><ins>+    VideoTrackPrivate() = default;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    VideoTrackPrivateClient* m_client;
-    bool m_selected;
</del><ins>+    VideoTrackPrivateClient* m_client { nullptr };
+    bool m_selected { 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="trunkSourceWebCoreplatformgraphicsavfoundationAudioTrackPrivateAVFh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/AudioTrackPrivateAVF.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/AudioTrackPrivateAVF.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/AudioTrackPrivateAVF.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef AudioTrackPrivateAVF_h
-#define AudioTrackPrivateAVF_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="lines">@@ -35,7 +34,6 @@
</span><span class="cx"> class AudioTrackPrivateAVF : public AudioTrackPrivate {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(AudioTrackPrivateAVF)
</span><span class="cx"> public:
</span><del>-
</del><span class="cx">     virtual Kind kind() const { return m_kind; }
</span><span class="cx">     virtual AtomicString id() const { return m_id; }
</span><span class="cx">     virtual AtomicString label() const { return m_label; }
</span><span class="lines">@@ -44,26 +42,20 @@
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     void setKind(Kind kind) { m_kind = kind; }
</span><del>-    void setId(AtomicString newId) { m_id = newId; }
-    void setLabel(AtomicString label) { m_label = label; }
-    void setLanguage(AtomicString language) { m_language = language; }
</del><ins>+    void setId(const AtomicString&amp; newId) { m_id = newId; }
+    void setLabel(const AtomicString&amp; label) { m_label = label; }
+    void setLanguage(const AtomicString&amp; language) { m_language = language; }
</ins><span class="cx">     void setTrackIndex(int index) { m_index = index; }
</span><span class="cx"> 
</span><del>-    Kind m_kind;
</del><ins>+    Kind m_kind { None };
</ins><span class="cx">     AtomicString m_id;
</span><span class="cx">     AtomicString m_label;
</span><span class="cx">     AtomicString m_language;
</span><del>-    int m_index;
</del><ins>+    int m_index { 0 };
</ins><span class="cx"> 
</span><del>-    AudioTrackPrivateAVF()
-        : m_kind(None)
-        , m_index(0)
-    {
-    }
</del><ins>+    AudioTrackPrivateAVF() = default;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(VIDEO_TRACK)
</span><del>-
-#endif // AudioTrackPrivateAVF_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationInbandMetadataTextTrackPrivateAVFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,9 +24,9 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;InbandMetadataTextTrackPrivateAVF.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO) &amp;&amp; ENABLE(DATACUE_VALUE) &amp;&amp; (USE(AVFOUNDATION) || PLATFORM(IOS))
</span><del>-#include &quot;InbandMetadataTextTrackPrivateAVF.h&quot;
</del><span class="cx"> 
</span><span class="cx"> #include &quot;InbandTextTrackPrivateClient.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><ins>+
</ins><span class="cx"> void InbandMetadataTextTrackPrivateAVF::addDataCue(const MediaTime&amp; start, const MediaTime&amp; end, PassRefPtr&lt;SerializedPlatformRepresentation&gt; prpCueData, const String&amp; type)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(cueFormat() == Data);
</span><span class="lines">@@ -66,7 +67,7 @@
</span><span class="cx">     m_currentCueStartTime = start;
</span><span class="cx">     if (end.isPositiveInfinite())
</span><span class="cx">         m_incompleteCues.append(IncompleteMetaDataCue { cueData.get(), start });
</span><del>-    client()-&gt;addDataCue(this, start, end, cueData, type);
</del><ins>+    client()-&gt;addDataCue(start, end, cueData.releaseNonNull(), type);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes(const MediaTime&amp; time)
</span><span class="lines">@@ -77,7 +78,7 @@
</span><span class="cx">         if (client()) {
</span><span class="cx">             for (auto&amp; partialCue : m_incompleteCues) {
</span><span class="cx">                 LOG(Media, &quot;InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes(%p) - updating cue: start=%s, end=%s&quot;, this, toString(partialCue.startTime).utf8().data(), toString(time).utf8().data());
</span><del>-                client()-&gt;updateDataCue(this, partialCue.startTime, time, partialCue.cueData);
</del><ins>+                client()-&gt;updateDataCue(partialCue.startTime, time, *partialCue.cueData);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     } else
</span><span class="lines">@@ -86,6 +87,7 @@
</span><span class="cx">     m_incompleteCues.resize(0);
</span><span class="cx">     m_currentCueStartTime = MediaTime::zeroTime();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void InbandMetadataTextTrackPrivateAVF::flushPartialCues()
</span><span class="lines">@@ -95,7 +97,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (client()) {
</span><span class="cx">         for (auto&amp; partialCue : m_incompleteCues)
</span><del>-            client()-&gt;removeDataCue(this, partialCue.startTime, MediaTime::positiveInfiniteTime(), partialCue.cueData);
</del><ins>+            client()-&gt;removeDataCue(partialCue.startTime, MediaTime::positiveInfiniteTime(), *partialCue.cueData);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_incompleteCues.resize(0);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationInbandTextTrackPrivateAVFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012-2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,11 +24,11 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#include &quot;InbandTextTrackPrivateAVF.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO) &amp;&amp; (USE(AVFOUNDATION) || PLATFORM(IOS))
</span><span class="cx"> 
</span><del>-#include &quot;InbandTextTrackPrivateAVF.h&quot;
-
</del><ins>+#include &quot;CoreMediaSoftLink.h&quot;
</ins><span class="cx"> #include &quot;ISOVTTCue.h&quot;
</span><span class="cx"> #include &quot;InbandTextTrackPrivateClient.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="lines">@@ -43,12 +43,6 @@
</span><span class="cx"> #include &lt;wtf/unicode/CharacterNames.h&gt;
</span><span class="cx"> #include &lt;wtf/StringPrintStream.h&gt;
</span><span class="cx"> 
</span><del>-#include &quot;CoreMediaSoftLink.h&quot;
-
-namespace JSC {
-class ArrayBuffer;
-}
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> AVFInbandTrackParent::~AVFInbandTrackParent()
</span><span class="lines">@@ -323,33 +317,33 @@
</span><span class="cx"> {
</span><span class="cx">     LOG(Media, &quot;InbandTextTrackPrivateAVF::processCue - %li cues at time %s\n&quot;, attributedStrings ? CFArrayGetCount(attributedStrings) : 0, toString(time).utf8().data());
</span><span class="cx"> 
</span><del>-    Vector&lt;RefPtr&lt;GenericCueData&gt;&gt; arrivingCues;
</del><ins>+    Vector&lt;Ref&lt;GenericCueData&gt;&gt; arrivingCues;
</ins><span class="cx">     if (attributedStrings) {
</span><span class="cx">         CFIndex count = CFArrayGetCount(attributedStrings);
</span><span class="cx">         for (CFIndex i = 0; i &lt; count; i++) {
</span><span class="cx">             CFAttributedStringRef attributedString = static_cast&lt;CFAttributedStringRef&gt;(CFArrayGetValueAtIndex(attributedStrings, i));
</span><del>-            
</del><ins>+
</ins><span class="cx">             if (!attributedString || !CFAttributedStringGetLength(attributedString))
</span><span class="cx">                 continue;
</span><del>-            
-            RefPtr&lt;GenericCueData&gt; cueData = GenericCueData::create();
-            processCueAttributes(attributedString, *cueData.get());
</del><ins>+
+            auto cueData = GenericCueData::create();
+            processCueAttributes(attributedString, cueData.get());
</ins><span class="cx">             if (!cueData-&gt;content().length())
</span><span class="cx">                 continue;
</span><del>-            
-            arrivingCues.append(cueData);
-            
</del><ins>+
</ins><span class="cx">             cueData-&gt;setStartTime(time);
</span><span class="cx">             cueData-&gt;setEndTime(MediaTime::positiveInfiniteTime());
</span><del>-            
</del><ins>+
</ins><span class="cx">             // AVFoundation cue &quot;position&quot; is to the center of the text so adjust relative to the edge because we will use it to
</span><span class="cx">             // set CSS &quot;left&quot;.
</span><span class="cx">             if (cueData-&gt;position() &gt;= 0 &amp;&amp; cueData-&gt;size() &gt; 0)
</span><span class="cx">                 cueData-&gt;setPosition(cueData-&gt;position() - cueData-&gt;size() / 2);
</span><del>-            
</del><ins>+
</ins><span class="cx">             LOG(Media, &quot;InbandTextTrackPrivateAVF::processCue(%p) - considering cue (\&quot;%s\&quot;) for time = %s, position =  %.2f, line =  %.2f&quot;, this, cueData-&gt;content().utf8().data(), toString(cueData-&gt;startTime()).utf8().data(), cueData-&gt;position(), cueData-&gt;line());
</span><del>-            
</del><ins>+
</ins><span class="cx">             cueData-&gt;setStatus(GenericCueData::Partial);
</span><ins>+
+            arrivingCues.append(WTFMove(cueData));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -360,10 +354,10 @@
</span><span class="cx">         if (m_currentCueEndTime &gt;= m_currentCueStartTime) {
</span><span class="cx">             for (auto&amp; cueData : m_cues) {
</span><span class="cx">                 // See if one of the newly-arrived cues is an extension of this cue.
</span><del>-                Vector&lt;RefPtr&lt;GenericCueData&gt;&gt; nonExtensionCues;
</del><ins>+                Vector&lt;Ref&lt;GenericCueData&gt;&gt; nonExtensionCues;
</ins><span class="cx">                 for (auto&amp; arrivingCue : arrivingCues) {
</span><span class="cx">                     if (!arrivingCue-&gt;doesExtendCueData(*cueData))
</span><del>-                        nonExtensionCues.append(arrivingCue);
</del><ins>+                        nonExtensionCues.append(WTFMove(arrivingCue));
</ins><span class="cx">                     else
</span><span class="cx">                         LOG(Media, &quot;InbandTextTrackPrivateAVF::processCue(%p) - found an extension cue (\&quot;%s\&quot;) for time = %.2f, end = %.2f, position =  %.2f, line =  %.2f&quot;, this, arrivingCue-&gt;content().utf8().data(), arrivingCue-&gt;startTime().toDouble(), arrivingCue-&gt;endTime().toDouble(), arrivingCue-&gt;position(), arrivingCue-&gt;line());
</span><span class="cx">                 }
</span><span class="lines">@@ -370,7 +364,7 @@
</span><span class="cx"> 
</span><span class="cx">                 bool currentCueIsExtended = (arrivingCues.size() != nonExtensionCues.size());
</span><span class="cx"> 
</span><del>-                arrivingCues = nonExtensionCues;
</del><ins>+                arrivingCues = WTFMove(nonExtensionCues);
</ins><span class="cx">                 
</span><span class="cx">                 if (currentCueIsExtended)
</span><span class="cx">                     continue;
</span><span class="lines">@@ -380,7 +374,7 @@
</span><span class="cx">                     cueData-&gt;setStatus(GenericCueData::Complete);
</span><span class="cx"> 
</span><span class="cx">                     LOG(Media, &quot;InbandTextTrackPrivateAVF::processCue(%p) - updating cue \&quot;%s\&quot;: start=%.2f, end=%.2f&quot;, this, cueData-&gt;content().utf8().data(), cueData-&gt;startTime().toDouble(), m_currentCueEndTime.toDouble());
</span><del>-                    client()-&gt;updateGenericCue(this, cueData.get());
</del><ins>+                    client()-&gt;updateGenericCue(*cueData);
</ins><span class="cx">                 } else {
</span><span class="cx">                     // We have to assume that the implicit duration is invalid for cues delivered during a seek because the AVF decode pipeline may not
</span><span class="cx">                     // see every cue, so DO NOT update cue duration while seeking.
</span><span class="lines">@@ -399,12 +393,11 @@
</span><span class="cx">     m_currentCueStartTime = time;
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; cueData : arrivingCues) {
</span><del>-
-        m_cues.append(cueData);
</del><ins>+        m_cues.append(cueData.ptr());
</ins><span class="cx">         
</span><span class="cx">         LOG(Media, &quot;InbandTextTrackPrivateAVF::processCue(%p) - adding cue \&quot;%s\&quot; for time = %.2f, end = %.2f, position =  %.2f, line =  %.2f&quot;, this, cueData-&gt;content().utf8().data(), cueData-&gt;startTime().toDouble(), cueData-&gt;endTime().toDouble(), cueData-&gt;position(), cueData-&gt;line());
</span><span class="cx"> 
</span><del>-        client()-&gt;addGenericCue(this, WTFMove(cueData));
</del><ins>+        client()-&gt;addGenericCue(WTFMove(cueData));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_pendingCueStatus = seeking() ? DeliveredDuringSeek : Valid;
</span><span class="lines">@@ -451,9 +444,9 @@
</span><span class="cx">     if (m_currentCueEndTime &amp;&amp; m_cues.size())
</span><span class="cx">         LOG(Media, &quot;InbandTextTrackPrivateAVF::resetCueValues flushing data for cues: start=%s\n&quot;, toString(m_currentCueStartTime).utf8().data());
</span><span class="cx"> 
</span><del>-    if (client()) {
-        for (size_t i = 0; i &lt; m_cues.size(); i++)
-            client()-&gt;removeGenericCue(this, m_cues[i].get());
</del><ins>+    if (auto* client = this-&gt;client()) {
+        for (auto&amp; cue : m_cues)
+            client-&gt;removeGenericCue(*cue);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_cues.resize(0);
</span><span class="lines">@@ -509,7 +502,7 @@
</span><span class="cx">             LOG(Media, &quot;    id = \&quot;%s\&quot;, settings = \&quot;%s\&quot;, cue text = \&quot;%s\&quot;&quot;, cueData.id().utf8().data(), cueData.settings().utf8().data(), cueData.cueText().utf8().data());
</span><span class="cx">             LOG(Media, &quot;    sourceID = \&quot;%s\&quot;, originalStartTime = \&quot;%s\&quot;&quot;, cueData.sourceID().utf8().data(), cueData.originalStartTime().utf8().data());
</span><span class="cx"> 
</span><del>-            client()-&gt;parseWebVTTCueData(this, cueData);
</del><ins>+            client()-&gt;parseWebVTTCueData(cueData);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         do {
</span><span class="lines">@@ -542,7 +535,7 @@
</span><span class="cx">             header.append(&quot;\n\n&quot;);
</span><span class="cx"> 
</span><span class="cx">             LOG(Media, &quot;    vtt header = \n%s&quot;, header.toString().utf8().data());
</span><del>-            client()-&gt;parseWebVTTFileHeader(this, header.toString());
</del><ins>+            client()-&gt;parseWebVTTFileHeader(header.toString());
</ins><span class="cx">             m_haveReportedVTTHeader = true;
</span><span class="cx">         } while (0);
</span><span class="cx"> 
</span><span class="lines">@@ -555,7 +548,7 @@
</span><span class="cx"> #if OS(WINDOWS) &amp;&amp; HAVE(AVCFPLAYERITEM_CALLBACK_VERSION_2)
</span><span class="cx">     return false;
</span><span class="cx"> #else
</span><del>-    CMSampleBufferRef const sampleBuffer = reinterpret_cast&lt;CMSampleBufferRef&gt;(const_cast&lt;void*&gt;(CFArrayGetValueAtIndex(nativeSamples, index)));
</del><ins>+    CMSampleBufferRef sampleBuffer = reinterpret_cast&lt;CMSampleBufferRef&gt;(const_cast&lt;void*&gt;(CFArrayGetValueAtIndex(nativeSamples, index)));
</ins><span class="cx">     if (!sampleBuffer)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationVideoTrackPrivateAVFh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/VideoTrackPrivateAVF.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/VideoTrackPrivateAVF.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/VideoTrackPrivateAVF.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef VideoTrackPrivateAVF_h
-#define VideoTrackPrivateAVF_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="lines">@@ -35,7 +34,6 @@
</span><span class="cx"> class VideoTrackPrivateAVF : public VideoTrackPrivate {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(VideoTrackPrivateAVF)
</span><span class="cx"> public:
</span><del>-
</del><span class="cx">     int trackIndex() const override { return m_index; }
</span><span class="cx">     Kind kind() const override { return m_kind; }
</span><span class="cx">     AtomicString id() const override { return m_id; }
</span><span class="lines">@@ -44,26 +42,20 @@
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     void setKind(Kind kind) { m_kind = kind; }
</span><del>-    void setId(AtomicString newId) { m_id = newId; }
-    void setLabel(AtomicString label) { m_label = label; }
-    void setLanguage(AtomicString language) { m_language = language; }
</del><ins>+    void setId(const AtomicString&amp; newId) { m_id = newId; }
+    void setLabel(const AtomicString&amp; label) { m_label = label; }
+    void setLanguage(const AtomicString&amp; language) { m_language = language; }
</ins><span class="cx">     void setTrackIndex(int index) { m_index = index; }
</span><span class="cx"> 
</span><del>-    Kind m_kind;
</del><ins>+    Kind m_kind { None };
</ins><span class="cx">     AtomicString m_id;
</span><span class="cx">     AtomicString m_label;
</span><span class="cx">     AtomicString m_language;
</span><del>-    int m_index;
</del><ins>+    int m_index { 0 };
</ins><span class="cx"> 
</span><del>-    VideoTrackPrivateAVF()
-        : m_kind(None)
-        , m_index(0)
-    {
-    }
</del><ins>+    VideoTrackPrivateAVF() = default;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(VIDEO_TRACK)
</span><del>-
-#endif // VideoTrackPrivateAVF_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcAudioTrackPrivateMediaSourceAVFObjCcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -36,8 +36,6 @@
</span><span class="cx"> AudioTrackPrivateMediaSourceAVFObjC::AudioTrackPrivateMediaSourceAVFObjC(AVAssetTrack* track, SourceBufferPrivateAVFObjC* parent)
</span><span class="cx">     : m_impl(std::make_unique&lt;AVTrackPrivateAVFObjCImpl&gt;(track))
</span><span class="cx">     , m_parent(parent)
</span><del>-    , m_trackID(-1)
-    , m_enabled(false)
</del><span class="cx"> {
</span><span class="cx">     resetPropertiesFromTrack();
</span><span class="cx"> }
</span><span class="lines">@@ -63,17 +61,12 @@
</span><span class="cx">     return m_impl-&gt;assetTrack();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool AudioTrackPrivateMediaSourceAVFObjC::enabled() const
-{
-    return m_enabled;
-}
-
</del><span class="cx"> void AudioTrackPrivateMediaSourceAVFObjC::setEnabled(bool enabled)
</span><span class="cx"> {
</span><del>-    if (m_enabled == enabled)
</del><ins>+    if (enabled == this-&gt;enabled())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_enabled = enabled;
</del><ins>+    AudioTrackPrivateAVF::setEnabled(enabled);
</ins><span class="cx">     m_parent-&gt;trackDidChangeEnabled(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcAudioTrackPrivateMediaSourceAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -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 AudioTrackPrivateMediaSourceAVFObjC_h
-#define AudioTrackPrivateMediaSourceAVFObjC_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;AudioTrackPrivateAVF.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -31,7 +30,6 @@
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE) &amp;&amp; ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="cx"> OBJC_CLASS AVAssetTrack;
</span><del>-OBJC_CLASS AVPlayerItemTrack;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -41,13 +39,12 @@
</span><span class="cx"> class AudioTrackPrivateMediaSourceAVFObjC final : public AudioTrackPrivateAVF {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(AudioTrackPrivateMediaSourceAVFObjC)
</span><span class="cx"> public:
</span><del>-    static RefPtr&lt;AudioTrackPrivateMediaSourceAVFObjC&gt; create(AVAssetTrack* track, SourceBufferPrivateAVFObjC* parent)
</del><ins>+    static RefPtr&lt;AudioTrackPrivateMediaSourceAVFObjC&gt; create(AVAssetTrack *track, SourceBufferPrivateAVFObjC* parent)
</ins><span class="cx">     {
</span><span class="cx">         return adoptRef(new AudioTrackPrivateMediaSourceAVFObjC(track, parent));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool enabled() const override;
-    void setEnabled(bool) override;
</del><ins>+    void setEnabled(bool) final;
</ins><span class="cx"> 
</span><span class="cx">     void setAssetTrack(AVAssetTrack*);
</span><span class="cx">     AVAssetTrack* assetTrack();
</span><span class="lines">@@ -62,11 +59,8 @@
</span><span class="cx">     std::unique_ptr&lt;AVTrackPrivateAVFObjCImpl&gt; m_impl;
</span><span class="cx">     SourceBufferPrivateAVFObjC* m_parent;
</span><span class="cx">     int m_trackID;
</span><del>-    bool m_enabled;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(MEDIA_SOURCE) &amp;&amp; ENABLE(VIDEO_TRACK)
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #import &quot;AVFoundationSPI.h&quot;
</span><span class="cx"> #import &quot;AudioTrackPrivateMediaStream.h&quot;
</span><span class="cx"> #import &quot;Clock.h&quot;
</span><ins>+#import &quot;CoreMediaSoftLink.h&quot;
</ins><span class="cx"> #import &quot;GraphicsContext.h&quot;
</span><span class="cx"> #import &quot;Logging.h&quot;
</span><span class="cx"> #import &quot;MediaStreamPrivate.h&quot;
</span><span class="lines">@@ -49,8 +50,6 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma mark - Soft Linking
</span><span class="cx"> 
</span><del>-#import &quot;CoreMediaSoftLink.h&quot;
-
</del><span class="cx"> SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
</span><span class="cx"> 
</span><span class="cx"> SOFT_LINK_CLASS_OPTIONAL(AVFoundation, AVSampleBufferDisplayLayer)
</span><span class="lines">@@ -380,10 +379,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     for (const auto&amp; track : m_audioTrackMap.values()) {
</span><del>-        if (!track-&gt;enabled() || !track-&gt;streamTrack()-&gt;preview())
</del><ins>+        if (!track-&gt;enabled() || !track-&gt;streamTrack().preview())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        track-&gt;streamTrack()-&gt;preview()-&gt;play();
</del><ins>+        track-&gt;streamTrack().preview()-&gt;play();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_haveEverPlayed = true;
</span><span class="lines">@@ -411,10 +410,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     for (const auto&amp; track : m_audioTrackMap.values()) {
</span><del>-        if (!track-&gt;enabled() || !track-&gt;streamTrack()-&gt;preview())
</del><ins>+        if (!track-&gt;enabled() || !track-&gt;streamTrack().preview())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        track-&gt;streamTrack()-&gt;preview()-&gt;pause();
</del><ins>+        track-&gt;streamTrack().preview()-&gt;pause();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     updateDisplayMode();
</span><span class="lines">@@ -435,10 +434,10 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     for (const auto&amp; track : m_audioTrackMap.values()) {
</span><del>-        if (!track-&gt;enabled() || !track-&gt;streamTrack()-&gt;preview())
</del><ins>+        if (!track-&gt;enabled() || !track-&gt;streamTrack().preview())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        track-&gt;streamTrack()-&gt;preview()-&gt;setVolume(volume);
</del><ins>+        track-&gt;streamTrack().preview()-&gt;setVolume(volume);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -617,6 +616,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; ENABLE(VIDEO_PRESENTATION_MODE)
</span><ins>+
</ins><span class="cx"> void MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer(PlatformLayer *videoFullscreenLayer, std::function&lt;void()&gt; completionHandler)
</span><span class="cx"> {
</span><span class="cx">     m_videoFullscreenLayerManager-&gt;setVideoFullscreenLayer(videoFullscreenLayer, completionHandler);
</span><span class="lines">@@ -626,6 +626,7 @@
</span><span class="cx"> {
</span><span class="cx">     m_videoFullscreenLayerManager-&gt;setVideoFullscreenFrame(frame);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename RefT, typename PassRefT&gt;
</span><span class="lines">@@ -644,12 +645,12 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (const auto&amp; track : trackMap.values()) {
</span><del>-        MediaStreamTrackPrivate* streamTrack = track-&gt;streamTrack();
-        if (currentTracks.contains(streamTrack))
</del><ins>+        auto&amp; streamTrack = track-&gt;streamTrack();
+        if (currentTracks.contains(&amp;streamTrack))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         removedTracks.append(track);
</span><del>-        trackMap.remove(streamTrack-&gt;id());
</del><ins>+        trackMap.remove(streamTrack.id());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; track : addedPrivateTracks) {
</span><span class="lines">@@ -664,12 +665,12 @@
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; track : removedTracks) {
</span><span class="cx">         (player-&gt;*removedFunction)(*track);
</span><del>-        track-&gt;streamTrack()-&gt;removeObserver(*trackObserver);
</del><ins>+        track-&gt;streamTrack().removeObserver(*trackObserver);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; track : addedTracks) {
</span><span class="cx">         (player-&gt;*addedFunction)(*track);
</span><del>-        track-&gt;streamTrack()-&gt;addObserver(*trackObserver);
</del><ins>+        track-&gt;streamTrack().addObserver(*trackObserver);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -680,7 +681,7 @@
</span><span class="cx">     std::function&lt;void(RefPtr&lt;AudioTrackPrivateMediaStream&gt;, int)&gt; enableAudioTrack = [this](auto track, int index)
</span><span class="cx">     {
</span><span class="cx">         track-&gt;setTrackIndex(index);
</span><del>-        track-&gt;setEnabled(track-&gt;streamTrack()-&gt;enabled() &amp;&amp; !track-&gt;streamTrack()-&gt;muted());
</del><ins>+        track-&gt;setEnabled(track-&gt;streamTrack().enabled() &amp;&amp; !track-&gt;streamTrack().muted());
</ins><span class="cx">     };
</span><span class="cx">     updateTracksOfType(m_audioTrackMap, RealtimeMediaSource::Audio, currentTracks, &amp;AudioTrackPrivateMediaStream::create, m_player, &amp;MediaPlayer::removeAudioTrack, &amp;MediaPlayer::addAudioTrack, enableAudioTrack, (MediaStreamTrackPrivate::Observer*) this);
</span><span class="cx"> 
</span><span class="lines">@@ -687,7 +688,7 @@
</span><span class="cx">     std::function&lt;void(RefPtr&lt;VideoTrackPrivateMediaStream&gt;, int)&gt; enableVideoTrack = [this](auto track, int index)
</span><span class="cx">     {
</span><span class="cx">         track-&gt;setTrackIndex(index);
</span><del>-        bool selected = track-&gt;streamTrack() == m_mediaStreamPrivate-&gt;activeVideoTrack();
</del><ins>+        bool selected = &amp;track-&gt;streamTrack() == m_mediaStreamPrivate-&gt;activeVideoTrack();
</ins><span class="cx">         track-&gt;setSelected(selected);
</span><span class="cx"> 
</span><span class="cx">         if (selected)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -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 SourceBufferPrivateAVFObjC_h
-#define SourceBufferPrivateAVFObjC_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
</span><span class="cx"> 
</span><span class="lines">@@ -114,18 +113,18 @@
</span><span class="cx">     explicit SourceBufferPrivateAVFObjC(MediaSourcePrivateAVFObjC*);
</span><span class="cx"> 
</span><span class="cx">     // SourceBufferPrivate overrides
</span><del>-    void setClient(SourceBufferPrivateClient*) override;
-    void append(const unsigned char* data, unsigned length) override;
-    void abort() override;
-    void resetParserState() override;
-    void removedFromMediaSource() override;
-    MediaPlayer::ReadyState readyState() const override;
-    void setReadyState(MediaPlayer::ReadyState) override;
-    void flush(AtomicString trackID) override;
-    void enqueueSample(PassRefPtr&lt;MediaSample&gt;, AtomicString trackID) override;
-    bool isReadyForMoreSamples(AtomicString trackID) override;
-    void setActive(bool) override;
-    void notifyClientWhenReadyForMoreSamples(AtomicString trackID) override;
</del><ins>+    void setClient(SourceBufferPrivateClient*) final;
+    void append(const unsigned char* data, unsigned length) final;
+    void abort() final;
+    void resetParserState() final;
+    void removedFromMediaSource() final;
+    MediaPlayer::ReadyState readyState() const final;
+    void setReadyState(MediaPlayer::ReadyState) final;
+    void flush(const AtomicString&amp; trackID) final;
+    void enqueueSample(Ref&lt;MediaSample&gt;&amp;&amp;, const AtomicString&amp; trackID) final;
+    bool isReadyForMoreSamples(const AtomicString&amp; trackID) final;
+    void setActive(bool) final;
+    void notifyClientWhenReadyForMoreSamples(const AtomicString&amp; trackID) final;
</ins><span class="cx"> 
</span><span class="cx">     void didBecomeReadyForMoreSamples(int trackID);
</span><span class="cx">     void appendCompleted();
</span><span class="lines">@@ -155,7 +154,7 @@
</span><span class="cx">     OSObjectPtr&lt;dispatch_group_t&gt; m_isAppendingGroup;
</span><span class="cx"> 
</span><span class="cx">     MediaSourcePrivateAVFObjC* m_mediaSource;
</span><del>-    SourceBufferPrivateClient* m_client;
</del><ins>+    SourceBufferPrivateClient* m_client { nullptr };
</ins><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx">     CDMSessionMediaSourceAVFObjC* m_session { nullptr };
</span><span class="cx"> #endif
</span><span class="lines">@@ -162,14 +161,12 @@
</span><span class="cx"> 
</span><span class="cx">     std::optional&lt;FloatSize&gt; m_cachedSize;
</span><span class="cx">     FloatSize m_currentSize;
</span><del>-    bool m_parsingSucceeded;
</del><ins>+    bool m_parsingSucceeded { true };
</ins><span class="cx">     bool m_parserStateWasReset { false };
</span><del>-    int m_enabledVideoTrackID;
-    int m_protectedTrackID;
</del><ins>+    int m_enabledVideoTrackID { -1 };
+    int m_protectedTrackID { -1 };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcSourceBufferPrivateAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -151,10 +151,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)streamDataParser:(AVStreamDataParser *)streamDataParser didParseStreamDataAsAsset:(AVAsset *)asset
</span><span class="cx"> {
</span><del>-#if ASSERT_DISABLED
-    UNUSED_PARAM(streamDataParser);
-#endif
-    ASSERT(streamDataParser == _parser);
</del><ins>+    ASSERT_UNUSED(streamDataParser, streamDataParser == _parser);
</ins><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;AVAsset*&gt; protectedAsset = asset;
</span><span class="cx">     callOnMainThread([parent = _parent, protectedAsset = WTFMove(protectedAsset)] {
</span><span class="lines">@@ -166,10 +163,7 @@
</span><span class="cx"> - (void)streamDataParser:(AVStreamDataParser *)streamDataParser didParseStreamDataAsAsset:(AVAsset *)asset withDiscontinuity:(BOOL)discontinuity
</span><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(discontinuity);
</span><del>-#if ASSERT_DISABLED
-    UNUSED_PARAM(streamDataParser);
-#endif
-    ASSERT(streamDataParser == _parser);
</del><ins>+    ASSERT_UNUSED(streamDataParser, streamDataParser == _parser);
</ins><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;AVAsset*&gt; protectedAsset = asset;
</span><span class="cx">     callOnMainThread([parent = _parent, protectedAsset = WTFMove(protectedAsset)] {
</span><span class="lines">@@ -180,10 +174,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)streamDataParser:(AVStreamDataParser *)streamDataParser didFailToParseStreamDataWithError:(NSError *)error
</span><span class="cx"> {
</span><del>-#if ASSERT_DISABLED
-    UNUSED_PARAM(streamDataParser);
-#endif
-    ASSERT(streamDataParser == _parser);
</del><ins>+    ASSERT_UNUSED(streamDataParser, streamDataParser == _parser);
</ins><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;NSError&gt; protectedError = error;
</span><span class="cx">     callOnMainThread([parent = _parent, protectedError = WTFMove(protectedError)] {
</span><span class="lines">@@ -194,10 +185,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)streamDataParser:(AVStreamDataParser *)streamDataParser didProvideMediaData:(CMSampleBufferRef)sample forTrackID:(CMPersistentTrackID)trackID mediaType:(NSString *)nsMediaType flags:(AVStreamDataParserOutputMediaDataFlags)flags
</span><span class="cx"> {
</span><del>-#if ASSERT_DISABLED
-    UNUSED_PARAM(streamDataParser);
-#endif
-    ASSERT(streamDataParser == _parser);
</del><ins>+    ASSERT_UNUSED(streamDataParser, streamDataParser == _parser);
</ins><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;CMSampleBufferRef&gt; protectedSample = sample;
</span><span class="cx">     String mediaType = nsMediaType;
</span><span class="lines">@@ -209,10 +197,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)streamDataParser:(AVStreamDataParser *)streamDataParser didReachEndOfTrackWithTrackID:(CMPersistentTrackID)trackID mediaType:(NSString *)nsMediaType
</span><span class="cx"> {
</span><del>-#if ASSERT_DISABLED
-    UNUSED_PARAM(streamDataParser);
-#endif
-    ASSERT(streamDataParser == _parser);
</del><ins>+    ASSERT_UNUSED(streamDataParser, streamDataParser == _parser);
</ins><span class="cx"> 
</span><span class="cx">     String mediaType = nsMediaType;
</span><span class="cx">     callOnMainThread([parent = _parent, trackID, mediaType] {
</span><span class="lines">@@ -223,10 +208,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)streamDataParserWillProvideContentKeyRequestInitializationData:(AVStreamDataParser *)streamDataParser forTrackID:(CMPersistentTrackID)trackID
</span><span class="cx"> {
</span><del>-#if ASSERT_DISABLED
-    UNUSED_PARAM(streamDataParser);
-#endif
-    ASSERT(streamDataParser == _parser);
</del><ins>+    ASSERT_UNUSED(streamDataParser, streamDataParser == _parser);
</ins><span class="cx"> 
</span><span class="cx">     // We must call synchronously to the main thread, as the AVStreamSession must be associated
</span><span class="cx">     // with the streamDataParser before the delegate method returns.
</span><span class="lines">@@ -238,10 +220,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)streamDataParser:(AVStreamDataParser *)streamDataParser didProvideContentKeyRequestInitializationData:(NSData *)initData forTrackID:(CMPersistentTrackID)trackID
</span><span class="cx"> {
</span><del>-#if ASSERT_DISABLED
-    UNUSED_PARAM(streamDataParser);
-#endif
-    ASSERT(streamDataParser == _parser);
</del><ins>+    ASSERT_UNUSED(streamDataParser, streamDataParser == _parser);
</ins><span class="cx"> 
</span><span class="cx">     OSObjectPtr&lt;dispatch_semaphore_t&gt; hasSessionSemaphore = adoptOSObject(dispatch_semaphore_create(0));
</span><span class="cx">     callOnMainThread([parent = _parent, protectedInitData = RetainPtr&lt;NSData&gt;(initData), trackID, hasSessionSemaphore] {
</span><span class="lines">@@ -449,10 +428,6 @@
</span><span class="cx">     , m_errorListener(adoptNS([[WebAVSampleBufferErrorListener alloc] initWithParent:this]))
</span><span class="cx">     , m_isAppendingGroup(adoptOSObject(dispatch_group_create()))
</span><span class="cx">     , m_mediaSource(parent)
</span><del>-    , m_client(0)
-    , m_parsingSucceeded(true)
-    , m_enabledVideoTrackID(-1)
-    , m_protectedTrackID(-1)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -512,10 +487,10 @@
</span><span class="cx">         m_mediaSource-&gt;player()-&gt;characteristicsChanged();
</span><span class="cx"> 
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;sourceBufferPrivateDidReceiveInitializationSegment(this, segment);
</del><ins>+        m_client-&gt;sourceBufferPrivateDidReceiveInitializationSegment(segment);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError(NSError* error)
</del><ins>+void SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError(NSError *error)
</ins><span class="cx"> {
</span><span class="cx"> #if LOG_DISABLED
</span><span class="cx">     UNUSED_PARAM(error);
</span><span class="lines">@@ -531,10 +506,8 @@
</span><span class="cx">     const String&amp; mediaType;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-void SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID(int trackID, CMSampleBufferRef sampleBuffer, const String&amp; mediaType, unsigned flags)
</del><ins>+void SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID(int trackID, CMSampleBufferRef sampleBuffer, const String&amp; mediaType, unsigned)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(flags);
-
</del><span class="cx">     processCodedFrame(trackID, sampleBuffer, mediaType);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -549,16 +522,14 @@
</span><span class="cx">     if (m_client) {
</span><span class="cx">         Ref&lt;MediaSample&gt; mediaSample = MediaSampleAVFObjC::create(sampleBuffer, trackID);
</span><span class="cx">         LOG(MediaSourceSamples, &quot;SourceBufferPrivateAVFObjC::processCodedFrame(%p) - sample(%s)&quot;, this, toString(mediaSample.get()).utf8().data());
</span><del>-        m_client-&gt;sourceBufferPrivateDidReceiveSample(this, mediaSample);
</del><ins>+        m_client-&gt;sourceBufferPrivateDidReceiveSample(mediaSample);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBufferPrivateAVFObjC::didReachEndOfTrackWithTrackID(int trackID, const String&amp; mediaType)
</del><ins>+void SourceBufferPrivateAVFObjC::didReachEndOfTrackWithTrackID(int, const String&amp;)
</ins><span class="cx"> {
</span><del>-    UNUSED_PARAM(mediaType);
-    UNUSED_PARAM(trackID);
</del><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -590,7 +561,6 @@
</span><span class="cx">     if (!m_mediaSource)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    UNUSED_PARAM(trackID);
</del><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx">     LOG(MediaSource, &quot;SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID(%p) - track:%d&quot;, this, trackID);
</span><span class="cx">     m_protectedTrackID = trackID;
</span><span class="lines">@@ -607,6 +577,7 @@
</span><span class="cx">     }
</span><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(initData);
</span><ins>+    UNUSED_PARAM(trackID);
</ins><span class="cx">     UNUSED_PARAM(hasSessionSemaphore);
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="lines">@@ -659,7 +630,7 @@
</span><span class="cx">         m_mediaSource-&gt;player()-&gt;setLoadingProgresssed(true);
</span><span class="cx"> 
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;sourceBufferPrivateAppendComplete(this, m_parsingSucceeded ? SourceBufferPrivateClient::AppendSucceeded : SourceBufferPrivateClient::ParsingFailed);
</del><ins>+        m_client-&gt;sourceBufferPrivateAppendComplete(m_parsingSucceeded ? SourceBufferPrivateClient::AppendSucceeded : SourceBufferPrivateClient::ParsingFailed);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateAVFObjC::abort()
</span><span class="lines">@@ -735,18 +706,12 @@
</span><span class="cx"> 
</span><span class="cx"> bool SourceBufferPrivateAVFObjC::hasVideo() const
</span><span class="cx"> {
</span><del>-    if (!m_client)
-        return false;
-
-    return m_client-&gt;sourceBufferPrivateHasVideo(this);
</del><ins>+    return m_client &amp;&amp; m_client-&gt;sourceBufferPrivateHasVideo();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SourceBufferPrivateAVFObjC::hasAudio() const
</span><span class="cx"> {
</span><del>-    if (!m_client)
-        return false;
-
-    return m_client-&gt;sourceBufferPrivateHasAudio(this);
</del><ins>+    return m_client &amp;&amp; m_client-&gt;sourceBufferPrivateHasAudio();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateAVFObjC::trackDidChangeEnabled(VideoTrackPrivateMediaSourceAVFObjC* track)
</span><span class="lines">@@ -874,7 +839,7 @@
</span><span class="cx">     int errorCode = [[[error userInfo] valueForKey:@&quot;OSStatus&quot;] intValue];
</span><span class="cx"> 
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;sourceBufferPrivateDidReceiveRenderingError(this, errorCode);
</del><ins>+        m_client-&gt;sourceBufferPrivateDidReceiveRenderingError(errorCode);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateAVFObjC::rendererDidReceiveError(AVSampleBufferAudioRenderer *renderer, NSError *error)
</span><span class="lines">@@ -895,7 +860,7 @@
</span><span class="cx">         return;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBufferPrivateAVFObjC::flush(AtomicString trackIDString)
</del><ins>+void SourceBufferPrivateAVFObjC::flush(const AtomicString&amp; trackIDString)
</ins><span class="cx"> {
</span><span class="cx">     int trackID = trackIDString.toInt();
</span><span class="cx">     LOG(MediaSource, &quot;SourceBufferPrivateAVFObjC::flush(%p) - trackId: %d&quot;, this, trackID);
</span><span class="lines">@@ -925,19 +890,17 @@
</span><span class="cx">         m_mediaSource-&gt;player()-&gt;setHasAvailableAudioSample(renderer, false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBufferPrivateAVFObjC::enqueueSample(PassRefPtr&lt;MediaSample&gt; prpMediaSample, AtomicString trackIDString)
</del><ins>+void SourceBufferPrivateAVFObjC::enqueueSample(Ref&lt;MediaSample&gt;&amp;&amp; sample, const AtomicString&amp; trackIDString)
</ins><span class="cx"> {
</span><span class="cx">     int trackID = trackIDString.toInt();
</span><span class="cx">     if (trackID != m_enabledVideoTrackID &amp;&amp; !m_audioRenderers.contains(trackID))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;MediaSample&gt; mediaSample = prpMediaSample;
-
-    PlatformSample platformSample = mediaSample-&gt;platformSample();
</del><ins>+    PlatformSample platformSample = sample-&gt;platformSample();
</ins><span class="cx">     if (platformSample.type != PlatformSample::CMSampleBufferType)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    LOG(MediaSourceSamples, &quot;SourceBufferPrivateAVFObjC::enqueueSample(%p) - sample(%s)&quot;, this, toString(*mediaSample).utf8().data());
</del><ins>+    LOG(MediaSourceSamples, &quot;SourceBufferPrivateAVFObjC::enqueueSample(%p) - sample(%s)&quot;, this, toString(sample.get()).utf8().data());
</ins><span class="cx"> 
</span><span class="cx">     if (trackID == m_enabledVideoTrackID) {
</span><span class="cx">         CMFormatDescriptionRef formatDescription = CMSampleBufferGetFormatDescription(platformSample.sample.cmSampleBuffer);
</span><span class="lines">@@ -950,22 +913,22 @@
</span><span class="cx">                 if (sizeWasNull)
</span><span class="cx">                     m_mediaSource-&gt;player()-&gt;setNaturalSize(formatSize);
</span><span class="cx">                 else
</span><del>-                    m_mediaSource-&gt;player()-&gt;sizeWillChangeAtTime(mediaSample-&gt;presentationTime(), formatSize);
</del><ins>+                    m_mediaSource-&gt;player()-&gt;sizeWillChangeAtTime(sample-&gt;presentationTime(), formatSize);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         [m_displayLayer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer];
</span><span class="cx">         if (m_mediaSource)
</span><del>-            m_mediaSource-&gt;player()-&gt;setHasAvailableVideoFrame(!mediaSample-&gt;isNonDisplaying());
</del><ins>+            m_mediaSource-&gt;player()-&gt;setHasAvailableVideoFrame(!sample-&gt;isNonDisplaying());
</ins><span class="cx">     } else {
</span><span class="cx">         auto renderer = m_audioRenderers.get(trackID);
</span><span class="cx">         [renderer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer];
</span><span class="cx">         if (m_mediaSource)
</span><del>-            m_mediaSource-&gt;player()-&gt;setHasAvailableAudioSample(renderer.get(), !mediaSample-&gt;isNonDisplaying());
</del><ins>+            m_mediaSource-&gt;player()-&gt;setHasAvailableAudioSample(renderer.get(), !sample-&gt;isNonDisplaying());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SourceBufferPrivateAVFObjC::isReadyForMoreSamples(AtomicString trackIDString)
</del><ins>+bool SourceBufferPrivateAVFObjC::isReadyForMoreSamples(const AtomicString&amp; trackIDString)
</ins><span class="cx"> {
</span><span class="cx">     int trackID = trackIDString.toInt();
</span><span class="cx">     if (trackID == m_enabledVideoTrackID)
</span><span class="lines">@@ -984,9 +947,9 @@
</span><span class="cx"> 
</span><span class="cx"> MediaTime SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime(MediaTime time, MediaTime negativeThreshold, MediaTime positiveThreshold)
</span><span class="cx"> {
</span><del>-    if (m_client)
-        return m_client-&gt;sourceBufferPrivateFastSeekTimeForMediaTime(this, time, negativeThreshold, positiveThreshold);
-    return time;
</del><ins>+    if (!m_client)
+        return time;
+    return m_client-&gt;sourceBufferPrivateFastSeekTimeForMediaTime(time, negativeThreshold, positiveThreshold);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateAVFObjC::willSeek()
</span><span class="lines">@@ -1001,7 +964,7 @@
</span><span class="cx"> void SourceBufferPrivateAVFObjC::seekToTime(MediaTime time)
</span><span class="cx"> {
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;sourceBufferPrivateSeekToTime(this, time);
</del><ins>+        m_client-&gt;sourceBufferPrivateSeekToTime(time);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FloatSize SourceBufferPrivateAVFObjC::naturalSize()
</span><span class="lines">@@ -1021,10 +984,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;sourceBufferPrivateDidBecomeReadyForMoreSamples(this, AtomicString::number(trackID));
</del><ins>+        m_client-&gt;sourceBufferPrivateDidBecomeReadyForMoreSamples(AtomicString::number(trackID));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples(AtomicString trackIDString)
</del><ins>+void SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples(const AtomicString&amp; trackIDString)
</ins><span class="cx"> {
</span><span class="cx">     int trackID = trackIDString.toInt();
</span><span class="cx">     if (trackID == m_enabledVideoTrackID) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcVideoTrackPrivateAVFObjCcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -25,11 +25,12 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;VideoTrackPrivateAVFObjC.h&quot;
</span><ins>+
+#if ENABLE(VIDEO_TRACK)
+
</ins><span class="cx"> #import &quot;AVTrackPrivateAVFObjCImpl.h&quot;
</span><span class="cx"> #import &quot;MediaSelectionGroupAVFObjC.h&quot;
</span><span class="cx"> 
</span><del>-#if ENABLE(VIDEO_TRACK)
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> VideoTrackPrivateAVFObjC::VideoTrackPrivateAVFObjC(AVPlayerItemTrack* track)
</span><span class="lines">@@ -105,4 +106,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerInbandMetadataTextTrackPrivateGStreamerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h        2017-01-05 06:45:48 UTC (rev 210319)
</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 InbandMetadataTextTrackPrivateGStreamer_h
-#define InbandMetadataTextTrackPrivateGStreamer_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO) &amp;&amp; USE(GSTREAMER) &amp;&amp; ENABLE(VIDEO_TRACK)
</span><span class="cx"> 
</span><span class="lines">@@ -50,13 +49,13 @@
</span><span class="cx">     void addDataCue(const MediaTime&amp; start, const MediaTime&amp; end, const void* data, unsigned length)
</span><span class="cx">     {
</span><span class="cx">         ASSERT(cueFormat() == Data);
</span><del>-        client()-&gt;addDataCue(this, start, end, data, length);
</del><ins>+        client()-&gt;addDataCue(start, end, data, length);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void addGenericCue(PassRefPtr&lt;GenericCueData&gt; data)
</span><span class="cx">     {
</span><span class="cx">         ASSERT(cueFormat() == Generic);
</span><del>-        client()-&gt;addGenericCue(this, data);
</del><ins>+        client()-&gt;addGenericCue(*data);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -76,5 +75,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(VIDEO) &amp;&amp; USE(GSTREAMER) &amp;&amp; ENABLE(VIDEO_TRACK)
</span><del>-
-#endif // InbandMetadataTextTrackPrivateGStreamer_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerInbandTextTrackPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx"> 
</span><span class="cx">         GST_INFO(&quot;Track %d parsing sample: %.*s&quot;, m_index, static_cast&lt;int&gt;(info.size),
</span><span class="cx">             reinterpret_cast&lt;char*&gt;(info.data));
</span><del>-        client()-&gt;parseWebVTTCueData(this, reinterpret_cast&lt;char*&gt;(info.data), info.size);
</del><ins>+        client()-&gt;parseWebVTTCueData(reinterpret_cast&lt;char*&gt;(info.data), info.size);
</ins><span class="cx">         gst_buffer_unmap(buffer, &amp;info);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerTrackPrivateBaseGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (getTag(tags.get(), GST_TAG_TITLE, m_label))
</span><del>-        client-&gt;labelChanged(m_owner, m_label);
</del><ins>+        client-&gt;labelChanged(m_label);
</ins><span class="cx"> 
</span><span class="cx">     AtomicString language;
</span><span class="cx">     if (!getLanguageCode(tags.get(), language))
</span><span class="lines">@@ -167,7 +167,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_language = language;
</span><del>-    client-&gt;languageChanged(m_owner, m_language);
</del><ins>+    client-&gt;languageChanged(m_language);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamermseAppendPipelinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -676,7 +676,7 @@
</span><span class="cx">             mediaSample-&gt;applyPtsOffset(MediaTime::zeroTime());
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        m_sourceBufferPrivate-&gt;didReceiveSample(mediaSample);
</del><ins>+        m_sourceBufferPrivate-&gt;didReceiveSample(*mediaSample);
</ins><span class="cx">         setAppendState(AppendState::Sampling);
</span><span class="cx">         m_flowReturn = GST_FLOW_OK;
</span><span class="cx">         m_newSampleCondition.notifyOne();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamermseSourceBufferPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">     if (m_client-&gt;append(this, data, length))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_sourceBufferPrivateClient-&gt;sourceBufferPrivateAppendComplete(this, SourceBufferPrivateClient::ReadStreamFailed);
</del><ins>+    m_sourceBufferPrivateClient-&gt;sourceBufferPrivateAppendComplete(SourceBufferPrivateClient::ReadStreamFailed);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateGStreamer::abort()
</span><span class="lines">@@ -106,20 +106,19 @@
</span><span class="cx">     m_mediaSource-&gt;setReadyState(state);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBufferPrivateGStreamer::flush(AtomicString trackId)
</del><ins>+void SourceBufferPrivateGStreamer::flush(const AtomicString&amp; trackId)
</ins><span class="cx"> {
</span><span class="cx">     m_client-&gt;flush(trackId);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBufferPrivateGStreamer::enqueueSample(PassRefPtr&lt;MediaSample&gt; prpSample, AtomicString)
</del><ins>+void SourceBufferPrivateGStreamer::enqueueSample(Ref&lt;MediaSample&gt;&amp;&amp; sample, const AtomicString&amp;)
</ins><span class="cx"> {
</span><span class="cx">     m_notifyWhenReadyForMoreSamples = false;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;MediaSample&gt; protectedPrpSample = prpSample;
-    m_client-&gt;enqueueSample(protectedPrpSample);
</del><ins>+    m_client-&gt;enqueueSample(WTFMove(sample));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool SourceBufferPrivateGStreamer::isReadyForMoreSamples(AtomicString)
</del><ins>+bool SourceBufferPrivateGStreamer::isReadyForMoreSamples(const AtomicString&amp;)
</ins><span class="cx"> {
</span><span class="cx">     return m_isReadyForMoreSamples;
</span><span class="cx"> }
</span><span class="lines">@@ -135,7 +134,7 @@
</span><span class="cx">     ASSERT(WTF::isMainThread());
</span><span class="cx">     setReadyForMoreSamples(true);
</span><span class="cx">     if (m_notifyWhenReadyForMoreSamples)
</span><del>-        m_sourceBufferPrivateClient-&gt;sourceBufferPrivateDidBecomeReadyForMoreSamples(this, m_trackId);
</del><ins>+        m_sourceBufferPrivateClient-&gt;sourceBufferPrivateDidBecomeReadyForMoreSamples(m_trackId);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateGStreamer::setActive(bool isActive)
</span><span class="lines">@@ -144,12 +143,12 @@
</span><span class="cx">         m_mediaSource-&gt;sourceBufferPrivateDidChangeActiveState(this, isActive);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBufferPrivateGStreamer::stopAskingForMoreSamples(AtomicString)
</del><ins>+void SourceBufferPrivateGStreamer::stopAskingForMoreSamples(const AtomicString&amp;)
</ins><span class="cx"> {
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples(AtomicString trackId)
</del><ins>+void SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples(const AtomicString&amp; trackId)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(WTF::isMainThread());
</span><span class="cx">     m_notifyWhenReadyForMoreSamples = true;
</span><span class="lines">@@ -159,20 +158,19 @@
</span><span class="cx"> void SourceBufferPrivateGStreamer::didReceiveInitializationSegment(const SourceBufferPrivateClient::InitializationSegment&amp; initializationSegment)
</span><span class="cx"> {
</span><span class="cx">     if (m_sourceBufferPrivateClient)
</span><del>-        m_sourceBufferPrivateClient-&gt;sourceBufferPrivateDidReceiveInitializationSegment(this, initializationSegment);
</del><ins>+        m_sourceBufferPrivateClient-&gt;sourceBufferPrivateDidReceiveInitializationSegment(initializationSegment);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SourceBufferPrivateGStreamer::didReceiveSample(PassRefPtr&lt;MediaSample&gt; prpSample)
</del><ins>+void SourceBufferPrivateGStreamer::didReceiveSample(MediaSample&amp; sample)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;MediaSample&gt; protectedPrpSample = prpSample;
</del><span class="cx">     if (m_sourceBufferPrivateClient)
</span><del>-        m_sourceBufferPrivateClient-&gt;sourceBufferPrivateDidReceiveSample(this, *protectedPrpSample);
</del><ins>+        m_sourceBufferPrivateClient-&gt;sourceBufferPrivateDidReceiveSample(sample);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SourceBufferPrivateGStreamer::didReceiveAllPendingSamples()
</span><span class="cx"> {
</span><span class="cx">     if (m_sourceBufferPrivateClient)
</span><del>-        m_sourceBufferPrivateClient-&gt;sourceBufferPrivateAppendComplete(this, SourceBufferPrivateClient::AppendSucceeded);
</del><ins>+        m_sourceBufferPrivateClient-&gt;sourceBufferPrivateAppendComplete(SourceBufferPrivateClient::AppendSucceeded);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamermseSourceBufferPrivateGStreamerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -54,26 +54,26 @@
</span><span class="cx"> 
</span><span class="cx">     void clearMediaSource() { m_mediaSource = nullptr; }
</span><span class="cx"> 
</span><del>-    void setClient(SourceBufferPrivateClient*) override;
-    void append(const unsigned char*, unsigned) override;
-    void abort() override;
-    void resetParserState() override;
-    void removedFromMediaSource() override;
-    MediaPlayer::ReadyState readyState() const override;
-    void setReadyState(MediaPlayer::ReadyState) override;
</del><ins>+    void setClient(SourceBufferPrivateClient*) final;
+    void append(const unsigned char*, unsigned) final;
+    void abort() final;
+    void resetParserState() final;
+    void removedFromMediaSource() final;
+    MediaPlayer::ReadyState readyState() const final;
+    void setReadyState(MediaPlayer::ReadyState) final;
</ins><span class="cx"> 
</span><del>-    void flush(AtomicString) override;
-    void enqueueSample(PassRefPtr&lt;MediaSample&gt;, AtomicString) override;
-    bool isReadyForMoreSamples(AtomicString) override;
-    void setActive(bool) override;
-    void stopAskingForMoreSamples(AtomicString) override;
-    void notifyClientWhenReadyForMoreSamples(AtomicString) override;
</del><ins>+    void flush(const AtomicString&amp;) final;
+    void enqueueSample(Ref&lt;MediaSample&gt;&amp;&amp;, const AtomicString&amp;) final;
+    bool isReadyForMoreSamples(const AtomicString&amp;) final;
+    void setActive(bool) final;
+    void stopAskingForMoreSamples(const AtomicString&amp;) final;
+    void notifyClientWhenReadyForMoreSamples(const AtomicString&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     void setReadyForMoreSamples(bool);
</span><span class="cx">     void notifyReadyForMoreSamples();
</span><span class="cx"> 
</span><span class="cx">     void didReceiveInitializationSegment(const SourceBufferPrivateClient::InitializationSegment&amp;);
</span><del>-    void didReceiveSample(PassRefPtr&lt;MediaSample&gt;);
</del><ins>+    void didReceiveSample(MediaSample&amp;);
</ins><span class="cx">     void didReceiveAllPendingSamples();
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamAudioTrackPrivateMediaStreamh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/AudioTrackPrivateMediaStream.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/AudioTrackPrivateMediaStream.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/mediastream/AudioTrackPrivateMediaStream.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef AudioTrackPrivateMediaStream_h
-#define AudioTrackPrivateMediaStream_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK) &amp;&amp; ENABLE(MEDIA_STREAM)
</span><span class="cx"> 
</span><span class="lines">@@ -36,14 +35,11 @@
</span><span class="cx"> class AudioTrackPrivateMediaStream final : public AudioTrackPrivate {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(AudioTrackPrivateMediaStream)
</span><span class="cx"> public:
</span><del>-
</del><span class="cx">     static RefPtr&lt;AudioTrackPrivateMediaStream&gt; create(MediaStreamTrackPrivate&amp; streamTrack)
</span><span class="cx">     {
</span><span class="cx">         return adoptRef(*new AudioTrackPrivateMediaStream(streamTrack));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual ~AudioTrackPrivateMediaStream() { }
-
</del><span class="cx">     Kind kind() const override { return Kind::Main; }
</span><span class="cx">     AtomicString id() const override { return m_id; }
</span><span class="cx">     AtomicString label() const override { return m_label; }
</span><span class="lines">@@ -52,17 +48,17 @@
</span><span class="cx"> 
</span><span class="cx">     void setTrackIndex(int index) { m_index = index; }
</span><span class="cx"> 
</span><del>-    MediaStreamTrackPrivate* streamTrack() const { return m_streamTrack.get(); }
</del><ins>+    MediaStreamTrackPrivate&amp; streamTrack() { return m_streamTrack.get(); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     AudioTrackPrivateMediaStream(MediaStreamTrackPrivate&amp; track)
</span><del>-        : m_streamTrack(&amp;track)
</del><ins>+        : m_streamTrack(track)
</ins><span class="cx">         , m_id(track.id())
</span><span class="cx">         , m_label(track.label())
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;MediaStreamTrackPrivate&gt; m_streamTrack;
</del><ins>+    Ref&lt;MediaStreamTrackPrivate&gt; m_streamTrack;
</ins><span class="cx">     AtomicString m_id;
</span><span class="cx">     AtomicString m_label;
</span><span class="cx">     int m_index { 0 };
</span><span class="lines">@@ -71,5 +67,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(VIDEO_TRACK) &amp;&amp; ENABLE(MEDIA_STREAM)
</span><del>-
-#endif // AudioTrackPrivateMediaStream_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmediastreamVideoTrackPrivateMediaStreamh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mediastream/VideoTrackPrivateMediaStream.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mediastream/VideoTrackPrivateMediaStream.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/mediastream/VideoTrackPrivateMediaStream.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef VideoTrackPrivateMediaStream_h
-#define VideoTrackPrivateMediaStream_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK) &amp;&amp; ENABLE(MEDIA_STREAM)
</span><span class="cx"> 
</span><span class="lines">@@ -36,14 +35,11 @@
</span><span class="cx"> class VideoTrackPrivateMediaStream final : public VideoTrackPrivate {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(VideoTrackPrivateMediaStream)
</span><span class="cx"> public:
</span><del>-
</del><span class="cx">     static RefPtr&lt;VideoTrackPrivateMediaStream&gt; create(MediaStreamTrackPrivate&amp; streamTrack)
</span><span class="cx">     {
</span><span class="cx">         return adoptRef(*new VideoTrackPrivateMediaStream(streamTrack));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual ~VideoTrackPrivateMediaStream() { }
-
</del><span class="cx">     Kind kind() const override { return Kind::Main; }
</span><span class="cx">     AtomicString id() const override { return m_id; }
</span><span class="cx">     AtomicString label() const override { return m_label; }
</span><span class="lines">@@ -52,17 +48,17 @@
</span><span class="cx"> 
</span><span class="cx">     void setTrackIndex(int index) { m_index = index; }
</span><span class="cx"> 
</span><del>-    MediaStreamTrackPrivate* streamTrack() const { return m_streamTrack.get(); }
</del><ins>+    MediaStreamTrackPrivate&amp; streamTrack() { return m_streamTrack.get(); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     VideoTrackPrivateMediaStream(MediaStreamTrackPrivate&amp; track)
</span><del>-        : m_streamTrack(&amp;track)
</del><ins>+        : m_streamTrack(track)
</ins><span class="cx">         , m_id(track.id())
</span><span class="cx">         , m_label(track.label())
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;MediaStreamTrackPrivate&gt; m_streamTrack;
</del><ins>+    Ref&lt;MediaStreamTrackPrivate&gt; m_streamTrack;
</ins><span class="cx">     AtomicString m_id;
</span><span class="cx">     AtomicString m_label;
</span><span class="cx">     int m_index { 0 };
</span><span class="lines">@@ -71,5 +67,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(VIDEO_TRACK) &amp;&amp; ENABLE(MEDIA_STREAM)
</span><del>-
-#endif // VideoTrackPrivateMediaStream_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivatecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -38,7 +38,6 @@
</span><span class="cx"> #include &quot;SourceBufferPrivateClient.h&quot;
</span><span class="cx"> #include &lt;map&gt;
</span><span class="cx"> #include &lt;runtime/ArrayBuffer.h&gt;
</span><del>-#include &lt;wtf/PrintStream.h&gt;
</del><span class="cx"> #include &lt;wtf/StringPrintStream.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -165,7 +164,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;sourceBufferPrivateAppendComplete(this, result);
</del><ins>+        m_client-&gt;sourceBufferPrivateAppendComplete(result);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MockSourceBufferPrivate::didReceiveInitializationSegment(const MockInitializationBox&amp; initBox)
</span><span class="lines">@@ -196,7 +195,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_client-&gt;sourceBufferPrivateDidReceiveInitializationSegment(this, segment);
</del><ins>+    m_client-&gt;sourceBufferPrivateDidReceiveInitializationSegment(segment);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -205,7 +204,7 @@
</span><span class="cx">     if (!m_client)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_client-&gt;sourceBufferPrivateDidReceiveSample(this, MockMediaSample::create(sampleBox));
</del><ins>+    m_client-&gt;sourceBufferPrivateDidReceiveSample(MockMediaSample::create(sampleBox));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MockSourceBufferPrivate::abort()
</span><span class="lines">@@ -239,15 +238,14 @@
</span><span class="cx">         m_mediaSource-&gt;sourceBufferPrivateDidChangeActiveState(this, isActive);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;String&gt; MockSourceBufferPrivate::enqueuedSamplesForTrackID(AtomicString)
</del><ins>+Vector&lt;String&gt; MockSourceBufferPrivate::enqueuedSamplesForTrackID(const AtomicString&amp;)
</ins><span class="cx"> {
</span><span class="cx">     return m_enqueuedSamples;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MockSourceBufferPrivate::enqueueSample(PassRefPtr&lt;MediaSample&gt; prpSample, AtomicString)
</del><ins>+void MockSourceBufferPrivate::enqueueSample(Ref&lt;MediaSample&gt;&amp;&amp; sample, const AtomicString&amp;)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;MediaSample&gt; sample = prpSample;
-    if (!m_mediaSource || !sample)
</del><ins>+    if (!m_mediaSource)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     PlatformSample platformSample = sample-&gt;platformSample();
</span><span class="lines">@@ -254,7 +252,7 @@
</span><span class="cx">     if (platformSample.type != PlatformSample::MockSampleBoxType)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    MockSampleBox* box = platformSample.sample.mockSampleBox;
</del><ins>+    auto* box = platformSample.sample.mockSampleBox;
</ins><span class="cx">     if (!box)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -266,30 +264,23 @@
</span><span class="cx">     if (box-&gt;isDelayed())
</span><span class="cx">         m_mediaSource-&gt;incrementTotalFrameDelayBy(MediaTime(1, 1));
</span><span class="cx"> 
</span><del>-    m_enqueuedSamples.append(toString(sample));
</del><ins>+    m_enqueuedSamples.append(toString(sample.get()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MockSourceBufferPrivate::hasVideo() const
</span><span class="cx"> {
</span><del>-    if (!m_client)
-        return false;
-
-    return m_client-&gt;sourceBufferPrivateHasVideo(this);
</del><ins>+    return m_client &amp;&amp; m_client-&gt;sourceBufferPrivateHasVideo();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool MockSourceBufferPrivate::hasAudio() const
</span><span class="cx"> {
</span><del>-    if (!m_client)
-        return false;
-
-    return m_client-&gt;sourceBufferPrivateHasAudio(this);
</del><ins>+    return m_client &amp;&amp; m_client-&gt;sourceBufferPrivateHasAudio();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> MediaTime MockSourceBufferPrivate::fastSeekTimeForMediaTime(const MediaTime&amp; time, const MediaTime&amp; negativeThreshold, const MediaTime&amp; positiveThreshold)
</span><span class="cx"> {
</span><span class="cx">     if (m_client)
</span><del>-        return m_client-&gt;sourceBufferPrivateFastSeekTimeForMediaTime(this, time, negativeThreshold, positiveThreshold);
</del><ins>+        return m_client-&gt;sourceBufferPrivateFastSeekTimeForMediaTime(time, negativeThreshold, positiveThreshold);
</ins><span class="cx">     return time;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -296,7 +287,7 @@
</span><span class="cx"> void MockSourceBufferPrivate::seekToTime(const MediaTime&amp; time)
</span><span class="cx"> {
</span><span class="cx">     if (m_client)
</span><del>-        m_client-&gt;sourceBufferPrivateSeekToTime(this, time);
</del><ins>+        m_client-&gt;sourceBufferPrivateSeekToTime(time);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockSourceBufferPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,15 +23,11 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef MockSourceBufferPrivate_h
-#define MockSourceBufferPrivate_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;SourceBufferPrivate.h&quot;
</span><del>-#include &lt;wtf/MediaTime.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/Vector.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -43,7 +39,7 @@
</span><span class="cx"> class TimeRanges;
</span><span class="cx"> class VideoTrackPrivate;
</span><span class="cx"> 
</span><del>-class MockSourceBufferPrivate : public SourceBufferPrivate {
</del><ins>+class MockSourceBufferPrivate final : public SourceBufferPrivate {
</ins><span class="cx"> public:
</span><span class="cx">     static RefPtr&lt;MockSourceBufferPrivate&gt; create(MockMediaSourcePrivate*);
</span><span class="cx">     virtual ~MockSourceBufferPrivate();
</span><span class="lines">@@ -60,20 +56,20 @@
</span><span class="cx">     explicit MockSourceBufferPrivate(MockMediaSourcePrivate*);
</span><span class="cx"> 
</span><span class="cx">     // SourceBufferPrivate overrides
</span><del>-    void setClient(SourceBufferPrivateClient*) override;
-    void append(const unsigned char* data, unsigned length) override;
-    void abort() override;
-    void resetParserState() override;
-    void removedFromMediaSource() override;
-    MediaPlayer::ReadyState readyState() const override;
-    void setReadyState(MediaPlayer::ReadyState) override;
</del><ins>+    void setClient(SourceBufferPrivateClient*) final;
+    void append(const unsigned char* data, unsigned length) final;
+    void abort() final;
+    void resetParserState() final;
+    void removedFromMediaSource() final;
+    MediaPlayer::ReadyState readyState() const final;
+    void setReadyState(MediaPlayer::ReadyState) final;
</ins><span class="cx"> 
</span><del>-    void flush(AtomicString) override { m_enqueuedSamples.clear(); }
-    void enqueueSample(PassRefPtr&lt;MediaSample&gt;, AtomicString) override;
-    bool isReadyForMoreSamples(AtomicString) override { return true; }
-    void setActive(bool) override;
</del><ins>+    void flush(const AtomicString&amp;) final { m_enqueuedSamples.clear(); }
+    void enqueueSample(Ref&lt;MediaSample&gt;&amp;&amp;, const AtomicString&amp;) final;
+    bool isReadyForMoreSamples(const AtomicString&amp;) final { return true; }
+    void setActive(bool) final;
</ins><span class="cx"> 
</span><del>-    Vector&lt;String&gt; enqueuedSamplesForTrackID(AtomicString) override;
</del><ins>+    Vector&lt;String&gt; enqueuedSamplesForTrackID(const AtomicString&amp;) final;
</ins><span class="cx"> 
</span><span class="cx">     void didReceiveInitializationSegment(const MockInitializationBox&amp;);
</span><span class="cx">     void didReceiveSample(const MockSampleBox&amp;);
</span><span class="lines">@@ -88,6 +84,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(MEDIA_SOURCE) &amp;&amp; USE(AVFOUNDATION)
</span><del>-
-#endif
-
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockTracksh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockTracks.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockTracks.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockTracks.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -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 MockTracks_h
-#define MockTracks_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">@@ -37,7 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> class MockAudioTrackPrivate : public AudioTrackPrivate {
</span><span class="cx"> public:
</span><del>-    static RefPtr&lt;MockAudioTrackPrivate&gt; create(const MockTrackBox&amp; box) { return adoptRef(new MockAudioTrackPrivate(box)); }
</del><ins>+    static Ref&lt;MockAudioTrackPrivate&gt; create(const MockTrackBox&amp; box) { return adoptRef(*new MockAudioTrackPrivate(box)); }
</ins><span class="cx">     virtual ~MockAudioTrackPrivate() { }
</span><span class="cx"> 
</span><span class="cx">     virtual AtomicString id() const { return m_id; }
</span><span class="lines">@@ -45,7 +44,7 @@
</span><span class="cx"> protected:
</span><span class="cx">     MockAudioTrackPrivate(const MockTrackBox&amp; box)
</span><span class="cx">         : m_box(box)
</span><del>-        , m_id(String::format(&quot;%d&quot;, box.trackID()))
</del><ins>+        , m_id(AtomicString::number(box.trackID()))
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     MockTrackBox m_box;
</span><span class="lines">@@ -63,7 +62,7 @@
</span><span class="cx">     MockTextTrackPrivate(const MockTrackBox&amp; box)
</span><span class="cx">         : InbandTextTrackPrivate(InbandTextTrackPrivate::Generic)
</span><span class="cx">         , m_box(box)
</span><del>-        , m_id(String::format(&quot;%d&quot;, box.trackID()))
</del><ins>+        , m_id(AtomicString::number(box.trackID()))
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     MockTrackBox m_box;
</span><span class="lines">@@ -81,7 +80,7 @@
</span><span class="cx"> protected:
</span><span class="cx">     MockVideoTrackPrivate(const MockTrackBox&amp; box)
</span><span class="cx">         : m_box(box)
</span><del>-        , m_id(String::format(&quot;%d&quot;, box.trackID()))
</del><ins>+        , m_id(AtomicString::number(box.trackID()))
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx">     MockTrackBox m_box;
</span><span class="lines">@@ -91,5 +90,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderSnapshottedPlugIncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> #include &quot;PaintInfo.h&quot;
</span><span class="cx"> #include &quot;Path.h&quot;
</span><span class="cx"> #include &quot;PlatformMouseEvent.h&quot;
</span><ins>+#include &quot;RenderImageResource.h&quot;
</ins><span class="cx"> #include &quot;RenderIterator.h&quot;
</span><span class="cx"> #include &quot;RenderView.h&quot;
</span><span class="cx"> #include &lt;wtf/StackStats.h&gt;
</span><span class="lines">@@ -52,7 +53,6 @@
</span><span class="cx"> RenderSnapshottedPlugIn::RenderSnapshottedPlugIn(HTMLPlugInImageElement&amp; element, RenderStyle&amp;&amp; style)
</span><span class="cx">     : RenderEmbeddedObject(element, WTFMove(style))
</span><span class="cx">     , m_snapshotResource(std::make_unique&lt;RenderImageResource&gt;())
</span><del>-    , m_isPotentialMouseActivation(false)
</del><span class="cx"> {
</span><span class="cx">     m_snapshotResource-&gt;initialize(this);
</span><span class="cx"> }
</span><span class="lines">@@ -82,13 +82,13 @@
</span><span class="cx">     view().frameView().addEmbeddedObjectToUpdate(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderSnapshottedPlugIn::updateSnapshot(PassRefPtr&lt;Image&gt; image)
</del><ins>+void RenderSnapshottedPlugIn::updateSnapshot(Image* image)
</ins><span class="cx"> {
</span><span class="cx">     // Zero-size plugins will have no image.
</span><span class="cx">     if (!image)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_snapshotResource-&gt;setCachedImage(new CachedImage(image.get(), view().frameView().frame().page()-&gt;sessionID()));
</del><ins>+    m_snapshotResource-&gt;setCachedImage(new CachedImage(image, view().frameView().frame().page()-&gt;sessionID()));
</ins><span class="cx">     repaint();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -150,12 +150,12 @@
</span><span class="cx">     return RenderEmbeddedObject::getCursor(point, overrideCursor);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderSnapshottedPlugIn::handleEvent(Event* event)
</del><ins>+void RenderSnapshottedPlugIn::handleEvent(Event&amp; event)
</ins><span class="cx"> {
</span><del>-    if (!is&lt;MouseEvent&gt;(*event))
</del><ins>+    if (!is&lt;MouseEvent&gt;(event))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    MouseEvent&amp; mouseEvent = downcast&lt;MouseEvent&gt;(*event);
</del><ins>+    auto&amp; mouseEvent = downcast&lt;MouseEvent&gt;(event);
</ins><span class="cx"> 
</span><span class="cx">     // If we're a snapshotted plugin, we want to make sure we activate on
</span><span class="cx">     // clicks even if the page is preventing our default behaviour. Otherwise
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderSnapshottedPlugInh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderSnapshottedPlugIn.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderSnapshottedPlugIn.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/rendering/RenderSnapshottedPlugIn.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,12 +26,11 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include &quot;RenderEmbeddedObject.h&quot;
</span><del>-#include &quot;RenderImageResource.h&quot;
-#include &quot;Timer.h&quot;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class HTMLPlugInImageElement;
</span><ins>+class RenderImageResource;
</ins><span class="cx"> 
</span><span class="cx"> class RenderSnapshottedPlugIn final : public RenderEmbeddedObject {
</span><span class="cx"> public:
</span><span class="lines">@@ -39,27 +38,21 @@
</span><span class="cx">     virtual ~RenderSnapshottedPlugIn();
</span><span class="cx"> 
</span><span class="cx">     HTMLPlugInImageElement&amp; plugInImageElement() const;
</span><ins>+    void updateSnapshot(Image*);
+    void handleEvent(Event&amp;);
</ins><span class="cx"> 
</span><del>-    void updateSnapshot(PassRefPtr&lt;Image&gt;);
-
-    void handleEvent(Event*);
-
</del><span class="cx"> private:
</span><span class="cx">     void frameOwnerElement() const = delete;
</span><del>-    const char* renderName() const override { return &quot;RenderSnapshottedPlugIn&quot;; }
-
-    CursorDirective getCursor(const LayoutPoint&amp;, Cursor&amp;) const override;
-    bool isSnapshottedPlugIn() const override { return true; }
-    void paint(PaintInfo&amp;, const LayoutPoint&amp;) override;
-    
-    bool canHaveWidget() const override { return false; }
-
</del><ins>+    const char* renderName() const final { return &quot;RenderSnapshottedPlugIn&quot;; }
+    CursorDirective getCursor(const LayoutPoint&amp;, Cursor&amp;) const final;
+    bool isSnapshottedPlugIn() const final { return true; }
+    void paint(PaintInfo&amp;, const LayoutPoint&amp;) final;
+    bool canHaveWidget() const final { return false; }
</ins><span class="cx">     void paintSnapshot(PaintInfo&amp;, const LayoutPoint&amp;);
</span><ins>+    void layout() final;
</ins><span class="cx"> 
</span><del>-    void layout() override;
-
</del><span class="cx">     std::unique_ptr&lt;RenderImageResource&gt; m_snapshotResource;
</span><del>-    bool m_isPotentialMouseActivation;
</del><ins>+    bool m_isPotentialMouseActivation { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGScriptElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGScriptElement.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGScriptElement.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/svg/SVGScriptElement.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann &lt;zimmermann@kde.org&gt;
</span><span class="cx">  * Copyright (C) 2004, 2005, 2007 Rob Buis &lt;buis@kde.org&gt;
</span><ins>+ * Copyright (C) 2008-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -29,13 +30,13 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class SVGScriptElement final : public SVGElement
-                             , public SVGURIReference
-                             , public SVGExternalResourcesRequired
-                             , public ScriptElement {
</del><ins>+class SVGScriptElement final : public SVGElement, public SVGURIReference, public SVGExternalResourcesRequired, public ScriptElement {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;SVGScriptElement&gt; create(const QualifiedName&amp;, Document&amp;, bool wasInsertedByParser);
</span><span class="cx"> 
</span><ins>+    using SVGElement::ref;
+    using SVGElement::deref;
+
</ins><span class="cx"> private:
</span><span class="cx">     SVGScriptElement(const QualifiedName&amp;, Document&amp;, bool wasInsertedByParser, bool alreadyStarted);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2000 Peter Kelly (pmk@post.com)
</span><del>- * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
</span><span class="cx">  * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
</span><span class="cx">  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="lines">@@ -237,8 +237,7 @@
</span><span class="cx">     m_pendingScript = nullptr;
</span><span class="cx">     pendingScript.clearClient();
</span><span class="cx"> 
</span><del>-    auto&amp; scriptElement = *toScriptElementIfPossible(&amp;pendingScript.element());
-    scriptElement.executePendingScript(pendingScript);
</del><ins>+    pendingScript.element().executePendingScript(pendingScript);
</ins><span class="cx"> 
</span><span class="cx">     if (!isDetached() &amp;&amp; !m_requestingScript)
</span><span class="cx">         resumeParsing();
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2000 Peter Kelly &lt;pmk@post.com&gt;
</span><del>- * Copyright (C) 2005-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2006 Alexey Proskuryakov &lt;ap@webkit.org&gt;
</span><span class="cx">  * Copyright (C) 2007 Samuel Weinig &lt;sam@webkit.org&gt;
</span><span class="cx">  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="lines">@@ -799,8 +799,7 @@
</span><span class="cx"> 
</span><span class="cx">     newElement-&gt;beginParsingChildren();
</span><span class="cx"> 
</span><del>-    ScriptElement* scriptElement = toScriptElementIfPossible(newElement.ptr());
-    if (scriptElement)
</del><ins>+    if (isScriptElement(newElement.get()))
</ins><span class="cx">         m_scriptStartPosition = textPosition();
</span><span class="cx"> 
</span><span class="cx">     m_currentNode-&gt;parserAppendChild(newElement);
</span><span class="lines">@@ -843,7 +842,7 @@
</span><span class="cx">     if (hackAroundLibXMLEntityParsingBug() &amp;&amp; context()-&gt;depth &lt;= depthTriggeringEntityExpansion())
</span><span class="cx">         setDepthTriggeringEntityExpansion(-1);
</span><span class="cx"> 
</span><del>-    if (!scriptingContentIsAllowed(parserContentPolicy()) &amp;&amp; is&lt;Element&gt;(*node) &amp;&amp; toScriptElementIfPossible(downcast&lt;Element&gt;(node.get()))) {
</del><ins>+    if (!scriptingContentIsAllowed(parserContentPolicy()) &amp;&amp; is&lt;Element&gt;(*node) &amp;&amp; isScriptElement(downcast&lt;Element&gt;(*node))) {
</ins><span class="cx">         popCurrentNode();
</span><span class="cx">         node-&gt;remove();
</span><span class="cx">         return;
</span><span class="lines">@@ -854,7 +853,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Element&amp; element = downcast&lt;Element&gt;(*node);
</del><ins>+    auto&amp; element = downcast&lt;Element&gt;(*node);
</ins><span class="cx"> 
</span><span class="cx">     // The element's parent may have already been removed from document.
</span><span class="cx">     // Parsing continues in this case, but scripts aren't executed.
</span><span class="lines">@@ -863,8 +862,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ScriptElement* scriptElement = toScriptElementIfPossible(&amp;element);
-    if (!scriptElement) {
</del><ins>+    if (!isScriptElement(element)) {
</ins><span class="cx">         popCurrentNode();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -873,15 +871,16 @@
</span><span class="cx">     ASSERT(!m_pendingScript);
</span><span class="cx">     m_requestingScript = true;
</span><span class="cx"> 
</span><del>-    if (scriptElement-&gt;prepareScript(m_scriptStartPosition, ScriptElement::AllowLegacyTypeInTypeAttribute)) {
</del><ins>+    auto&amp; scriptElement = downcastScriptElement(element);
+    if (scriptElement.prepareScript(m_scriptStartPosition, ScriptElement::AllowLegacyTypeInTypeAttribute)) {
</ins><span class="cx">         // FIXME: Script execution should be shared between
</span><span class="cx">         // the libxml2 and Qt XMLDocumentParser implementations.
</span><span class="cx"> 
</span><del>-        if (scriptElement-&gt;readyToBeParserExecuted())
-            scriptElement-&gt;executeClassicScript(ScriptSourceCode(scriptElement-&gt;scriptContent(), document()-&gt;url(), m_scriptStartPosition));
-        else if (scriptElement-&gt;willBeParserExecuted() &amp;&amp; scriptElement-&gt;loadableScript()) {
-            m_pendingScript = PendingScript::create(element, *scriptElement-&gt;loadableScript());
-            m_pendingScript-&gt;setClient(this);
</del><ins>+        if (scriptElement.readyToBeParserExecuted())
+            scriptElement.executeClassicScript(ScriptSourceCode(scriptElement.scriptContent(), document()-&gt;url(), m_scriptStartPosition));
+        else if (scriptElement.willBeParserExecuted() &amp;&amp; scriptElement.loadableScript()) {
+            m_pendingScript = PendingScript::create(scriptElement, *scriptElement.loadableScript());
+            m_pendingScript-&gt;setClient(*this);
</ins><span class="cx"> 
</span><span class="cx">             // m_pendingScript will be nullptr if script was already loaded and setClient() executed it.
</span><span class="cx">             if (m_pendingScript)
</span><span class="lines">@@ -896,19 +895,19 @@
</span><span class="cx">     popCurrentNode();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void XMLDocumentParser::characters(const xmlChar* s, int len)
</del><ins>+void XMLDocumentParser::characters(const xmlChar* characters, int length)
</ins><span class="cx"> {
</span><span class="cx">     if (isStopped())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (m_parserPaused) {
</span><del>-        m_pendingCallbacks-&gt;appendCharactersCallback(s, len);
</del><ins>+        m_pendingCallbacks-&gt;appendCharactersCallback(characters, length);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!m_leafTextNode)
</span><span class="cx">         createLeafTextNode();
</span><del>-    m_bufferedText.append(s, len);
</del><ins>+    m_bufferedText.append(characters, length);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void XMLDocumentParser::error(XMLErrors::ErrorType type, const char* message, va_list args)
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebKit/mac/ChangeLog        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-01-04  Darin Adler  &lt;darin@apple.com&gt;
+
+        Remove PassRefPtr use from the &quot;html&quot; directory, other improvements
+        https://bugs.webkit.org/show_bug.cgi?id=166635
+
+        Reviewed by Alex Christensen.
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::loadIconForFiles): Take a reference instead of a pointer.
+
</ins><span class="cx"> 2017-01-04  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r210287.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -31,12 +31,6 @@
</span><span class="cx"> #import &lt;WebCore/FocusDirection.h&gt;
</span><span class="cx"> #import &lt;wtf/Forward.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-#import &lt;wtf/Platform.h&gt;
-#import &lt;wtf/text/WTFString.h&gt;
-#import &lt;WebCore/Chrome.h&gt;
-#endif
-
</del><span class="cx"> @class WebView;
</span><span class="cx"> 
</span><span class="cx"> class WebChromeClient : public WebCore::ChromeClient {
</span><span class="lines">@@ -125,7 +119,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void runOpenPanel(WebCore::Frame*, PassRefPtr&lt;WebCore::FileChooser&gt;) override;
</span><del>-    void loadIconForFiles(const Vector&lt;WTF::String&gt;&amp;, WebCore::FileIconLoader*) override;
</del><ins>+    void loadIconForFiles(const Vector&lt;WTF::String&gt;&amp;, WebCore::FileIconLoader&amp;) override;
</ins><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     void setCursor(const WebCore::Cursor&amp;) override;
</span><span class="lines">@@ -214,11 +208,7 @@
</span><span class="cx">     bool hasRelevantSelectionServices(bool isTextOnly) const override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">     WebView* webView() const { return m_webView; }
</span><del>-#else
-    WebView* webView() { return m_webView; }
-#endif
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
</span><span class="cx">     void addPlaybackTargetPickerClient(uint64_t /*contextId*/) override;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebChromeClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -757,9 +757,9 @@
</span><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebChromeClient::loadIconForFiles(const Vector&lt;String&gt;&amp; filenames, FileIconLoader* iconLoader)
</del><ins>+void WebChromeClient::loadIconForFiles(const Vector&lt;String&gt;&amp; filenames, FileIconLoader&amp; iconLoader)
</ins><span class="cx"> {
</span><del>-    iconLoader-&gt;notifyFinished(Icon::createIconForFiles(filenames));
</del><ins>+    iconLoader.iconLoaded(Icon::createIconForFiles(filenames));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebKit/win/ChangeLog        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-01-04  Darin Adler  &lt;darin@apple.com&gt;
+
+        Remove PassRefPtr use from the &quot;html&quot; directory, other improvements
+        https://bugs.webkit.org/show_bug.cgi?id=166635
+
+        Reviewed by Alex Christensen.
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::loadIconForFiles): Take a reference instead of a pointer.
+        * WebCoreSupport/WebChromeClient.h: Updated for the above.
+
</ins><span class="cx"> 2016-12-30  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove PassRefPtr use from the &quot;dom&quot; directory, related cleanup
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006-2008, 2013, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -680,9 +680,9 @@
</span><span class="cx">     // FIXME: Show some sort of error if too many files are selected and the buffer is too small.  For now, this will fail silently.
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebChromeClient::loadIconForFiles(const Vector&lt;WTF::String&gt;&amp; filenames, WebCore::FileIconLoader* loader)
</del><ins>+void WebChromeClient::loadIconForFiles(const Vector&lt;WTF::String&gt;&amp; filenames, WebCore::FileIconLoader&amp; loader)
</ins><span class="cx"> {
</span><del>-    loader-&gt;notifyFinished(Icon::createIconForFiles(filenames));
</del><ins>+    loader.iconLoaded(Icon::createIconForFiles(filenames));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebChromeClient::setCursor(const Cursor&amp; cursor)
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006-2009, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx">     virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t totalSpaceNeeded);
</span><span class="cx"> 
</span><span class="cx">     virtual void runOpenPanel(WebCore::Frame*, PassRefPtr&lt;WebCore::FileChooser&gt;);
</span><del>-    virtual void loadIconForFiles(const Vector&lt;WTF::String&gt;&amp;, WebCore::FileIconLoader*);
</del><ins>+    virtual void loadIconForFiles(const Vector&lt;WTF::String&gt;&amp;, WebCore::FileIconLoader&amp;);
</ins><span class="cx"> 
</span><span class="cx">     virtual void setCursor(const WebCore::Cursor&amp;);
</span><span class="cx">     virtual void setCursorHiddenUntilMouseMoves(bool);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebKit2/ChangeLog        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-01-04  Darin Adler  &lt;darin@apple.com&gt;
+
+        Remove PassRefPtr use from the &quot;html&quot; directory, other improvements
+        https://bugs.webkit.org/show_bug.cgi?id=166635
+
+        Reviewed by Alex Christensen.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::loadIconForFiles): Take a reference instead of a pointer.
+        * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
+
</ins><span class="cx"> 2017-01-04  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove runtime flag for variation fonts
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -761,9 +761,9 @@
</span><span class="cx">     m_page-&gt;send(Messages::WebPageProxy::RunOpenPanel(webFrame-&gt;frameID(), SecurityOriginData::fromFrame(frame), fileChooser-&gt;settings()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebChromeClient::loadIconForFiles(const Vector&lt;String&gt;&amp; filenames, FileIconLoader* loader)
</del><ins>+void WebChromeClient::loadIconForFiles(const Vector&lt;String&gt;&amp; filenames, FileIconLoader&amp; loader)
</ins><span class="cx"> {
</span><del>-    loader-&gt;notifyFinished(Icon::createIconForFiles(filenames));
</del><ins>+    loader.iconLoaded(Icon::createIconForFiles(filenames));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (210318 => 210319)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2017-01-05 05:09:04 UTC (rev 210318)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2017-01-05 06:45:48 UTC (rev 210319)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2011, 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void runOpenPanel(WebCore::Frame*, PassRefPtr&lt;WebCore::FileChooser&gt;) override;
</span><del>-    void loadIconForFiles(const Vector&lt;String&gt;&amp;, WebCore::FileIconLoader*) override;
</del><ins>+    void loadIconForFiles(const Vector&lt;String&gt;&amp;, WebCore::FileIconLoader&amp;) override;
</ins><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     void setCursor(const WebCore::Cursor&amp;) override;
</span></span></pre>
</div>
</div>

</body>
</html>