<!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>[200934] 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/200934">200934</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-05-15 16:30:11 -0700 (Sun, 15 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use more references in JS wrappers related code
https://bugs.webkit.org/show_bug.cgi?id=157721

Reviewed by Darin Adler.

Source/WebCore:

- Use more references in JS wrappers related code.
- Avoid some refcounting churn when using toJSNewlyCreated() and in
  HTML/SVG elements factories by moving the Ref&lt;&gt; around.
- Add toJS() / toJSNewlyCreated() implementations for Text, XMLDocument
  and HTMLDocument. Now that toJSNewlyCreated() takes a Ref&lt;&gt;&amp;&amp; /
  RefPtr&lt;&gt;&amp;&amp; in, the compiler is no longer able to implicitly use the
  toJSNewlyCreated() implementation of a parent class for a subclass
  type (complains about calls being ambiguous). I thought about updating
  the bindings generator to always generate a toJSNewlyCreated() for
  all wrapper types (that would call the one on the parent class if the
  subclass does not have a proper implementation). However this would
  add some complexity to the bindings generator and it did not seem
  worth it because [NewObject] and therefore toJSNewlyCreated() is only
  used for a very limited set of subtypes. I have therefore decided to
  add the toJS() / toJSNewlyCreated() implementations for the subtypes
  in question. This also has the benefit of avoiding calling the more
  complex implementations on Node / Document.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSAnimationTimelineCustom.cpp:
(WebCore::toJS):
* bindings/js/JSAudioContextCustom.cpp:
(WebCore::constructJSAudioContext):
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSCSSRuleCustom.cpp:
(WebCore::toJS):
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::toJS):
* bindings/js/JSDOMBinding.h:
(WebCore::getCachedWrapper):
(WebCore::createWrapper):
(WebCore::wrap):
(WebCore::getExistingWrapper):
(WebCore::createNewWrapper):
(WebCore::toJS):
(WebCore::finiteInt32Value): Deleted.
* bindings/js/JSDocumentCustom.cpp:
(WebCore::createNewDocumentWrapper):
(WebCore::toJS):
(WebCore::cachedDocumentWrapper):
(WebCore::reportMemoryForFramelessDocument):
(WebCore::toJSNewlyCreated):
* bindings/js/JSDocumentCustom.h:
* bindings/js/JSDocumentFragmentCustom.cpp:
(WebCore::createNewDocumentFragmentWrapper):
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSElementCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/JSElementCustom.h:
(WebCore::toJSNewlyCreated):
* bindings/js/JSEventCustom.cpp:
(WebCore::createNewEventWrapper):
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::toJS):
* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::createNewHTMLDocumentWrapper):
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* bindings/js/JSHTMLTemplateElementCustom.cpp:
(WebCore::JSHTMLTemplateElement::content):
* bindings/js/JSImageDataCustom.cpp:
(WebCore::toJS):
* bindings/js/JSNodeCustom.cpp:
(WebCore::createWrapperInline):
(WebCore::createWrapper):
(WebCore::toJSNewlyCreated):
(WebCore::getOutOfLineCachedWrapper):
* bindings/js/JSNodeCustom.h:
(WebCore::toJS):
* bindings/js/JSNodeListCustom.cpp:
(WebCore::createWrapper):
(WebCore::toJSNewlyCreated):
* bindings/js/JSNodeListCustom.h:
(WebCore::toJS):
* bindings/js/JSRTCPeerConnectionCustom.cpp:
(WebCore::constructJSRTCPeerConnection):
* bindings/js/JSRTCSessionDescriptionCustom.cpp:
(WebCore::constructJSRTCSessionDescription):
* bindings/js/JSSVGPathSegCustom.cpp:
(WebCore::toJS):
* bindings/js/JSStyleSheetCustom.cpp:
(WebCore::toJS):
* bindings/js/JSTextCustom.cpp: Copied from Source/WebCore/dom/XMLDocument.idl.
(WebCore::createNewTextWrapper):
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* bindings/js/JSTextTrackCueCustom.cpp:
(WebCore::toJS):
* bindings/js/JSTrackCustom.cpp:
(WebCore::toJS):
* bindings/js/JSXMLDocumentCustom.cpp: Copied from Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp.
(WebCore::createNewXMLDocumentWrapper):
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/test/JS/*: Rebaseline bindings tests.
* dom/Element.cpp:
(WebCore::Element::setInnerHTML):
* dom/Text.idl:
* dom/XMLDocument.idl:
* dom/make_names.pl:
(printWrapperFunctions):
(printWrapperFactoryCppFile):
(printWrapperFactoryHeaderFile):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
* html/HTMLDocument.idl:
* html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::content):
(WebCore::HTMLTemplateElement::cloneNodeInternal):
* html/HTMLTemplateElement.h:
* html/parser/HTMLConstructionSite.cpp:
(WebCore::insert):
(WebCore::HTMLConstructionSite::insertTextNode):
(WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::startElementNs):

Source/WTF:

Add new static_reference_cast() overload that takes a Ref&lt;U&gt;&amp;&amp; in
in order to downcast Ref&lt;&gt; types without causing ref-counting
churn.

* wtf/Ref.h:
(WTF::static_reference_cast):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfRefh">trunk/Source/WTF/wtf/Ref.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="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSAnimationTimelineCustomcpp">trunk/Source/WebCore/bindings/js/JSAnimationTimelineCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSAudioContextCustomcpp">trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp">trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBlobCustomcpp">trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCSSRuleCustomcpp">trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCSSValueCustomcpp">trunk/Source/WebCore/bindings/js/JSCSSValueCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentCustomh">trunk/Source/WebCore/bindings/js/JSDocumentCustom.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentFragmentCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSElementCustomcpp">trunk/Source/WebCore/bindings/js/JSElementCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSElementCustomh">trunk/Source/WebCore/bindings/js/JSElementCustom.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSEventCustomcpp">trunk/Source/WebCore/bindings/js/JSEventCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSFileCustomcpp">trunk/Source/WebCore/bindings/js/JSFileCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLCollectionCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLDocumentCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLTemplateElementCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLTemplateElementCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSImageDataCustomcpp">trunk/Source/WebCore/bindings/js/JSImageDataCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeCustomcpp">trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeCustomh">trunk/Source/WebCore/bindings/js/JSNodeCustom.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeListCustomcpp">trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeListCustomh">trunk/Source/WebCore/bindings/js/JSNodeListCustom.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSRTCPeerConnectionCustomcpp">trunk/Source/WebCore/bindings/js/JSRTCPeerConnectionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSRTCSessionDescriptionCustomcpp">trunk/Source/WebCore/bindings/js/JSRTCSessionDescriptionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSSVGPathSegCustomcpp">trunk/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSStyleSheetCustomcpp">trunk/Source/WebCore/bindings/js/JSStyleSheetCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSTextTrackCueCustomcpp">trunk/Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSTrackCustomcpp">trunk/Source/WebCore/bindings/js/JSTrackCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjecth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestClassWithJSBuiltinConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestClassWithJSBuiltinConstructorh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjecth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGettercpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGetterh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargeth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestExceptioncpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestExceptionh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGenerateIsReachablecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGenerateIsReachableh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjecth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfaceh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestMediaQueryListListenercpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestMediaQueryListListenerh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministich">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinsh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfaceh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefsh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSattributecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSattributeh">trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSreadonlycpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSreadonlyh">trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementidl">trunk/Source/WebCore/dom/Element.idl</a></li>
<li><a href="#trunkSourceWebCoredomTextidl">trunk/Source/WebCore/dom/Text.idl</a></li>
<li><a href="#trunkSourceWebCoredomXMLDocumentidl">trunk/Source/WebCore/dom/XMLDocument.idl</a></li>
<li><a href="#trunkSourceWebCoredommake_namespl">trunk/Source/WebCore/dom/make_names.pl</a></li>
<li><a href="#trunkSourceWebCoreeditingMarkupAccumulatorcpp">trunk/Source/WebCore/editing/MarkupAccumulator.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLDocumentidl">trunk/Source/WebCore/html/HTMLDocument.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTemplateElementcpp">trunk/Source/WebCore/html/HTMLTemplateElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTemplateElementh">trunk/Source/WebCore/html/HTMLTemplateElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLConstructionSitecpp">trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDOMAgentcpp">trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp">trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsJSTextCustomcpp">trunk/Source/WebCore/bindings/js/JSTextCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSXMLDocumentCustomcpp">trunk/Source/WebCore/bindings/js/JSXMLDocumentCustom.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WTF/ChangeLog        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-05-15  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use more references in JS wrappers related code
+        https://bugs.webkit.org/show_bug.cgi?id=157721
+
+        Reviewed by Darin Adler.
+
+        Add new static_reference_cast() overload that takes a Ref&lt;U&gt;&amp;&amp; in
+        in order to downcast Ref&lt;&gt; types without causing ref-counting
+        churn.
+
+        * wtf/Ref.h:
+        (WTF::static_reference_cast):
+
</ins><span class="cx"> 2016-05-13  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r200837.
</span></span></pre></div>
<a id="trunkSourceWTFwtfRefh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Ref.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Ref.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WTF/wtf/Ref.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -167,6 +167,11 @@
</span><span class="cx">     return Ref&lt;T&gt;(static_cast&lt;T&amp;&gt;(reference.get()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename T, typename U&gt; inline Ref&lt;T&gt; static_reference_cast(Ref&lt;U&gt;&amp;&amp; reference)
+{
+    return adoptRef(static_cast&lt;T&amp;&gt;(reference.leakRef()));
+}
+
</ins><span class="cx"> template&lt;typename T, typename U&gt; inline Ref&lt;T&gt; static_reference_cast(const Ref&lt;U&gt;&amp; reference)
</span><span class="cx"> {
</span><span class="cx">     return Ref&lt;T&gt;(static_cast&lt;T&amp;&gt;(reference.copyRef().get()));
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -1206,6 +1206,7 @@
</span><span class="cx">     bindings/js/JSStyleSheetCustom.cpp
</span><span class="cx">     bindings/js/JSStyleSheetListCustom.cpp
</span><span class="cx">     bindings/js/JSSubtleCryptoCustom.cpp
</span><ins>+    bindings/js/JSTextCustom.cpp
</ins><span class="cx">     bindings/js/JSTextTrackCueCustom.cpp
</span><span class="cx">     bindings/js/JSTextTrackCustom.cpp
</span><span class="cx">     bindings/js/JSTextTrackListCustom.cpp
</span><span class="lines">@@ -1221,6 +1222,7 @@
</span><span class="cx">     bindings/js/JSWorkerCustom.cpp
</span><span class="cx">     bindings/js/JSWorkerGlobalScopeBase.cpp
</span><span class="cx">     bindings/js/JSWorkerGlobalScopeCustom.cpp
</span><ins>+    bindings/js/JSXMLDocumentCustom.cpp
</ins><span class="cx">     bindings/js/JSXMLHttpRequestCustom.cpp
</span><span class="cx">     bindings/js/JSXPathNSResolverCustom.cpp
</span><span class="cx">     bindings/js/JSXPathResultCustom.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/ChangeLog        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -1,3 +1,140 @@
</span><ins>+2016-05-15  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use more references in JS wrappers related code
+        https://bugs.webkit.org/show_bug.cgi?id=157721
+
+        Reviewed by Darin Adler.
+
+        - Use more references in JS wrappers related code.
+        - Avoid some refcounting churn when using toJSNewlyCreated() and in
+          HTML/SVG elements factories by moving the Ref&lt;&gt; around.
+        - Add toJS() / toJSNewlyCreated() implementations for Text, XMLDocument
+          and HTMLDocument. Now that toJSNewlyCreated() takes a Ref&lt;&gt;&amp;&amp; /
+          RefPtr&lt;&gt;&amp;&amp; in, the compiler is no longer able to implicitly use the
+          toJSNewlyCreated() implementation of a parent class for a subclass
+          type (complains about calls being ambiguous). I thought about updating
+          the bindings generator to always generate a toJSNewlyCreated() for
+          all wrapper types (that would call the one on the parent class if the
+          subclass does not have a proper implementation). However this would
+          add some complexity to the bindings generator and it did not seem
+          worth it because [NewObject] and therefore toJSNewlyCreated() is only
+          used for a very limited set of subtypes. I have therefore decided to
+          add the toJS() / toJSNewlyCreated() implementations for the subtypes
+          in question. This also has the benefit of avoiding calling the more
+          complex implementations on Node / Document.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSAnimationTimelineCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSAudioContextCustom.cpp:
+        (WebCore::constructJSAudioContext):
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * bindings/js/JSBlobCustom.cpp:
+        (WebCore::constructJSBlob):
+        * bindings/js/JSCSSRuleCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSCSSValueCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::getCachedWrapper):
+        (WebCore::createWrapper):
+        (WebCore::wrap):
+        (WebCore::getExistingWrapper):
+        (WebCore::createNewWrapper):
+        (WebCore::toJS):
+        (WebCore::finiteInt32Value): Deleted.
+        * bindings/js/JSDocumentCustom.cpp:
+        (WebCore::createNewDocumentWrapper):
+        (WebCore::toJS):
+        (WebCore::cachedDocumentWrapper):
+        (WebCore::reportMemoryForFramelessDocument):
+        (WebCore::toJSNewlyCreated):
+        * bindings/js/JSDocumentCustom.h:
+        * bindings/js/JSDocumentFragmentCustom.cpp:
+        (WebCore::createNewDocumentFragmentWrapper):
+        (WebCore::toJSNewlyCreated):
+        (WebCore::toJS):
+        * bindings/js/JSElementCustom.cpp:
+        (WebCore::toJSNewlyCreated):
+        * bindings/js/JSElementCustom.h:
+        (WebCore::toJSNewlyCreated):
+        * bindings/js/JSEventCustom.cpp:
+        (WebCore::createNewEventWrapper):
+        (WebCore::toJS):
+        (WebCore::toJSNewlyCreated):
+        * bindings/js/JSFileCustom.cpp:
+        (WebCore::constructJSFile):
+        * bindings/js/JSHTMLCollectionCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSHTMLDocumentCustom.cpp:
+        (WebCore::createNewHTMLDocumentWrapper):
+        (WebCore::toJS):
+        (WebCore::toJSNewlyCreated):
+        * bindings/js/JSHTMLTemplateElementCustom.cpp:
+        (WebCore::JSHTMLTemplateElement::content):
+        * bindings/js/JSImageDataCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSNodeCustom.cpp:
+        (WebCore::createWrapperInline):
+        (WebCore::createWrapper):
+        (WebCore::toJSNewlyCreated):
+        (WebCore::getOutOfLineCachedWrapper):
+        * bindings/js/JSNodeCustom.h:
+        (WebCore::toJS):
+        * bindings/js/JSNodeListCustom.cpp:
+        (WebCore::createWrapper):
+        (WebCore::toJSNewlyCreated):
+        * bindings/js/JSNodeListCustom.h:
+        (WebCore::toJS):
+        * bindings/js/JSRTCPeerConnectionCustom.cpp:
+        (WebCore::constructJSRTCPeerConnection):
+        * bindings/js/JSRTCSessionDescriptionCustom.cpp:
+        (WebCore::constructJSRTCSessionDescription):
+        * bindings/js/JSSVGPathSegCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSStyleSheetCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSTextCustom.cpp: Copied from Source/WebCore/dom/XMLDocument.idl.
+        (WebCore::createNewTextWrapper):
+        (WebCore::toJS):
+        (WebCore::toJSNewlyCreated):
+        * bindings/js/JSTextTrackCueCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSTrackCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSXMLDocumentCustom.cpp: Copied from Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp.
+        (WebCore::createNewXMLDocumentWrapper):
+        (WebCore::toJS):
+        (WebCore::toJSNewlyCreated):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateImplementation):
+        * bindings/scripts/test/JS/*: Rebaseline bindings tests.
+        * dom/Element.cpp:
+        (WebCore::Element::setInnerHTML):
+        * dom/Text.idl:
+        * dom/XMLDocument.idl:
+        * dom/make_names.pl:
+        (printWrapperFunctions):
+        (printWrapperFactoryCppFile):
+        (printWrapperFactoryHeaderFile):
+        * editing/MarkupAccumulator.cpp:
+        (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
+        * html/HTMLDocument.idl:
+        * html/HTMLTemplateElement.cpp:
+        (WebCore::HTMLTemplateElement::content):
+        (WebCore::HTMLTemplateElement::cloneNodeInternal):
+        * html/HTMLTemplateElement.h:
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::insert):
+        (WebCore::HTMLConstructionSite::insertTextNode):
+        (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::buildObjectForNode):
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLDocumentParser::startElementNs):
+
</ins><span class="cx"> 2016-05-15  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Something tiny left out of the last patch.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -2888,8 +2888,10 @@
</span><span class="cx">                 8372DB311A6780A800C697C5 /* DiagnosticLoggingResultType.h in Headers */ = {isa = PBXBuildFile; fileRef = 8372DB301A6780A800C697C5 /* DiagnosticLoggingResultType.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 8386A96D19F61B2E00E1EC4A /* StyleBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8386A96C19F61B2E00E1EC4A /* StyleBuilder.h */; };
</span><span class="cx">                 8386A97019F61E4F00E1EC4A /* StyleBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8386A96E19F61E4F00E1EC4A /* StyleBuilder.cpp */; };
</span><ins>+                838869EC1CE81EA300D16A9E /* JSTextCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 838869EB1CE81E9E00D16A9E /* JSTextCustom.cpp */; };
</ins><span class="cx">                 839AAFEC1A0C0C8D00605F99 /* HTMLWBRElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 839AAFEA1A0C0C8D00605F99 /* HTMLWBRElement.cpp */; };
</span><span class="cx">                 839AAFED1A0C0C8D00605F99 /* HTMLWBRElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 839AAFEB1A0C0C8D00605F99 /* HTMLWBRElement.h */; };
</span><ins>+                83A4A9F91CE7FD8100709B00 /* JSXMLDocumentCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83A4A9F81CE7FD7E00709B00 /* JSXMLDocumentCustom.cpp */; };
</ins><span class="cx">                 83B2D1751B8BCD6A00A02E47 /* NativeNodeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */; };
</span><span class="cx">                 83B9687B19F8AB83004EF7AF /* StyleBuilderConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83B9687919F8AB83004EF7AF /* StyleBuilderConverter.h */; };
</span><span class="cx">                 83C05A5A1A686212007E5DEA /* StylePropertyShorthandFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83C05A581A686212007E5DEA /* StylePropertyShorthandFunctions.cpp */; };
</span><span class="lines">@@ -10562,8 +10564,10 @@
</span><span class="cx">                 8372DB301A6780A800C697C5 /* DiagnosticLoggingResultType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagnosticLoggingResultType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8386A96C19F61B2E00E1EC4A /* StyleBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilder.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8386A96E19F61E4F00E1EC4A /* StyleBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleBuilder.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                838869EB1CE81E9E00D16A9E /* JSTextCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 839AAFEA1A0C0C8D00605F99 /* HTMLWBRElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLWBRElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 839AAFEB1A0C0C8D00605F99 /* HTMLWBRElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLWBRElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                83A4A9F81CE7FD7E00709B00 /* JSXMLDocumentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLDocumentCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 83B9687919F8AB83004EF7AF /* StyleBuilderConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilderConverter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83C05A581A686212007E5DEA /* StylePropertyShorthandFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StylePropertyShorthandFunctions.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83C05A591A686212007E5DEA /* StylePropertyShorthandFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StylePropertyShorthandFunctions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -22340,8 +22344,10 @@
</span><span class="cx">                                 4129DF831BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.cpp */,
</span><span class="cx">                                 4129DF841BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.h */,
</span><span class="cx">                                 418C395D1C8F0AAB0051C8A3 /* JSReadableStreamSourceCustom.cpp */,
</span><ins>+                                838869EB1CE81E9E00D16A9E /* JSTextCustom.cpp */,
</ins><span class="cx">                                 E1C36D320EB0A094007410BC /* JSWorkerGlobalScopeBase.cpp */,
</span><span class="cx">                                 E1C36D330EB0A094007410BC /* JSWorkerGlobalScopeBase.h */,
</span><ins>+                                83A4A9F81CE7FD7E00709B00 /* JSXMLDocumentCustom.cpp */,
</ins><span class="cx">                                 836C14421CDEAFCA0073493F /* JSXPathNSResolverCustom.cpp */,
</span><span class="cx">                                 418C395E1C8F0AAB0051C8A3 /* ReadableStreamController.cpp */,
</span><span class="cx">                                 418C395F1C8F0AAB0051C8A3 /* ReadableStreamController.h */,
</span><span class="lines">@@ -29572,6 +29578,7 @@
</span><span class="cx">                                 85DF2C5D0AA341F600AD64C5 /* DOMHTMLFormElement.mm in Sources */,
</span><span class="cx">                                 85DF81960AA77E4B00486AD7 /* DOMHTMLFrameElement.mm in Sources */,
</span><span class="cx">                                 85DF81980AA77E4B00486AD7 /* DOMHTMLFrameSetElement.mm in Sources */,
</span><ins>+                                83A4A9F91CE7FD8100709B00 /* JSXMLDocumentCustom.cpp in Sources */,
</ins><span class="cx">                                 85992EBB0AA5069500AC0785 /* DOMHTMLHeadElement.mm in Sources */,
</span><span class="cx">                                 85183B450AA6926100F19FA3 /* DOMHTMLHeadingElement.mm in Sources */,
</span><span class="cx">                                 85ECBEF20AA7626900544F0B /* DOMHTMLHRElement.mm in Sources */,
</span><span class="lines">@@ -30115,6 +30122,7 @@
</span><span class="cx">                                 93309DEF099E64920056E581 /* InsertParagraphSeparatorCommand.cpp in Sources */,
</span><span class="cx">                                 93309DF1099E64920056E581 /* InsertTextCommand.cpp in Sources */,
</span><span class="cx">                                 B885E8D411E06DD2009FFBF4 /* InspectorApplicationCacheAgent.cpp in Sources */,
</span><ins>+                                838869EC1CE81EA300D16A9E /* JSTextCustom.cpp in Sources */,
</ins><span class="cx">                                 7A1F2B52126C61B20006A7E6 /* InspectorClient.cpp in Sources */,
</span><span class="cx">                                 1C81B95B0E97330800266E07 /* InspectorController.cpp in Sources */,
</span><span class="cx">                                 82AB1743124B99EC00C5069D /* InspectorCSSAgent.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSAnimationTimelineCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSAnimationTimelineCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSAnimationTimelineCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSAnimationTimelineCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -41,17 +41,12 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, AnimationTimeline&amp; value)
</span><span class="cx"> {
</span><del>-    JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;value);
-
-    if (wrapper)
</del><ins>+    if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), value))
</ins><span class="cx">         return wrapper;
</span><span class="cx"> 
</span><span class="cx">     if (value.isDocumentTimeline())
</span><del>-        wrapper = CREATE_DOM_WRAPPER(globalObject, DocumentTimeline, &amp;value);
-    else
-        wrapper = CREATE_DOM_WRAPPER(globalObject, AnimationTimeline, &amp;value);
-
-    return wrapper;
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, DocumentTimeline, value);
+    return CREATE_DOM_WRAPPER(globalObject, AnimationTimeline, value);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSAudioContextCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -105,10 +105,10 @@
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!audioContext.get())
</del><ins>+    if (!audioContext)
</ins><span class="cx">         return throwVMError(exec, createReferenceError(exec, &quot;Error creating AudioContext&quot;));
</span><span class="cx"> 
</span><del>-    return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), AudioContext, audioContext.get()));
</del><ins>+    return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), AudioContext, audioContext.releaseNonNull()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBindingsAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -125,6 +125,7 @@
</span><span class="cx"> #include &quot;JSStorageCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSStyleSheetCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSStyleSheetListCustom.cpp&quot;
</span><ins>+#include &quot;JSTextCustom.cpp&quot;
</ins><span class="cx"> #include &quot;JSTextTrackCueCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSTextTrackCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSTextTrackListCustom.cpp&quot;
</span><span class="lines">@@ -137,6 +138,7 @@
</span><span class="cx"> #include &quot;JSWorkerCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSWorkerGlobalScopeBase.cpp&quot;
</span><span class="cx"> #include &quot;JSWorkerGlobalScopeCustom.cpp&quot;
</span><ins>+#include &quot;JSXMLDocumentCustom.cpp&quot;
</ins><span class="cx"> #include &quot;JSXMLHttpRequestCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSXPathNSResolverCustom.cpp&quot;
</span><span class="cx"> #include &quot;JSXPathResultCustom.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBlobCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -64,8 +64,7 @@
</span><span class="cx">         return throwVMError(exec, createReferenceError(exec, &quot;Blob constructor associated document is unavailable&quot;));
</span><span class="cx"> 
</span><span class="cx">     if (!exec-&gt;argumentCount()) {
</span><del>-        RefPtr&lt;Blob&gt; blob = Blob::create();
-        return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), Blob, blob.get()));
</del><ins>+        return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), Blob, Blob::create()));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned blobPartsLength = 0;
</span><span class="lines">@@ -128,9 +127,8 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;Blob&gt; blob = Blob::create(blobBuilder.finalize(), Blob::normalizedContentType(type));
-
-    return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), Blob, blob.get()));
</del><ins>+    auto blob = Blob::create(blobBuilder.finalize(), Blob::normalizedContentType(type));
+    return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), Blob, WTFMove(blob)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCSSRuleCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -62,50 +62,50 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, CSSRule&amp; rule)
</span><span class="cx"> {
</span><del>-    JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;rule);
</del><ins>+    JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), rule);
</ins><span class="cx">     if (wrapper)
</span><span class="cx">         return wrapper;
</span><span class="cx"> 
</span><span class="cx">     switch (rule.type()) {
</span><span class="cx">         case CSSRule::STYLE_RULE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSStyleRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSStyleRule, rule);
</ins><span class="cx">             break;
</span><span class="cx">         case CSSRule::MEDIA_RULE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSMediaRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSMediaRule, rule);
</ins><span class="cx">             break;
</span><span class="cx">         case CSSRule::FONT_FACE_RULE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSFontFaceRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSFontFaceRule, rule);
</ins><span class="cx">             break;
</span><span class="cx">         case CSSRule::PAGE_RULE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSPageRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSPageRule, rule);
</ins><span class="cx">             break;
</span><span class="cx">         case CSSRule::IMPORT_RULE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSImportRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSImportRule, rule);
</ins><span class="cx">             break;
</span><span class="cx">         case CSSRule::CHARSET_RULE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSCharsetRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSCharsetRule, rule);
</ins><span class="cx">             break;
</span><span class="cx">         case CSSRule::KEYFRAME_RULE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSKeyframeRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSKeyframeRule, rule);
</ins><span class="cx">             break;
</span><span class="cx">         case CSSRule::KEYFRAMES_RULE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSKeyframesRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSKeyframesRule, rule);
</ins><span class="cx">             break;
</span><span class="cx">         case CSSRule::SUPPORTS_RULE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSSupportsRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSSupportsRule, rule);
</ins><span class="cx">             break;
</span><span class="cx"> #if ENABLE(CSS_DEVICE_ADAPTATION)
</span><span class="cx">         case CSSRule::WEBKIT_VIEWPORT_RULE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, WebKitCSSViewportRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, WebKitCSSViewportRule, rule);
</ins><span class="cx">             break;
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx">         case CSSRule::WEBKIT_REGION_RULE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, WebKitCSSRegionRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, WebKitCSSRegionRule, rule);
</ins><span class="cx">             break;
</span><span class="cx"> #endif
</span><span class="cx">         default:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSRule, &amp;rule);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, CSSRule, rule);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return wrapper;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCSSValueCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCSSValueCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCSSValueCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSCSSValueCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -73,25 +73,25 @@
</span><span class="cx">     if (!value.isCSSOMSafe())
</span><span class="cx">         return jsNull();
</span><span class="cx"> 
</span><del>-    JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;value);
</del><ins>+    JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), value);
</ins><span class="cx"> 
</span><span class="cx">     if (wrapper)
</span><span class="cx">         return wrapper;
</span><span class="cx"> 
</span><span class="cx">     if (value.isWebKitCSSTransformValue())
</span><del>-        wrapper = CREATE_DOM_WRAPPER(globalObject, WebKitCSSTransformValue, &amp;value);
</del><ins>+        wrapper = CREATE_DOM_WRAPPER(globalObject, WebKitCSSTransformValue, value);
</ins><span class="cx">     else if (value.isWebKitCSSFilterValue())
</span><del>-        wrapper = CREATE_DOM_WRAPPER(globalObject, WebKitCSSFilterValue, &amp;value);
</del><ins>+        wrapper = CREATE_DOM_WRAPPER(globalObject, WebKitCSSFilterValue, value);
</ins><span class="cx">     else if (value.isValueList())
</span><del>-        wrapper = CREATE_DOM_WRAPPER(globalObject, CSSValueList, &amp;value);
</del><ins>+        wrapper = CREATE_DOM_WRAPPER(globalObject, CSSValueList, value);
</ins><span class="cx">     else if (value.isSVGPaint())
</span><del>-        wrapper = CREATE_DOM_WRAPPER(globalObject, SVGPaint, &amp;value);
</del><ins>+        wrapper = CREATE_DOM_WRAPPER(globalObject, SVGPaint, value);
</ins><span class="cx">     else if (value.isSVGColor())
</span><del>-        wrapper = CREATE_DOM_WRAPPER(globalObject, SVGColor, &amp;value);
</del><ins>+        wrapper = CREATE_DOM_WRAPPER(globalObject, SVGColor, value);
</ins><span class="cx">     else if (value.isPrimitiveValue())
</span><del>-        wrapper = CREATE_DOM_WRAPPER(globalObject, CSSPrimitiveValue, &amp;value);
</del><ins>+        wrapper = CREATE_DOM_WRAPPER(globalObject, CSSPrimitiveValue, value);
</ins><span class="cx">     else
</span><del>-        wrapper = CREATE_DOM_WRAPPER(globalObject, CSSValue, &amp;value);
</del><ins>+        wrapper = CREATE_DOM_WRAPPER(globalObject, CSSValue, value);
</ins><span class="cx"> 
</span><span class="cx">     return wrapper;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -154,16 +154,20 @@
</span><span class="cx"> bool clearInlineCachedWrapper(DOMWrapperWorld&amp;, ScriptWrappable*, JSDOMObject* wrapper);
</span><span class="cx"> bool clearInlineCachedWrapper(DOMWrapperWorld&amp;, JSC::ArrayBuffer*, JSC::JSArrayBuffer* wrapper);
</span><span class="cx"> 
</span><del>-#define CREATE_DOM_WRAPPER(globalObject, className, object) createWrapper&lt;JS##className&gt;(globalObject, static_cast&lt;className*&gt;(object))
</del><ins>+template&lt;typename DOMClass, typename T&gt; Ref&lt;DOMClass&gt; inline castDOMObjectForWrapperCreation(T&amp; object) { return Ref&lt;DOMClass&gt;(*static_cast&lt;DOMClass*&gt;(&amp;object)); }
+template&lt;typename DOMClass, typename T&gt; Ref&lt;DOMClass&gt; inline castDOMObjectForWrapperCreation(Ref&lt;T&gt;&amp;&amp; object) { return static_reference_cast&lt;DOMClass&gt;(WTFMove(object)); }
</ins><span class="cx"> 
</span><del>-template&lt;typename DOMClass&gt; JSC::JSObject* getCachedWrapper(DOMWrapperWorld&amp;, DOMClass*);
</del><ins>+#define CREATE_DOM_WRAPPER(globalObject, className, object) createWrapper&lt;JS##className, className&gt;(globalObject, castDOMObjectForWrapperCreation&lt;className&gt;(object))
+
+template&lt;typename DOMClass&gt; JSC::JSObject* getCachedWrapper(DOMWrapperWorld&amp;, DOMClass&amp;);
+template&lt;typename DOMClass&gt; inline JSC::JSObject* getCachedWrapper(DOMWrapperWorld&amp; world, Ref&lt;DOMClass&gt;&amp; object) { return getCachedWrapper(world, object.get()); }
</ins><span class="cx"> template&lt;typename DOMClass, typename WrapperClass&gt; void cacheWrapper(DOMWrapperWorld&amp;, DOMClass*, WrapperClass*);
</span><span class="cx"> template&lt;typename DOMClass, typename WrapperClass&gt; void uncacheWrapper(DOMWrapperWorld&amp;, DOMClass*, WrapperClass*);
</span><ins>+template&lt;typename WrapperClass, typename DOMClass&gt; WrapperClass* createWrapper(JSDOMGlobalObject*, Ref&lt;DOMClass&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><del>-template&lt;typename WrapperClass, typename DOMClass&gt; JSDOMObject* createWrapper(JSDOMGlobalObject*, DOMClass*);
</del><span class="cx"> template&lt;typename WrapperClass, typename DOMClass&gt; JSC::JSValue wrap(JSDOMGlobalObject*, DOMClass&amp;);
</span><del>-template&lt;typename WrapperClass, typename DOMClass&gt; JSC::JSValue getExistingWrapper(JSDOMGlobalObject*, DOMClass*);
-template&lt;typename WrapperClass, typename DOMClass&gt; JSC::JSValue createNewWrapper(JSDOMGlobalObject*, DOMClass*);
</del><ins>+template&lt;typename WrapperClass, typename DOMClass&gt; JSC::JSValue getExistingWrapper(JSDOMGlobalObject*, DOMClass&amp;);
+template&lt;typename WrapperClass, typename DOMClass&gt; JSC::JSValue createNewWrapper(JSDOMGlobalObject*, Ref&lt;DOMClass&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx"> void addImpureProperty(const AtomicString&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -253,8 +257,6 @@
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSC::JSGlobalObject*, JSC::ArrayBufferView*);
</span><span class="cx"> template&lt;typename T&gt; JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const RefPtr&lt;T&gt;&amp;);
</span><span class="cx"> template&lt;typename T&gt; JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const Ref&lt;T&gt;&amp;);
</span><del>-template&lt;typename T&gt; JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, const RefPtr&lt;T&gt;&amp;);
-template&lt;typename T&gt; JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, const Ref&lt;T&gt;&amp;);
</del><span class="cx"> template&lt;typename T&gt; JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const Vector&lt;T&gt;&amp;);
</span><span class="cx"> template&lt;typename T&gt; JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const Vector&lt;RefPtr&lt;T&gt;&gt;&amp;);
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const String&amp;);
</span><span class="lines">@@ -433,11 +435,11 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename DOMClass&gt; inline JSC::JSObject* getCachedWrapper(DOMWrapperWorld&amp; world, DOMClass* domObject)
</del><ins>+template&lt;typename DOMClass&gt; inline JSC::JSObject* getCachedWrapper(DOMWrapperWorld&amp; world, DOMClass&amp; domObject)
</ins><span class="cx"> {
</span><del>-    if (JSC::JSObject* wrapper = getInlineCachedWrapper(world, domObject))
</del><ins>+    if (auto* wrapper = getInlineCachedWrapper(world, &amp;domObject))
</ins><span class="cx">         return wrapper;
</span><del>-    return world.m_wrappers.get(wrapperKey(domObject));
</del><ins>+    return world.m_wrappers.get(wrapperKey(&amp;domObject));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename DOMClass, typename WrapperClass&gt; inline void cacheWrapper(DOMWrapperWorld&amp; world, DOMClass* domObject, WrapperClass* wrapper)
</span><span class="lines">@@ -455,33 +457,31 @@
</span><span class="cx">     weakRemove(world.m_wrappers, wrapperKey(domObject), wrapper);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename WrapperClass, typename DOMClass&gt; inline JSDOMObject* createWrapper(JSDOMGlobalObject* globalObject, DOMClass* node)
</del><ins>+template&lt;typename WrapperClass, typename DOMClass&gt; inline WrapperClass* createWrapper(JSDOMGlobalObject* globalObject, Ref&lt;DOMClass&gt;&amp;&amp; node)
</ins><span class="cx"> {
</span><del>-    ASSERT(node);
</del><span class="cx">     ASSERT(!getCachedWrapper(globalObject-&gt;world(), node));
</span><del>-    WrapperClass* wrapper = WrapperClass::create(getDOMStructure&lt;WrapperClass&gt;(globalObject-&gt;vm(), *globalObject), globalObject, Ref&lt;DOMClass&gt;(*node));
-    cacheWrapper(globalObject-&gt;world(), node, wrapper);
</del><ins>+    auto* nodePtr = node.ptr();
+    WrapperClass* wrapper = WrapperClass::create(getDOMStructure&lt;WrapperClass&gt;(globalObject-&gt;vm(), *globalObject), globalObject, WTFMove(node));
+    cacheWrapper(globalObject-&gt;world(), nodePtr, wrapper);
</ins><span class="cx">     return wrapper;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename WrapperClass, typename DOMClass&gt; inline JSC::JSValue wrap(JSDOMGlobalObject* globalObject, DOMClass&amp; domObject)
</span><span class="cx"> {
</span><del>-    if (JSC::JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;domObject))
</del><ins>+    if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), domObject))
</ins><span class="cx">         return wrapper;
</span><del>-    return createWrapper&lt;WrapperClass&gt;(globalObject, &amp;domObject);
</del><ins>+    return createWrapper&lt;WrapperClass, DOMClass&gt;(globalObject, domObject);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename WrapperClass, typename DOMClass&gt; inline JSC::JSValue getExistingWrapper(JSDOMGlobalObject* globalObject, DOMClass* domObject)
</del><ins>+template&lt;typename WrapperClass, typename DOMClass&gt; inline JSC::JSValue getExistingWrapper(JSDOMGlobalObject* globalObject, DOMClass&amp; domObject)
</ins><span class="cx"> {
</span><del>-    ASSERT(domObject);
</del><span class="cx">     return getCachedWrapper(globalObject-&gt;world(), domObject);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename WrapperClass, typename DOMClass&gt; inline JSC::JSValue createNewWrapper(JSDOMGlobalObject* globalObject, DOMClass* domObject)
</del><ins>+template&lt;typename WrapperClass, typename DOMClass&gt; inline JSC::JSValue createNewWrapper(JSDOMGlobalObject* globalObject, Ref&lt;DOMClass&gt;&amp;&amp; domObject)
</ins><span class="cx"> {
</span><del>-    ASSERT(domObject);
</del><span class="cx">     ASSERT(!getCachedWrapper(globalObject-&gt;world(), domObject));
</span><del>-    return createWrapper&lt;WrapperClass&gt;(globalObject, domObject);
</del><ins>+    return createWrapper&lt;WrapperClass&gt;(globalObject, WTFMove(domObject));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline int32_t finiteInt32Value(JSC::JSValue value, JSC::ExecState* exec, bool&amp; okay)
</span><span class="lines">@@ -520,12 +520,11 @@
</span><span class="cx"> {
</span><span class="cx">     if (!buffer)
</span><span class="cx">         return JSC::jsNull();
</span><del>-    if (JSC::JSValue result = getExistingWrapper&lt;JSC::JSArrayBuffer&gt;(globalObject, buffer))
</del><ins>+    if (JSC::JSValue result = getExistingWrapper&lt;JSC::JSArrayBuffer&gt;(globalObject, *buffer))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx">     // The JSArrayBuffer::create function will register the wrapper in finishCreation.
</span><del>-    JSC::JSArrayBuffer* wrapper = JSC::JSArrayBuffer::create(exec-&gt;vm(), globalObject-&gt;arrayBufferStructure(), buffer);
-    return wrapper;
</del><ins>+    return JSC::JSArrayBuffer::create(exec-&gt;vm(), globalObject-&gt;arrayBufferStructure(), buffer);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, JSC::ArrayBufferView* view)
</span><span class="lines">@@ -552,16 +551,6 @@
</span><span class="cx">     return toJS(exec, globalObject, const_cast&lt;T&amp;&gt;(ptr.get()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename T&gt; inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const RefPtr&lt;T&gt;&amp; ptr)
-{
-    return toJSNewlyCreated(exec, globalObject, ptr.get());
-}
-
-template&lt;typename T&gt; inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Ref&lt;T&gt;&amp; ptr)
-{
-    return toJSNewlyCreated(exec, globalObject, const_cast&lt;T&amp;&gt;(ptr.get()));
-}
-
</del><span class="cx"> template&lt;typename T&gt; inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector&lt;T&gt;&amp; vector)
</span><span class="cx"> {
</span><span class="cx">     JSC::JSArray* array = constructEmptyArray(exec, nullptr, vector.size());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -52,55 +52,64 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static inline JSValue createNewDocumentWrapper(ExecState&amp; state, JSDOMGlobalObject&amp; globalObject, Document&amp; document)
</del><ins>+static inline JSValue createNewDocumentWrapper(ExecState&amp; state, JSDOMGlobalObject&amp; globalObject, Ref&lt;Document&gt;&amp;&amp; passedDocument)
</ins><span class="cx"> {
</span><ins>+    auto&amp; document = passedDocument.get();
</ins><span class="cx">     JSObject* wrapper;
</span><span class="cx">     if (document.isHTMLDocument())
</span><del>-        wrapper = CREATE_DOM_WRAPPER(&amp;globalObject, HTMLDocument, &amp;document);
</del><ins>+        wrapper = CREATE_DOM_WRAPPER(&amp;globalObject, HTMLDocument, WTFMove(passedDocument));
</ins><span class="cx">     else if (document.isSVGDocument())
</span><del>-        wrapper = CREATE_DOM_WRAPPER(&amp;globalObject, SVGDocument, &amp;document);
</del><ins>+        wrapper = CREATE_DOM_WRAPPER(&amp;globalObject, SVGDocument, WTFMove(passedDocument));
</ins><span class="cx">     else if (document.isXMLDocument())
</span><del>-        wrapper = CREATE_DOM_WRAPPER(&amp;globalObject, XMLDocument, &amp;document);
</del><ins>+        wrapper = CREATE_DOM_WRAPPER(&amp;globalObject, XMLDocument, WTFMove(passedDocument));
</ins><span class="cx">     else
</span><del>-        wrapper = CREATE_DOM_WRAPPER(&amp;globalObject, Document, &amp;document);
</del><ins>+        wrapper = CREATE_DOM_WRAPPER(&amp;globalObject, Document, WTFMove(passedDocument));
</ins><span class="cx"> 
</span><del>-    // Make sure the document is kept around by the window object, and works right with the
-    // back/forward cache.
-    if (!document.frame()) {
-        size_t nodeCount = 0;
-        for (Node* n = &amp;document; n; n = NodeTraversal::next(*n))
-            ++nodeCount;
</del><ins>+    reportMemoryForDocumentIfFrameless(state, document);
</ins><span class="cx"> 
</span><del>-        // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated.
-        // https://bugs.webkit.org/show_bug.cgi?id=142595
-        state.heap()-&gt;deprecatedReportExtraMemory(nodeCount * sizeof(Node));
-    }
-
</del><span class="cx">     return wrapper;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, Document&amp; document)
</span><span class="cx"> {
</span><del>-    JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;document);
-    if (wrapper)
</del><ins>+    if (auto* wrapper = cachedDocumentWrapper(*state, *globalObject, document))
</ins><span class="cx">         return wrapper;
</span><ins>+    return createNewDocumentWrapper(*state, *globalObject, document);
+}
</ins><span class="cx"> 
</span><del>-    if (DOMWindow* domWindow = document.domWindow()) {
-        globalObject = toJSDOMWindow(toJS(state, *domWindow));
-        // Creating a wrapper for domWindow might have created a wrapper for document as well.
-        wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;document);
-        if (wrapper)
-            return wrapper;
-    }
</del><ins>+JSObject* cachedDocumentWrapper(ExecState&amp; state, JSDOMGlobalObject&amp; globalObject, Document&amp; document)
+{
+    if (auto* wrapper = getCachedWrapper(globalObject.world(), document))
+        return wrapper;
</ins><span class="cx"> 
</span><del>-    return createNewDocumentWrapper(*state, *globalObject, document);
</del><ins>+    auto* window = document.domWindow();
+    if (!window)
+        return nullptr;
+
+    // Creating a wrapper for domWindow might have created a wrapper for document as well.
+    return getCachedWrapper(toJSDOMWindow(toJS(&amp;state, *window))-&gt;world(), document);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue toJSNewlyCreated(ExecState* state, JSDOMGlobalObject* globalObject, Document&amp; document)
</del><ins>+void reportMemoryForDocumentIfFrameless(ExecState&amp; state, Document&amp; document)
</ins><span class="cx"> {
</span><del>-    return createNewDocumentWrapper(*state, *globalObject, document);
</del><ins>+    // Make sure the document is kept around by the window object, and works right with the back/forward cache.
+    if (document.frame())
+        return;
+
+    size_t nodeCount = 0;
+    for (Node* node = &amp;document; node; node = NodeTraversal::next(*node))
+        ++nodeCount;
+
+    // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated.
+    // https://bugs.webkit.org/show_bug.cgi?id=142595
+    state.heap()-&gt;deprecatedReportExtraMemory(nodeCount * sizeof(Node));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSValue toJSNewlyCreated(ExecState* state, JSDOMGlobalObject* globalObject, Ref&lt;Document&gt;&amp;&amp; document)
+{
+    return createNewDocumentWrapper(*state, *globalObject, WTFMove(document));
+}
+
</ins><span class="cx"> JSValue JSDocument::prepend(ExecState&amp; state)
</span><span class="cx"> {
</span><span class="cx">     ExceptionCode ec = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDocumentCustom.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentCustom.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSDocumentCustom.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -38,6 +38,9 @@
</span><span class="cx">     return value.asCell()-&gt;type() == JSDocumentWrapperType ? JSC::jsCast&lt;JSDocument*&gt;(value) : nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSC::JSObject* cachedDocumentWrapper(JSC::ExecState&amp;, JSDOMGlobalObject&amp;, Document&amp;);
+void reportMemoryForDocumentIfFrameless(JSC::ExecState&amp;, Document&amp;);
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // JSDocumentCustom_h
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentFragmentCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSDocumentFragmentCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -52,23 +52,23 @@
</span><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline JSValue createNewDocumentFragmentWrapper(JSDOMGlobalObject&amp; globalObject, DocumentFragment&amp; impl)
</del><ins>+static inline JSValue createNewDocumentFragmentWrapper(JSDOMGlobalObject&amp; globalObject, Ref&lt;DocumentFragment&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(SHADOW_DOM)
</span><del>-    if (impl.isShadowRoot())
-        return createNewWrapper&lt;JSShadowRoot&gt;(&amp;globalObject, &amp;static_cast&lt;ShadowRoot&amp;&gt;(impl));
</del><ins>+    if (impl-&gt;isShadowRoot())
+        return CREATE_DOM_WRAPPER(&amp;globalObject, ShadowRoot, WTFMove(impl));
</ins><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSDocumentFragment&gt;(&amp;globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSDocumentFragment&gt;(&amp;globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, DocumentFragment&amp; impl)
</del><ins>+JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;DocumentFragment&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewDocumentFragmentWrapper(*globalObject, impl);
</del><ins>+    return createNewDocumentFragmentWrapper(*globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, DocumentFragment&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSDocumentFragment&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSDocumentFragment&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx">     return createNewDocumentFragmentWrapper(*globalObject, impl);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSElementCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSElementCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSElementCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -49,26 +49,30 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><del>-JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Element* element)
</del><ins>+static JSValue createNewElementWrapper(JSDOMGlobalObject* globalObject, Ref&lt;Element&gt;&amp;&amp; element)
</ins><span class="cx"> {
</span><del>-    if (!element)
-        return jsNull();
</del><ins>+    if (is&lt;HTMLElement&gt;(element.get()))
+        return createJSHTMLWrapper(globalObject, static_reference_cast&lt;HTMLElement&gt;(WTFMove(element)));
+    if (is&lt;SVGElement&gt;(element.get()))
+        return createJSSVGWrapper(globalObject, static_reference_cast&lt;SVGElement&gt;(WTFMove(element)));
+    return CREATE_DOM_WRAPPER(globalObject, Element, WTFMove(element));
+}
</ins><span class="cx"> 
</span><ins>+JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, Element&amp; element)
+{
+    if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), element))
+        return wrapper;
+    return createNewElementWrapper(globalObject, element);
+}
+
+JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;Element&gt;&amp;&amp; element)
+{
</ins><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><span class="cx">     if (element-&gt;isCustomElement())
</span><span class="cx">         return getCachedWrapper(globalObject-&gt;world(), element);
</span><span class="cx"> #endif
</span><span class="cx">     ASSERT(!getCachedWrapper(globalObject-&gt;world(), element));
</span><del>-
-    JSDOMObject* wrapper;        
-    if (is&lt;HTMLElement&gt;(*element))
-        wrapper = createJSHTMLWrapper(globalObject, downcast&lt;HTMLElement&gt;(element));
-    else if (is&lt;SVGElement&gt;(*element))
-        wrapper = createJSSVGWrapper(globalObject, downcast&lt;SVGElement&gt;(element));
-    else
-        wrapper = CREATE_DOM_WRAPPER(globalObject, Element, element);
-
-    return wrapper;    
</del><ins>+    return createNewElementWrapper(globalObject, WTFMove(element));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue JSElement::before(ExecState&amp; state)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSElementCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSElementCustom.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSElementCustom.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSElementCustom.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -31,8 +31,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Element*);
-
</del><span class="cx"> ALWAYS_INLINE JSElement* jsElementCast(JSC::JSValue value)
</span><span class="cx"> {
</span><span class="cx">     if (UNLIKELY(!value.isCell()))
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSEventCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSEventCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSEventCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSEventCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -51,32 +51,31 @@
</span><span class="cx"> 
</span><span class="cx"> #define TRY_TO_WRAP_WITH_INTERFACE(interfaceName) \
</span><span class="cx">     case interfaceName##InterfaceType: \
</span><del>-        return CREATE_DOM_WRAPPER(&amp;globalObject, interfaceName, &amp;event);
</del><ins>+        return CREATE_DOM_WRAPPER(&amp;globalObject, interfaceName, WTFMove(event));
</ins><span class="cx"> 
</span><del>-static inline JSValue createNewEventWrapper(JSDOMGlobalObject&amp; globalObject, Event&amp; event)
</del><ins>+static inline JSValue createNewEventWrapper(JSDOMGlobalObject&amp; globalObject, Ref&lt;Event&gt;&amp;&amp; event)
</ins><span class="cx"> {
</span><del>-    switch (event.eventInterface()) {
</del><ins>+    switch (event-&gt;eventInterface()) {
</ins><span class="cx">         DOM_EVENT_INTERFACES_FOR_EACH(TRY_TO_WRAP_WITH_INTERFACE)
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return CREATE_DOM_WRAPPER(&amp;globalObject, Event, &amp;event);
</del><ins>+    return CREATE_DOM_WRAPPER(&amp;globalObject, Event, WTFMove(event));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, Event&amp; event)
</span><span class="cx"> {
</span><span class="cx">     JSLockHolder lock(globalObject-&gt;vm());
</span><span class="cx"> 
</span><del>-    JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;event);
-    if (wrapper)
</del><ins>+    if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), event))
</ins><span class="cx">         return wrapper;
</span><span class="cx"> 
</span><span class="cx">     return createNewEventWrapper(*globalObject, event);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Event&amp; event)
</del><ins>+JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;Event&gt;&amp;&amp; event)
</ins><span class="cx"> {
</span><del>-    return createNewEventWrapper(*globalObject, event);
</del><ins>+    return createNewEventWrapper(*globalObject, WTFMove(event));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #undef TRY_TO_WRAP_WITH_INTERFACE
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSFileCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSFileCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -118,8 +118,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto file = File::create(blobBuilder.finalize(), filename, normalizedType, lastModified.value());
</span><del>-
-    return JSValue::encode(CREATE_DOM_WRAPPER(constructor-&gt;globalObject(), File, &amp;file.get()));
</del><ins>+    return JSValue::encode(CREATE_DOM_WRAPPER(constructor-&gt;globalObject(), File, WTFMove(file)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHTMLCollectionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -55,23 +55,21 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, HTMLCollection&amp; collection)
</span><span class="cx"> {
</span><del>-    JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;collection);
-
-    if (wrapper)
</del><ins>+    if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), collection))
</ins><span class="cx">         return wrapper;
</span><span class="cx"> 
</span><span class="cx">     switch (collection.type()) {
</span><span class="cx">     case FormControls:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, HTMLFormControlsCollection, &amp;collection);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, HTMLFormControlsCollection, collection);
</ins><span class="cx">     case SelectOptions:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, HTMLOptionsCollection, &amp;collection);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, HTMLOptionsCollection, collection);
</ins><span class="cx">     case DocAll:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, HTMLAllCollection, &amp;collection);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, HTMLAllCollection, collection);
</ins><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return CREATE_DOM_WRAPPER(globalObject, HTMLCollection, &amp;collection);
</del><ins>+    return CREATE_DOM_WRAPPER(globalObject, HTMLCollection, collection);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHTMLDocumentCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &quot;JSDOMWindow.h&quot;
</span><span class="cx"> #include &quot;JSDOMWindowCustom.h&quot;
</span><span class="cx"> #include &quot;JSDOMWindowShell.h&quot;
</span><ins>+#include &quot;JSDocumentCustom.h&quot;
</ins><span class="cx"> #include &quot;JSHTMLCollection.h&quot;
</span><span class="cx"> #include &quot;JSMainThreadExecState.h&quot;
</span><span class="cx"> #include &quot;SegmentedString.h&quot;
</span><span class="lines">@@ -52,6 +53,28 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><ins>+static inline JSValue createNewHTMLDocumentWrapper(ExecState&amp; state, JSDOMGlobalObject&amp; globalObject, Ref&lt;HTMLDocument&gt;&amp;&amp; passedDocument)
+{
+    auto&amp; document = passedDocument.get();
+    JSObject* wrapper = CREATE_DOM_WRAPPER(&amp;globalObject, HTMLDocument, WTFMove(passedDocument));
+
+    reportMemoryForDocumentIfFrameless(state, document);
+
+    return wrapper;
+}
+
+JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, HTMLDocument&amp; document)
+{
+    if (auto* wrapper = cachedDocumentWrapper(*state, *globalObject, document))
+        return wrapper;
+    return createNewHTMLDocumentWrapper(*state, *globalObject, document);
+}
+
+JSValue toJSNewlyCreated(ExecState* state, JSDOMGlobalObject* globalObject, Ref&lt;HTMLDocument&gt;&amp;&amp; document)
+{
+    return createNewHTMLDocumentWrapper(*state, *globalObject, WTFMove(document));
+}
+
</ins><span class="cx"> bool JSHTMLDocument::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="cx"> {
</span><span class="cx">     JSHTMLDocument* thisObject = jsCast&lt;JSHTMLDocument*&gt;(object);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHTMLTemplateElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLTemplateElementCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLTemplateElementCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSHTMLTemplateElementCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -45,13 +45,12 @@
</span><span class="cx"> {
</span><span class="cx">     JSLockHolder lock(&amp;state);
</span><span class="cx"> 
</span><del>-    DocumentFragment* content = wrapped().content();
</del><ins>+    auto&amp; content = wrapped().content();
</ins><span class="cx"> 
</span><del>-    JSObject* wrapper = getCachedWrapper(globalObject()-&gt;world(), content);
-    if (wrapper)
</del><ins>+    if (auto* wrapper = getCachedWrapper(globalObject()-&gt;world(), content))
</ins><span class="cx">         return wrapper;
</span><span class="cx"> 
</span><del>-    wrapper = CREATE_DOM_WRAPPER(globalObject(), DocumentFragment, content);
</del><ins>+    auto* wrapper = CREATE_DOM_WRAPPER(globalObject(), DocumentFragment, content);
</ins><span class="cx">     PrivateName propertyName;
</span><span class="cx">     const_cast&lt;JSHTMLTemplateElement*&gt;(this)-&gt;putDirect(globalObject()-&gt;vm(), propertyName, wrapper);
</span><span class="cx">     return wrapper;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSImageDataCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSImageDataCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSImageDataCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSImageDataCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -37,11 +37,10 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, ImageData&amp; imageData)
</span><span class="cx"> {
</span><del>-    JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;imageData);
-    if (wrapper)
</del><ins>+    if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), imageData))
</ins><span class="cx">         return wrapper;
</span><span class="cx">     
</span><del>-    wrapper = CREATE_DOM_WRAPPER(globalObject, ImageData, &amp;imageData);
</del><ins>+    auto* wrapper = CREATE_DOM_WRAPPER(globalObject, ImageData, imageData);
</ins><span class="cx">     Identifier dataName = Identifier::fromString(exec, &quot;data&quot;);
</span><span class="cx">     wrapper-&gt;putDirect(exec-&gt;vm(), dataName, toJS(exec, globalObject, imageData.data()), DontDelete | ReadOnly);
</span><span class="cx">     // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -196,71 +196,70 @@
</span><span class="cx">     visitor.addOpaqueRoot(root(wrapped()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static ALWAYS_INLINE JSValue createWrapperInline(ExecState* exec, JSDOMGlobalObject* globalObject, Node* node)
</del><ins>+static ALWAYS_INLINE JSValue createWrapperInline(ExecState* exec, JSDOMGlobalObject* globalObject, Ref&lt;Node&gt;&amp;&amp; node)
</ins><span class="cx"> {
</span><del>-    ASSERT(node);
</del><span class="cx">     ASSERT(!getCachedWrapper(globalObject-&gt;world(), node));
</span><span class="cx">     
</span><span class="cx">     JSDOMObject* wrapper;    
</span><span class="cx">     switch (node-&gt;nodeType()) {
</span><span class="cx">         case Node::ELEMENT_NODE:
</span><del>-            if (is&lt;HTMLElement&gt;(*node))
-                wrapper = createJSHTMLWrapper(globalObject, downcast&lt;HTMLElement&gt;(node));
-            else if (is&lt;SVGElement&gt;(*node))
-                wrapper = createJSSVGWrapper(globalObject, downcast&lt;SVGElement&gt;(node));
</del><ins>+            if (is&lt;HTMLElement&gt;(node.get()))
+                wrapper = createJSHTMLWrapper(globalObject, static_reference_cast&lt;HTMLElement&gt;(WTFMove(node)));
+            else if (is&lt;SVGElement&gt;(node.get()))
+                wrapper = createJSSVGWrapper(globalObject, static_reference_cast&lt;SVGElement&gt;(WTFMove(node)));
</ins><span class="cx">             else
</span><del>-                wrapper = CREATE_DOM_WRAPPER(globalObject, Element, node);
</del><ins>+                wrapper = CREATE_DOM_WRAPPER(globalObject, Element, WTFMove(node));
</ins><span class="cx">             break;
</span><span class="cx">         case Node::ATTRIBUTE_NODE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, Attr, node);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, Attr, WTFMove(node));
</ins><span class="cx">             break;
</span><span class="cx">         case Node::TEXT_NODE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, Text, node);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, Text, WTFMove(node));
</ins><span class="cx">             break;
</span><span class="cx">         case Node::CDATA_SECTION_NODE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, CDATASection, node);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, CDATASection, WTFMove(node));
</ins><span class="cx">             break;
</span><span class="cx">         case Node::PROCESSING_INSTRUCTION_NODE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, ProcessingInstruction, node);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, ProcessingInstruction, WTFMove(node));
</ins><span class="cx">             break;
</span><span class="cx">         case Node::COMMENT_NODE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, Comment, node);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, Comment, WTFMove(node));
</ins><span class="cx">             break;
</span><span class="cx">         case Node::DOCUMENT_NODE:
</span><span class="cx">             // we don't want to cache the document itself in the per-document dictionary
</span><del>-            return toJS(exec, globalObject, downcast&lt;Document&gt;(*node));
</del><ins>+            return toJS(exec, globalObject, downcast&lt;Document&gt;(node.get()));
</ins><span class="cx">         case Node::DOCUMENT_TYPE_NODE:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, DocumentType, node);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, DocumentType, WTFMove(node));
</ins><span class="cx">             break;
</span><span class="cx">         case Node::DOCUMENT_FRAGMENT_NODE:
</span><span class="cx"> #if ENABLE(SHADOW_DOM)
</span><span class="cx">             if (node-&gt;isShadowRoot())
</span><del>-                wrapper = CREATE_DOM_WRAPPER(globalObject, ShadowRoot, node);
</del><ins>+                wrapper = CREATE_DOM_WRAPPER(globalObject, ShadowRoot, WTFMove(node));
</ins><span class="cx">             else
</span><span class="cx"> #endif
</span><del>-                wrapper = CREATE_DOM_WRAPPER(globalObject, DocumentFragment, node);
</del><ins>+                wrapper = CREATE_DOM_WRAPPER(globalObject, DocumentFragment, WTFMove(node));
</ins><span class="cx">             break;
</span><span class="cx">         default:
</span><del>-            wrapper = CREATE_DOM_WRAPPER(globalObject, Node, node);
</del><ins>+            wrapper = CREATE_DOM_WRAPPER(globalObject, Node, WTFMove(node));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return wrapper;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue createWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, Node* node)
</del><ins>+JSValue createWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, Ref&lt;Node&gt;&amp;&amp; node)
</ins><span class="cx"> {
</span><del>-    return createWrapperInline(exec, globalObject, node);
</del><ins>+    return createWrapperInline(exec, globalObject, WTFMove(node));
</ins><span class="cx"> }
</span><span class="cx">     
</span><del>-JSValue toJSNewlyCreated(ExecState* exec, JSDOMGlobalObject* globalObject, Node&amp; node)
</del><ins>+JSValue toJSNewlyCreated(ExecState* exec, JSDOMGlobalObject* globalObject, Ref&lt;Node&gt;&amp;&amp; node)
</ins><span class="cx"> {
</span><del>-    return createWrapperInline(exec, globalObject, &amp;node);
</del><ins>+    return createWrapperInline(exec, globalObject, WTFMove(node));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSObject* getOutOfLineCachedWrapper(JSDOMGlobalObject* globalObject, Node* node)
</del><ins>+JSC::JSObject* getOutOfLineCachedWrapper(JSDOMGlobalObject* globalObject, Node&amp; node)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!globalObject-&gt;world().isNormal());
</span><del>-    return globalObject-&gt;world().m_wrappers.get(node);
</del><ins>+    return globalObject-&gt;world().m_wrappers.get(&amp;node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void willCreatePossiblyOrphanedTreeByRemovalSlowCase(Node* root)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeCustom.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeCustom.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSNodeCustom.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -31,8 +31,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-WEBCORE_EXPORT JSC::JSValue createWrapper(JSC::ExecState*, JSDOMGlobalObject*, Node*);
-WEBCORE_EXPORT JSC::JSObject* getOutOfLineCachedWrapper(JSDOMGlobalObject*, Node*);
</del><ins>+WEBCORE_EXPORT JSC::JSValue createWrapper(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;Node&gt;&amp;&amp;);
+WEBCORE_EXPORT JSC::JSObject* getOutOfLineCachedWrapper(JSDOMGlobalObject*, Node&amp;);
</ins><span class="cx"> 
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Node&amp; node)
</span><span class="cx"> {
</span><span class="lines">@@ -40,11 +40,11 @@
</span><span class="cx">         if (auto* wrapper = node.wrapper())
</span><span class="cx">             return wrapper;
</span><span class="cx">     } else {
</span><del>-        if (auto* wrapper = getOutOfLineCachedWrapper(globalObject, &amp;node))
</del><ins>+        if (auto* wrapper = getOutOfLineCachedWrapper(globalObject, node))
</ins><span class="cx">             return wrapper;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return createWrapper(exec, globalObject, &amp;node);
</del><ins>+    return createWrapper(exec, globalObject, node);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // In the C++ DOM, a node tree survives as long as there is a reference to its
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeListCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSNodeListCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -51,17 +51,17 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue createWrapper(JSDOMGlobalObject&amp; globalObject, NodeList&amp; nodeList)
</del><ins>+JSC::JSValue createWrapper(JSDOMGlobalObject&amp; globalObject, Ref&lt;NodeList&gt;&amp;&amp; nodeList)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated.
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=142595
</span><del>-    globalObject.vm().heap.deprecatedReportExtraMemory(nodeList.memoryCost());
-    return createNewWrapper&lt;JSNodeList&gt;(&amp;globalObject, &amp;nodeList);
</del><ins>+    globalObject.vm().heap.deprecatedReportExtraMemory(nodeList-&gt;memoryCost());
+    return createNewWrapper&lt;JSNodeList&gt;(&amp;globalObject, WTFMove(nodeList));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, NodeList&amp; nodeList)
</del><ins>+JSC::JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;NodeList&gt;&amp;&amp; nodeList)
</ins><span class="cx"> {
</span><del>-    return createWrapper(*globalObject, nodeList);
</del><ins>+    return createWrapper(*globalObject, WTFMove(nodeList));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeListCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeListCustom.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeListCustom.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSNodeListCustom.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -31,11 +31,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-WEBCORE_EXPORT JSC::JSValue createWrapper(JSDOMGlobalObject&amp;, NodeList&amp;);
</del><ins>+WEBCORE_EXPORT JSC::JSValue createWrapper(JSDOMGlobalObject&amp;, Ref&lt;NodeList&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, NodeList&amp; nodeList)
</span><span class="cx"> {
</span><del>-    if (JSC::JSValue existingWrapper = getExistingWrapper&lt;JSNodeList&gt;(globalObject, &amp;nodeList))
</del><ins>+    if (JSC::JSValue existingWrapper = getExistingWrapper&lt;JSNodeList&gt;(globalObject, nodeList))
</ins><span class="cx">         return existingWrapper;
</span><span class="cx">     return createWrapper(*globalObject, nodeList);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSRTCPeerConnectionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSRTCPeerConnectionCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSRTCPeerConnectionCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSRTCPeerConnectionCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">     if (!scriptExecutionContext)
</span><span class="cx">         return throwVMError(exec, createReferenceError(exec, &quot;RTCPeerConnection constructor associated document is unavailable&quot;));
</span><span class="cx"> 
</span><del>-    RefPtr&lt;RTCPeerConnection&gt; peerConnection = RTCPeerConnection::create(*scriptExecutionContext, rtcConfiguration, ec);
</del><ins>+    auto peerConnection = RTCPeerConnection::create(*scriptExecutionContext, rtcConfiguration, ec);
</ins><span class="cx">     if (ec == TYPE_MISMATCH_ERR) {
</span><span class="cx">         setDOMException(exec, ec);
</span><span class="cx">         return throwVMError(exec, createTypeError(exec, &quot;Invalid RTCPeerConnection constructor arguments&quot;));
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">         return throwVMError(exec, createTypeError(exec, &quot;Error creating RTCPeerConnection&quot;));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), RTCPeerConnection, peerConnection.get()));
</del><ins>+    return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), RTCPeerConnection, peerConnection.releaseNonNull()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSRTCSessionDescriptionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSRTCSessionDescriptionCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSRTCSessionDescriptionCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSRTCSessionDescriptionCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec-&gt;callee());
</span><del>-    RefPtr&lt;RTCSessionDescription&gt; sessionDescription = RTCSessionDescription::create(sessionInit, ec);
</del><ins>+    auto sessionDescription = RTCSessionDescription::create(sessionInit, ec);
</ins><span class="cx">     if (ec == TYPE_MISMATCH_ERR) {
</span><span class="cx">         setDOMException(exec, ec);
</span><span class="cx">         return throwVMError(exec, createTypeError(exec, &quot;Invalid RTCSessionDescription constructor arguments&quot;));
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">         return throwVMError(exec, createTypeError(exec, &quot;Error creating RTCSessionDescription&quot;));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), RTCSessionDescription, sessionDescription.get()));
</del><ins>+    return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), RTCSessionDescription, sessionDescription.releaseNonNull()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSSVGPathSegCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -61,51 +61,51 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, SVGPathSeg&amp; object)
</span><span class="cx"> {
</span><del>-    if (JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;object))
</del><ins>+    if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), object))
</ins><span class="cx">         return wrapper;
</span><span class="cx"> 
</span><span class="cx">     switch (object.pathSegType()) {
</span><span class="cx">     case SVGPathSeg::PATHSEG_CLOSEPATH:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegClosePath, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegClosePath, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_MOVETO_ABS:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegMovetoAbs, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegMovetoAbs, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_MOVETO_REL:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegMovetoRel, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegMovetoRel, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_LINETO_ABS:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoAbs, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoAbs, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_LINETO_REL:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoRel, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoRel, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicAbs, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicAbs, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_CURVETO_CUBIC_REL:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicRel, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicRel, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticAbs, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticAbs, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticRel, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticRel, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_ARC_ABS:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegArcAbs, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegArcAbs, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_ARC_REL:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegArcRel, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegArcRel, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoHorizontalAbs, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoHorizontalAbs, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoHorizontalRel, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoHorizontalRel, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoVerticalAbs, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoVerticalAbs, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_LINETO_VERTICAL_REL:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoVerticalRel, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegLinetoVerticalRel, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicSmoothAbs, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicSmoothAbs, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicSmoothRel, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoCubicSmoothRel, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticSmoothAbs, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticSmoothAbs, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticSmoothRel, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSegCurvetoQuadraticSmoothRel, object);
</ins><span class="cx">     case SVGPathSeg::PATHSEG_UNKNOWN:
</span><span class="cx">     default:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, SVGPathSeg, &amp;object);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, SVGPathSeg, object);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSStyleSheetCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSStyleSheetCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSStyleSheetCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSStyleSheetCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -37,13 +37,11 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, StyleSheet&amp; styleSheet)
</span><span class="cx"> {
</span><del>-    if (JSC::JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;styleSheet))
</del><ins>+    if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), styleSheet))
</ins><span class="cx">         return wrapper;
</span><del>-
</del><span class="cx">     if (styleSheet.isCSSStyleSheet())
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, CSSStyleSheet, &amp;styleSheet);
-
-    return CREATE_DOM_WRAPPER(globalObject, StyleSheet, &amp;styleSheet);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, CSSStyleSheet, styleSheet);
+    return CREATE_DOM_WRAPPER(globalObject, StyleSheet, styleSheet);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSTextCustomcppfromrev200933trunkSourceWebCoredomXMLDocumentidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/js/JSTextCustom.cpp (from rev 200933, trunk/Source/WebCore/dom/XMLDocument.idl) (0 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSTextCustom.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSTextCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2016 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. AND ITS CONTRIBUTORS ``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 ITS 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;JSText.h&quot;
+
+#include &quot;JSCDATASection.h&quot;
+
+namespace WebCore {
+
+using namespace JSC;
+
+static inline JSValue createNewTextWrapper(JSDOMGlobalObject&amp; globalObject, Ref&lt;Text&gt;&amp;&amp; text)
+{
+    if (is&lt;CDATASection&gt;(text.get()))
+        return CREATE_DOM_WRAPPER(&amp;globalObject, CDATASection, WTFMove(text));
+    return CREATE_DOM_WRAPPER(&amp;globalObject, Text, WTFMove(text));
+}
+
+JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, Text&amp; text)
+{
+    if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), text))
+        return wrapper;
+    return createNewTextWrapper(*globalObject, text);
+}
+
+JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;Text&gt;&amp;&amp; text)
+{
+    return createNewTextWrapper(*globalObject, WTFMove(text));
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSTextTrackCueCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSTextTrackCueCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -61,18 +61,16 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, TextTrackCue&amp; cue)
</span><span class="cx"> {
</span><del>-    JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;cue);
-
-    if (wrapper)
</del><ins>+    if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), cue))
</ins><span class="cx">         return wrapper;
</span><span class="cx"> 
</span><span class="cx">     // This switch will make more sense once we support DataCue
</span><span class="cx">     switch (cue.cueType()) {
</span><span class="cx">     case TextTrackCue::Data:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, DataCue, &amp;cue);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, DataCue, cue);
</ins><span class="cx">     case TextTrackCue::WebVTT:
</span><span class="cx">     case TextTrackCue::Generic:
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, VTTCue, &amp;cue);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, VTTCue, cue);
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">         return jsNull();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSTrackCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSTrackCustom.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSTrackCustom.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/js/JSTrackCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -62,19 +62,19 @@
</span><span class="cx">         break;
</span><span class="cx">         
</span><span class="cx">     case TrackBase::AudioTrack:
</span><del>-        if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), toAudioTrack(&amp;track)))
</del><ins>+        if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), *toAudioTrack(&amp;track)))
</ins><span class="cx">             return wrapper;
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, AudioTrack, &amp;track);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, AudioTrack, track);
</ins><span class="cx"> 
</span><span class="cx">     case TrackBase::VideoTrack:
</span><del>-        if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), toVideoTrack(&amp;track)))
</del><ins>+        if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), *toVideoTrack(&amp;track)))
</ins><span class="cx">             return wrapper;
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, VideoTrack, &amp;track);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, VideoTrack, track);
</ins><span class="cx"> 
</span><span class="cx">     case TrackBase::TextTrack:
</span><del>-        if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), toTextTrack(&amp;track)))
</del><ins>+        if (auto* wrapper = getCachedWrapper(globalObject-&gt;world(), *toTextTrack(&amp;track)))
</ins><span class="cx">             return wrapper;
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, TextTrack, &amp;track);
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, TextTrack, track);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return jsNull();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSXMLDocumentCustomcppfromrev200933trunkSourceWebCoredomXMLDocumentidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/js/JSXMLDocumentCustom.cpp (from rev 200933, trunk/Source/WebCore/dom/XMLDocument.idl) (0 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSXMLDocumentCustom.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSXMLDocumentCustom.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2016 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. AND ITS CONTRIBUTORS ``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 ITS 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;JSXMLDocument.h&quot;
+
+#include &quot;JSDOMWindow.h&quot;
+#include &quot;JSDocumentCustom.h&quot;
+#include &quot;JSSVGDocument.h&quot;
+#include &quot;NodeTraversal.h&quot;
+
+namespace WebCore {
+
+using namespace JSC;
+
+static inline JSValue createNewXMLDocumentWrapper(ExecState&amp; state, JSDOMGlobalObject&amp; globalObject, Ref&lt;XMLDocument&gt;&amp;&amp; passedDocument)
+{
+    auto&amp; document = passedDocument.get();
+    JSObject* wrapper;
+    if (document.isSVGDocument())
+        wrapper = CREATE_DOM_WRAPPER(&amp;globalObject, SVGDocument, WTFMove(passedDocument));
+    else
+        wrapper = CREATE_DOM_WRAPPER(&amp;globalObject, XMLDocument, WTFMove(passedDocument));
+
+    reportMemoryForDocumentIfFrameless(state, document);
+
+    return wrapper;
+}
+
+JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, XMLDocument&amp; document)
+{
+    if (auto* wrapper = cachedDocumentWrapper(*state, *globalObject, document))
+        return wrapper;
+    return createNewXMLDocumentWrapper(*state, *globalObject, document);
+}
+
+JSValue toJSNewlyCreated(ExecState* state, JSDOMGlobalObject* globalObject, Ref&lt;XMLDocument&gt;&amp;&amp; document)
+{
+    return createNewXMLDocumentWrapper(*state, *globalObject, WTFMove(document));
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -1481,9 +1481,9 @@
</span><span class="cx">         }
</span><span class="cx">         push(@headerContent, &quot;inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, $implType* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }\n&quot;);
</span><span class="cx"> 
</span><del>-        push(@headerContent, &quot;JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, $implType&amp;);\n&quot;);
-        push(@headerContent, &quot;inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, $implType* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }\n&quot;);
-    }
</del><ins>+        push(@headerContent, &quot;JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;$implType&gt;&amp;&amp;);\n&quot;);
+        push(@headerContent, &quot;inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;$implType&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }\n&quot;);
+   }
</ins><span class="cx"> 
</span><span class="cx">     push(@headerContent, &quot;\n&quot;);
</span><span class="cx"> 
</span><span class="lines">@@ -3403,22 +3403,22 @@
</span><span class="cx"> 
</span><span class="cx"> END
</span><span class="cx"> 
</span><del>-        push(@implContent, &quot;JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, $implType&amp; impl)\n&quot;);
</del><ins>+        push(@implContent, &quot;JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;$implType&gt;&amp;&amp; impl)\n&quot;);
</ins><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><span class="cx">         if ($svgPropertyType) {
</span><del>-            push(@implContent, &quot;    return createNewWrapper&lt;$className, $implType&gt;(globalObject, &amp;impl);\n&quot;);
</del><ins>+            push(@implContent, &quot;    return createNewWrapper&lt;$className, $implType&gt;(globalObject, WTFMove(impl));\n&quot;);
</ins><span class="cx">         } else {
</span><del>-            push(@implContent, &quot;    return createNewWrapper&lt;$className&gt;(globalObject, &amp;impl);\n&quot;);
</del><ins>+            push(@implContent, &quot;    return createNewWrapper&lt;$className&gt;(globalObject, WTFMove(impl));\n&quot;);
</ins><span class="cx">         }
</span><span class="cx">         push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx"> 
</span><span class="cx">         push(@implContent, &quot;JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, $implType&amp; impl)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><span class="cx">         if ($svgPropertyType) {
</span><del>-            push(@implContent, &quot;    if (JSValue result = getExistingWrapper&lt;$className, $implType&gt;(globalObject, &amp;impl))\n&quot;);
</del><ins>+            push(@implContent, &quot;    if (JSValue result = getExistingWrapper&lt;$className, $implType&gt;(globalObject, impl))\n&quot;);
</ins><span class="cx">             push(@implContent, &quot;        return result;\n&quot;);
</span><span class="cx">         } else {
</span><del>-            push(@implContent, &quot;    if (JSValue result = getExistingWrapper&lt;$className&gt;(globalObject, &amp;impl))\n&quot;);
</del><ins>+            push(@implContent, &quot;    if (JSValue result = getExistingWrapper&lt;$className&gt;(globalObject, impl))\n&quot;);
</ins><span class="cx">             push(@implContent, &quot;        return result;\n&quot;);
</span><span class="cx">         }
</span><span class="cx">         push(@implContent, &lt;&lt;END) if $vtableNameGnu;
</span><span class="lines">@@ -3455,11 +3455,7 @@
</span><span class="cx">     globalObject-&gt;vm().heap.reportExtraMemoryAllocated(impl.memoryCost());
</span><span class="cx"> END
</span><span class="cx"> 
</span><del>-        if ($svgPropertyType) {
-            push(@implContent, &quot;    return createNewWrapper&lt;$className, $implType&gt;(globalObject, &amp;impl);\n&quot;);
-        } else {
-            push(@implContent, &quot;    return createNewWrapper&lt;$className&gt;(globalObject, &amp;impl);\n&quot;);
-        }
</del><ins>+        push(@implContent, &quot;    return createNewWrapper&lt;$className, $implType&gt;(globalObject, impl);\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">         push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -250,14 +250,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestActiveDOMObject&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestActiveDOMObject&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestActiveDOMObject&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestActiveDOMObject&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestActiveDOMObject&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestActiveDOMObject&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestActiveDOMObject&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestActiveDOMObject&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestActiveDOMObject, TestActiveDOMObject&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestActiveDOMObject* JSTestActiveDOMObject::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -84,8 +84,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestActiveDOMObject&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestActiveDOMObject* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestActiveDOMObject&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestActiveDOMObject* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestActiveDOMObject&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestActiveDOMObject&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestClassWithJSBuiltinConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -176,14 +176,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestClassWithJSBuiltinConstructor&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestClassWithJSBuiltinConstructor&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestClassWithJSBuiltinConstructor&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestClassWithJSBuiltinConstructor&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestClassWithJSBuiltinConstructor&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestClassWithJSBuiltinConstructor&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestClassWithJSBuiltinConstructor&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestClassWithJSBuiltinConstructor&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestClassWithJSBuiltinConstructor, TestClassWithJSBuiltinConstructor&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestClassWithJSBuiltinConstructor* JSTestClassWithJSBuiltinConstructor::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestClassWithJSBuiltinConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -83,8 +83,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestClassWithJSBuiltinConstructor&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestClassWithJSBuiltinConstructor* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestClassWithJSBuiltinConstructor&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestClassWithJSBuiltinConstructor* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestClassWithJSBuiltinConstructor&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestClassWithJSBuiltinConstructor&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -166,14 +166,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestCustomConstructorWithNoInterfaceObject&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestCustomConstructorWithNoInterfaceObject&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestCustomConstructorWithNoInterfaceObject&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestCustomConstructorWithNoInterfaceObject&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestCustomConstructorWithNoInterfaceObject&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestCustomConstructorWithNoInterfaceObject&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestCustomConstructorWithNoInterfaceObject&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestCustomConstructorWithNoInterfaceObject&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestCustomConstructorWithNoInterfaceObject, TestCustomConstructorWithNoInterfaceObject&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestCustomConstructorWithNoInterfaceObject* JSTestCustomConstructorWithNoInterfaceObject::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -80,8 +80,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCustomConstructorWithNoInterfaceObject&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCustomConstructorWithNoInterfaceObject* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestCustomConstructorWithNoInterfaceObject&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCustomConstructorWithNoInterfaceObject* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestCustomConstructorWithNoInterfaceObject&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestCustomConstructorWithNoInterfaceObject&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> // Custom constructor
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL constructJSTestCustomConstructorWithNoInterfaceObject(JSC::ExecState*);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGettercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -223,14 +223,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestCustomNamedGetter&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestCustomNamedGetter&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestCustomNamedGetter&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestCustomNamedGetter&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestCustomNamedGetter&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestCustomNamedGetter&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestCustomNamedGetter&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -251,7 +251,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestCustomNamedGetter&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestCustomNamedGetter, TestCustomNamedGetter&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestCustomNamedGetter* JSTestCustomNamedGetter::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGetterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -87,8 +87,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCustomNamedGetter&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCustomNamedGetter* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestCustomNamedGetter&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestCustomNamedGetter* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestCustomNamedGetter&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestCustomNamedGetter&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -271,14 +271,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestEventConstructor&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestEventConstructor&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestEventConstructor&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestEventConstructor&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestEventConstructor&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestEventConstructor&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestEventConstructor&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -299,7 +299,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestEventConstructor&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestEventConstructor, TestEventConstructor&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestEventConstructor* JSTestEventConstructor::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -83,8 +83,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventConstructor&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestEventConstructor* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestEventConstructor&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestEventConstructor* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestEventConstructor&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestEventConstructor&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> bool fillTestEventConstructorInit(TestEventConstructorInit&amp;, JSDictionary&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -230,14 +230,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestEventTarget&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestEventTarget&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestEventTarget&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestEventTarget&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestEventTarget&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestEventTarget&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestEventTarget&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -258,7 +258,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestEventTarget&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestEventTarget, TestEventTarget&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestEventTarget* JSTestEventTarget::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -76,8 +76,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventTarget&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestEventTarget* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestEventTarget&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestEventTarget* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestEventTarget&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestEventTarget&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestExceptioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -204,14 +204,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestException&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestException&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestException&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestException&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestException&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestException&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestException&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -232,7 +232,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestException&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestException, TestException&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestException* JSTestException::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestExceptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -85,8 +85,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestException&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestException* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestException&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestException* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestException&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestException&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGenerateIsReachablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -163,14 +163,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestGenerateIsReachable&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestGenerateIsReachable&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestGenerateIsReachable&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestGenerateIsReachable&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestGenerateIsReachable&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestGenerateIsReachable&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestGenerateIsReachable&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -191,7 +191,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestGenerateIsReachable&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestGenerateIsReachable, TestGenerateIsReachable&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestGenerateIsReachable* JSTestGenerateIsReachable::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGenerateIsReachableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -81,8 +81,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestGenerateIsReachable&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestGenerateIsReachable* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestGenerateIsReachable&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestGenerateIsReachable* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestGenerateIsReachable&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestGenerateIsReachable&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -345,14 +345,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestGlobalObject&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestGlobalObject&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestGlobalObject&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestGlobalObject&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestGlobalObject&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestGlobalObject&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestGlobalObject&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -373,7 +373,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestGlobalObject&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestGlobalObject, TestGlobalObject&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestGlobalObject* JSTestGlobalObject::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -87,8 +87,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestGlobalObject&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestGlobalObject* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestGlobalObject&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestGlobalObject* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestGlobalObject&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestGlobalObject&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> class JSTestGlobalObjectPrototype : public JSC::JSNonFinalObject {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -915,14 +915,14 @@
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestInterface-&gt;wrapped(), jsTestInterface);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestInterface&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestInterface&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestInterface&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestInterface&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestInterface&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestInterface&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestInterface&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> #if COMPILER(CLANG)
</span><span class="cx">     // If you hit this failure the interface definition has the ImplementationLacksVTable
</span><span class="lines">@@ -931,7 +931,7 @@
</span><span class="cx">     // attribute to TestInterface.
</span><span class="cx">     static_assert(!__is_polymorphic(TestInterface), &quot;TestInterface is polymorphic but the IDL claims it is not&quot;);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestInterface&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestInterface, TestInterface&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestInterface* JSTestInterface::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -108,8 +108,8 @@
</span><span class="cx"> 
</span><span class="cx"> WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestInterface&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestInterface* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestInterface&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestInterface* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestInterface&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestInterface&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestMediaQueryListListenercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -188,14 +188,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestMediaQueryListListener&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestMediaQueryListListener&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestMediaQueryListListener&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestMediaQueryListListener&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestMediaQueryListListener&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestMediaQueryListListener&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestMediaQueryListListener&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestMediaQueryListListener&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestMediaQueryListListener, TestMediaQueryListListener&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestMediaQueryListListener* JSTestMediaQueryListListener::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestMediaQueryListListenerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -81,8 +81,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestMediaQueryListListener&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestMediaQueryListListener* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestMediaQueryListListener&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestMediaQueryListListener* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestMediaQueryListListener&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestMediaQueryListListener&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -211,14 +211,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestNamedConstructor&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestNamedConstructor&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestNamedConstructor&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestNamedConstructor&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestNamedConstructor&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestNamedConstructor&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestNamedConstructor&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -239,7 +239,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestNamedConstructor&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestNamedConstructor, TestNamedConstructor&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestNamedConstructor* JSTestNamedConstructor::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -82,8 +82,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNamedConstructor&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedConstructor* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestNamedConstructor&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedConstructor* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestNamedConstructor&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestNamedConstructor&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -472,14 +472,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestNondeterministic&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestNondeterministic&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestNondeterministic&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestNondeterministic&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestNondeterministic&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestNondeterministic&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestNondeterministic&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -500,7 +500,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestNondeterministic&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestNondeterministic, TestNondeterministic&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestNondeterministic* JSTestNondeterministic::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministich"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -81,8 +81,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestNondeterministic&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNondeterministic* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestNondeterministic&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNondeterministic* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestNondeterministic&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestNondeterministic&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -6227,14 +6227,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestObj&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestObj&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestObj&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestObj&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestObj&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestObj&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestObj&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -6255,7 +6255,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestObj&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestObj, TestObj&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestObj* JSTestObj::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -99,8 +99,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestObj&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestObj* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestObj&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestObj* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestObj&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestObj&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -247,14 +247,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestOverloadedConstructors&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestOverloadedConstructors&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestOverloadedConstructors&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestOverloadedConstructors&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestOverloadedConstructors&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestOverloadedConstructors&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestOverloadedConstructors&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -275,7 +275,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestOverloadedConstructors&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestOverloadedConstructors, TestOverloadedConstructors&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestOverloadedConstructors* JSTestOverloadedConstructors::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -81,8 +81,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverloadedConstructors&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestOverloadedConstructors* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestOverloadedConstructors&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestOverloadedConstructors* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestOverloadedConstructors&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestOverloadedConstructors&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -230,14 +230,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestOverrideBuiltins&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestOverrideBuiltins&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestOverrideBuiltins&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestOverrideBuiltins&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestOverrideBuiltins&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestOverrideBuiltins&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestOverrideBuiltins&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -258,7 +258,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestOverrideBuiltins&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestOverrideBuiltins, TestOverrideBuiltins&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestOverrideBuiltins* JSTestOverrideBuiltins::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -88,8 +88,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverrideBuiltins&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestOverrideBuiltins* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestOverrideBuiltins&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestOverrideBuiltins* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestOverrideBuiltins&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestOverrideBuiltins&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -305,14 +305,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestSerializedScriptValueInterface&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestSerializedScriptValueInterface&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestSerializedScriptValueInterface&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestSerializedScriptValueInterface&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestSerializedScriptValueInterface&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -333,7 +333,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestSerializedScriptValueInterface&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestSerializedScriptValueInterface, TestSerializedScriptValueInterface&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestSerializedScriptValueInterface* JSTestSerializedScriptValueInterface::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -87,8 +87,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestSerializedScriptValueInterface&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestSerializedScriptValueInterface&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestSerializedScriptValueInterface&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestSerializedScriptValueInterface&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -660,14 +660,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestTypedefs&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;TestTypedefs&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSTestTypedefs&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestTypedefs&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestTypedefs&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSTestTypedefs&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSTestTypedefs&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -688,7 +688,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSTestTypedefs&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSTestTypedefs, TestTypedefs&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TestTypedefs* JSTestTypedefs::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -84,8 +84,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestTypedefs&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestTypedefs* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestTypedefs&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestTypedefs* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;TestTypedefs&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestTypedefs&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSattributecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -204,14 +204,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, attribute&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;attribute&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSattribute&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSattribute&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, attribute&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSattribute&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSattribute&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span><span class="lines">@@ -232,7 +232,7 @@
</span><span class="cx">     // by adding the SkipVTableValidation attribute to the interface IDL definition
</span><span class="cx">     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSattribute&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSattribute, attribute&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> attribute* JSattribute::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSattributeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -85,8 +85,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, attribute&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, attribute* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, attribute&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, attribute* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;attribute&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;attribute&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSreadonlycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -154,14 +154,14 @@
</span><span class="cx">     uncacheWrapper(world, &amp;jsreadonly-&gt;wrapped(), jsreadonly);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, readonly&amp; impl)
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref&lt;readonly&gt;&amp;&amp; impl)
</ins><span class="cx"> {
</span><del>-    return createNewWrapper&lt;JSreadonly&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSreadonly&gt;(globalObject, WTFMove(impl));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, readonly&amp; impl)
</span><span class="cx"> {
</span><del>-    if (JSValue result = getExistingWrapper&lt;JSreadonly&gt;(globalObject, &amp;impl))
</del><ins>+    if (JSValue result = getExistingWrapper&lt;JSreadonly&gt;(globalObject, impl))
</ins><span class="cx">         return result;
</span><span class="cx"> #if COMPILER(CLANG)
</span><span class="cx">     // If you hit this failure the interface definition has the ImplementationLacksVTable
</span><span class="lines">@@ -170,7 +170,7 @@
</span><span class="cx">     // attribute to readonly.
</span><span class="cx">     static_assert(!__is_polymorphic(readonly), &quot;readonly is polymorphic but the IDL claims it is not&quot;);
</span><span class="cx"> #endif
</span><del>-    return createNewWrapper&lt;JSreadonly&gt;(globalObject, &amp;impl);
</del><ins>+    return createNewWrapper&lt;JSreadonly, readonly&gt;(globalObject, impl);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> readonly* JSreadonly::toWrapped(JSC::JSValue value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSreadonlyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -81,8 +81,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, readonly&amp;);
</span><span class="cx"> inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, readonly* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
</span><del>-JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, readonly&amp;);
-inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, readonly* impl) { return impl ? toJSNewlyCreated(state, globalObject, *impl) : JSC::jsNull(); }
</del><ins>+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref&lt;readonly&gt;&amp;&amp;);
+inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;readonly&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/dom/Element.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -2384,7 +2384,7 @@
</span><span class="cx">         ContainerNode* container = this;
</span><span class="cx"> 
</span><span class="cx">         if (is&lt;HTMLTemplateElement&gt;(*this))
</span><del>-            container = downcast&lt;HTMLTemplateElement&gt;(*this).content();
</del><ins>+            container = &amp;downcast&lt;HTMLTemplateElement&gt;(*this).content();
</ins><span class="cx"> 
</span><span class="cx">         replaceChildrenWithFragment(*container, fragment.releaseNonNull(), ec);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.idl (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.idl        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/dom/Element.idl        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -19,6 +19,7 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><ins>+    CustomToJSObject,
</ins><span class="cx">     JSCustomHeader,
</span><span class="cx">     JSGenerateToNativeObject,
</span><span class="cx">     ExportMacro=WEBCORE_EXPORT,
</span></span></pre></div>
<a id="trunkSourceWebCoredomTextidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Text.idl (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Text.idl        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/dom/Text.idl        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -18,7 +18,8 @@
</span><span class="cx">  */
</span><span class="cx"> [
</span><span class="cx">     Constructor(optional DOMString data),
</span><del>-    ConstructorCallWith=Document
</del><ins>+    ConstructorCallWith=Document,
+    CustomToJSObject,
</ins><span class="cx"> ] interface Text : CharacterData {
</span><span class="cx"> 
</span><span class="cx">     // DOM Level 1
</span></span></pre></div>
<a id="trunkSourceWebCoredomXMLDocumentidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/XMLDocument.idl (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/XMLDocument.idl        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/dom/XMLDocument.idl        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -22,7 +22,8 @@
</span><span class="cx">  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><del>-
-interface XMLDocument : Document
</del><ins>+[
+    CustomToJSObject,
+] interface XMLDocument : Document
</ins><span class="cx"> {
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoredommake_namespl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/make_names.pl (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/make_names.pl        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/dom/make_names.pl        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -1170,22 +1170,22 @@
</span><span class="cx"> 
</span><span class="cx">         if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) {
</span><span class="cx">             print F &lt;&lt;END
</span><del>-static JSDOMObject* create${JSInterfaceName}Wrapper(JSDOMGlobalObject* globalObject, PassRefPtr&lt;$parameters{namespace}Element&gt; element)
</del><ins>+static JSDOMObject* create${JSInterfaceName}Wrapper(JSDOMGlobalObject* globalObject, Ref&lt;$parameters{namespace}Element&gt;&amp;&amp; element)
</ins><span class="cx"> {
</span><span class="cx">     if (element-&gt;is$parameters{fallbackInterfaceName}())
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, $parameters{fallbackInterfaceName}, element.get());
-    return CREATE_DOM_WRAPPER(globalObject, ${JSInterfaceName}, element.get());
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, $parameters{fallbackInterfaceName}, WTFMove(element));
+    return CREATE_DOM_WRAPPER(globalObject, ${JSInterfaceName}, WTFMove(element));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> END
</span><span class="cx">             ;
</span><span class="cx">         } elsif ($enabledTags{$tagName}{settingsConditional}) {
</span><span class="cx">             print F &lt;&lt;END
</span><del>-static JSDOMObject* create$enabledTags{$tagName}{interfaceName}Wrapper(JSDOMGlobalObject* globalObject, PassRefPtr&lt;$parameters{namespace}Element&gt; element)
</del><ins>+static JSDOMObject* create$enabledTags{$tagName}{interfaceName}Wrapper(JSDOMGlobalObject* globalObject, Ref&lt;$parameters{namespace}Element&gt;&amp;&amp; element)
</ins><span class="cx"> {
</span><span class="cx">     if (element-&gt;is$parameters{fallbackInterfaceName}())
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, $parameters{fallbackInterfaceName}, element.get());
-    return CREATE_DOM_WRAPPER(globalObject, ${JSInterfaceName}, element.get());
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, $parameters{fallbackInterfaceName}, WTFMove(element));
+    return CREATE_DOM_WRAPPER(globalObject, ${JSInterfaceName}, WTFMove(element));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> END
</span><span class="lines">@@ -1193,22 +1193,22 @@
</span><span class="cx">         } elsif ($enabledTags{$tagName}{runtimeConditional}) {
</span><span class="cx">             my $runtimeConditional = $enabledTags{$tagName}{runtimeConditional};
</span><span class="cx">             print F &lt;&lt;END
</span><del>-static JSDOMObject* create${JSInterfaceName}Wrapper(JSDOMGlobalObject* globalObject, PassRefPtr&lt;$parameters{namespace}Element&gt; element)
</del><ins>+static JSDOMObject* create${JSInterfaceName}Wrapper(JSDOMGlobalObject* globalObject, Ref&lt;$parameters{namespace}Element&gt;&amp;&amp; element)
</ins><span class="cx"> {
</span><span class="cx">     if (!RuntimeEnabledFeatures::sharedFeatures().${runtimeConditional}Enabled()) {
</span><del>-        ASSERT(!element || element-&gt;is$parameters{fallbackInterfaceName}());
-        return CREATE_DOM_WRAPPER(globalObject, $parameters{fallbackJSInterfaceName}, element.get());
</del><ins>+        ASSERT(element-&gt;is$parameters{fallbackInterfaceName}());
+        return CREATE_DOM_WRAPPER(globalObject, $parameters{fallbackJSInterfaceName}, WTFMove(element));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return CREATE_DOM_WRAPPER(globalObject, ${JSInterfaceName}, element.get());
</del><ins>+    return CREATE_DOM_WRAPPER(globalObject, ${JSInterfaceName}, WTFMove(element));
</ins><span class="cx"> }
</span><span class="cx"> END
</span><span class="cx">     ;
</span><span class="cx">         } else {
</span><span class="cx">             print F &lt;&lt;END
</span><del>-static JSDOMObject* create${JSInterfaceName}Wrapper(JSDOMGlobalObject* globalObject, PassRefPtr&lt;$parameters{namespace}Element&gt; element)
</del><ins>+static JSDOMObject* create${JSInterfaceName}Wrapper(JSDOMGlobalObject* globalObject, Ref&lt;$parameters{namespace}Element&gt;&amp;&amp; element)
</ins><span class="cx"> {
</span><del>-    return CREATE_DOM_WRAPPER(globalObject, ${JSInterfaceName}, element.get());
</del><ins>+    return CREATE_DOM_WRAPPER(globalObject, ${JSInterfaceName}, WTFMove(element));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> END
</span><span class="lines">@@ -1259,7 +1259,7 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace $parameters{namespace}Names;
</span><span class="cx"> 
</span><del>-typedef JSDOMObject* (*Create$parameters{namespace}ElementWrapperFunction)(JSDOMGlobalObject*, PassRefPtr&lt;$parameters{namespace}Element&gt;);
</del><ins>+typedef JSDOMObject* (*Create$parameters{namespace}ElementWrapperFunction)(JSDOMGlobalObject*, Ref&lt;$parameters{namespace}Element&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx"> END
</span><span class="cx"> ;
</span><span class="lines">@@ -1310,13 +1310,13 @@
</span><span class="cx">         map.add(table[i].name.localName().impl(), table[i].function);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSDOMObject* createJS$parameters{namespace}Wrapper(JSDOMGlobalObject* globalObject, PassRefPtr&lt;$parameters{namespace}Element&gt; element)
</del><ins>+JSDOMObject* createJS$parameters{namespace}Wrapper(JSDOMGlobalObject* globalObject, Ref&lt;$parameters{namespace}Element&gt;&amp;&amp; element)
</ins><span class="cx"> {
</span><span class="cx">     static NeverDestroyed&lt;HashMap&lt;AtomicStringImpl*, Create$parameters{namespace}ElementWrapperFunction&gt;&gt; functions;
</span><span class="cx">     if (functions.get().isEmpty())
</span><span class="cx">         populate$parameters{namespace}WrapperMap(functions);
</span><span class="cx">     if (auto function = functions.get().get(element-&gt;localName().impl()))
</span><del>-        return function(globalObject, element);
</del><ins>+        return function(globalObject, WTFMove(element));
</ins><span class="cx"> END
</span><span class="cx"> ;
</span><span class="cx"> 
</span><span class="lines">@@ -1324,14 +1324,14 @@
</span><span class="cx">         print F &lt;&lt;END
</span><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><span class="cx">     if (element-&gt;isUnresolvedCustomElement())
</span><del>-        return CREATE_DOM_WRAPPER(globalObject, $parameters{customElementInterfaceName}, element.get());
</del><ins>+        return CREATE_DOM_WRAPPER(globalObject, $parameters{customElementInterfaceName}, WTFMove(element));
</ins><span class="cx"> #endif
</span><span class="cx"> END
</span><span class="cx"> ;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     print F &lt;&lt;END
</span><del>-    return CREATE_DOM_WRAPPER(globalObject, $parameters{fallbackJSInterfaceName}, element.get());
</del><ins>+    return CREATE_DOM_WRAPPER(globalObject, $parameters{fallbackJSInterfaceName}, WTFMove(element));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="lines">@@ -1366,7 +1366,7 @@
</span><span class="cx">     class JSDOMGlobalObject;
</span><span class="cx">     class $parameters{namespace}Element;
</span><span class="cx"> 
</span><del>-    JSDOMObject* createJS$parameters{namespace}Wrapper(JSDOMGlobalObject*, PassRefPtr&lt;$parameters{namespace}Element&gt;);
</del><ins>+    JSDOMObject* createJS$parameters{namespace}Wrapper(JSDOMGlobalObject*, Ref&lt;$parameters{namespace}Element&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx">  
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingMarkupAccumulatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/MarkupAccumulator.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/MarkupAccumulator.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/editing/MarkupAccumulator.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx">         appendStartTag(targetNode, &amp;namespaceHash);
</span><span class="cx"> 
</span><span class="cx">     if (!(targetNode.document().isHTMLDocument() &amp;&amp; elementCannotHaveEndTag(targetNode))) {
</span><del>-        Node* current = targetNode.hasTagName(templateTag) ? downcast&lt;HTMLTemplateElement&gt;(targetNode).content()-&gt;firstChild() : targetNode.firstChild();
</del><ins>+        Node* current = targetNode.hasTagName(templateTag) ? downcast&lt;HTMLTemplateElement&gt;(targetNode).content().firstChild() : targetNode.firstChild();
</ins><span class="cx">         for ( ; current; current = current-&gt;nextSibling())
</span><span class="cx">             serializeNodesWithNamespaces(*current, IncludeNode, &amp;namespaceHash, tagNamesToSkip);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLDocumentidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLDocument.idl (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLDocument.idl        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/html/HTMLDocument.idl        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> [
</span><span class="cx">     CustomGetOwnPropertySlot,
</span><span class="cx">     CustomNamedGetter,
</span><ins>+    CustomToJSObject,
</ins><span class="cx">     NewImpurePropertyFiresWatchpoints,
</span><span class="cx">     OverrideBuiltins,
</span><span class="cx"> ] interface HTMLDocument : Document {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTemplateElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTemplateElement.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTemplateElement.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/html/HTMLTemplateElement.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -58,12 +58,12 @@
</span><span class="cx">     return adoptRef(*new HTMLTemplateElement(tagName, document));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-DocumentFragment* HTMLTemplateElement::content() const
</del><ins>+DocumentFragment&amp; HTMLTemplateElement::content() const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_content)
</span><span class="cx">         m_content = TemplateContentDocumentFragment::create(document().ensureTemplateDocument(), this);
</span><span class="cx"> 
</span><del>-    return m_content.get();
</del><ins>+    return *m_content;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;Node&gt; HTMLTemplateElement::cloneNodeInternal(Document&amp; targetDocument, CloningOperation type)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     if (m_content)
</span><del>-        content()-&gt;cloneChildNodes(*downcast&lt;HTMLTemplateElement&gt;(clone.get())-&gt;content());
</del><ins>+        content().cloneChildNodes(downcast&lt;HTMLTemplateElement&gt;(clone.get())-&gt;content());
</ins><span class="cx">     return clone.releaseNonNull();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTemplateElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTemplateElement.h (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTemplateElement.h        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/html/HTMLTemplateElement.h        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     static Ref&lt;HTMLTemplateElement&gt; create(const QualifiedName&amp;, Document&amp;);
</span><span class="cx">     virtual ~HTMLTemplateElement();
</span><span class="cx"> 
</span><del>-    DocumentFragment* content() const;
</del><ins>+    DocumentFragment&amp; content() const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     HTMLTemplateElement(const QualifiedName&amp;, Document&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLConstructionSitecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx"> static inline void insert(HTMLConstructionSiteTask&amp; task)
</span><span class="cx"> {
</span><span class="cx">     if (is&lt;HTMLTemplateElement&gt;(*task.parent))
</span><del>-        task.parent = downcast&lt;HTMLTemplateElement&gt;(*task.parent).content();
</del><ins>+        task.parent = &amp;downcast&lt;HTMLTemplateElement&gt;(*task.parent).content();
</ins><span class="cx"> 
</span><span class="cx">     if (ContainerNode* parent = task.child-&gt;parentNode())
</span><span class="cx">         parent-&gt;parserRemoveChild(*task.child);
</span><span class="lines">@@ -558,7 +558,7 @@
</span><span class="cx">         findFosterSite(task);
</span><span class="cx"> 
</span><span class="cx">     if (is&lt;HTMLTemplateElement&gt;(*task.parent))
</span><del>-        task.parent = downcast&lt;HTMLTemplateElement&gt;(*task.parent).content();
</del><ins>+        task.parent = &amp;downcast&lt;HTMLTemplateElement&gt;(*task.parent).content();
</ins><span class="cx"> 
</span><span class="cx">     // Strings composed entirely of whitespace are likely to be repeated.
</span><span class="cx">     // Turn them into AtomicString so we share a single string for each.
</span><span class="lines">@@ -641,7 +641,7 @@
</span><span class="cx"> inline Document&amp; HTMLConstructionSite::ownerDocumentForCurrentNode()
</span><span class="cx"> {
</span><span class="cx">     if (is&lt;HTMLTemplateElement&gt;(currentNode()))
</span><del>-        return downcast&lt;HTMLTemplateElement&gt;(currentNode()).content()-&gt;document();
</del><ins>+        return downcast&lt;HTMLTemplateElement&gt;(currentNode()).content().document();
</ins><span class="cx">     return currentNode().document();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDOMAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -1360,7 +1360,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (is&lt;HTMLTemplateElement&gt;(element))
</span><del>-            value-&gt;setTemplateContent(buildObjectForNode(downcast&lt;HTMLTemplateElement&gt;(element).content(), 0, nodesMap));
</del><ins>+            value-&gt;setTemplateContent(buildObjectForNode(&amp;downcast&lt;HTMLTemplateElement&gt;(element).content(), 0, nodesMap));
</ins><span class="cx"> 
</span><span class="cx">         if (is&lt;HTMLStyleElement&gt;(element) || (is&lt;HTMLScriptElement&gt;(element) &amp;&amp; !element.fastHasAttribute(HTMLNames::srcAttr)))
</span><span class="cx">             value-&gt;setContentSecurityPolicyHash(computeContentSecurityPolicySHA256Hash(element));
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (200933 => 200934)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2016-05-15 23:08:21 UTC (rev 200933)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2016-05-15 23:30:11 UTC (rev 200934)
</span><span class="lines">@@ -849,7 +849,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (is&lt;HTMLTemplateElement&gt;(newElement))
</span><del>-        pushCurrentNode(downcast&lt;HTMLTemplateElement&gt;(newElement.get()).content());
</del><ins>+        pushCurrentNode(&amp;downcast&lt;HTMLTemplateElement&gt;(newElement.get()).content());
</ins><span class="cx">     else
</span><span class="cx">         pushCurrentNode(newElement.ptr());
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>