<!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>[200287] trunk/Source/WebCore</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/200287">200287</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-04-29 21:51:31 -0700 (Fri, 29 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Get rid of unnecessary null check in wrap(JSDOMGlobalObject*, DOMClass*)
https://bugs.webkit.org/show_bug.cgi?id=157224

Reviewed by Ryosuke Niwa.

Get rid of unnecessary null check in wrap(JSDOMGlobalObject*, DOMClass*)
since all the call sites already do a null check. Also update the function
to take the implementation object by reference instead of pointer. Finally,
use is&lt;&gt;() / downcast&lt;&gt;() more at the call sites.

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::deleteFunction):
(WebCore::IDBCursor::setGetResult):
* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::isKeyCursorWithValue):
(WebCore::IDBCursor::isKeyCursor): Deleted.
* Modules/indexeddb/IDBCursorWithValue.h:
(isType):
* bindings/js/JSBlobCustom.cpp:
(WebCore::toJS):
* bindings/js/JSCanvasRenderingContextCustom.cpp:
(WebCore::toJS):
* bindings/js/JSDOMBinding.h:
(WebCore::wrap):
* bindings/js/JSIDBCursorCustom.cpp:
(WebCore::toJS):
* bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
(WebCore::toJS):
* bindings/js/JSPerformanceEntryCustom.cpp:
(WebCore::toJS):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.h:
* page/PerformanceMark.h:
(isType):
(WebCore::PerformanceMark::isMark): Deleted.
* page/PerformanceMeasure.h:
(isType):
(WebCore::PerformanceMeasure::isMeasure): Deleted.
* page/PerformanceResourceTiming.h:
(isType):
(WebCore::PerformanceResourceTiming::isResource): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorcpp">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorh">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorWithValueh">trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBlobCustomcpp">trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCanvasRenderingContextCustomcpp">trunk/Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSIDBCursorCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMediaStreamCapabilitiesCustomcpp">trunk/Source/WebCore/bindings/js/JSMediaStreamCapabilitiesCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSPerformanceEntryCustomcpp">trunk/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGL2RenderingContexth">trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h</a></li>
<li><a href="#trunkSourceWebCorehtmlcanvasWebGLRenderingContexth">trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceEntryh">trunk/Source/WebCore/page/PerformanceEntry.h</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceMarkh">trunk/Source/WebCore/page/PerformanceMark.h</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceMeasureh">trunk/Source/WebCore/page/PerformanceMeasure.h</a></li>
<li><a href="#trunkSourceWebCorepagePerformanceResourceTimingh">trunk/Source/WebCore/page/PerformanceResourceTiming.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/ChangeLog        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -1,5 +1,50 @@
</span><span class="cx"> 2016-04-29  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Get rid of unnecessary null check in wrap(JSDOMGlobalObject*, DOMClass*)
+        https://bugs.webkit.org/show_bug.cgi?id=157224
+
+        Reviewed by Ryosuke Niwa.
+
+        Get rid of unnecessary null check in wrap(JSDOMGlobalObject*, DOMClass*)
+        since all the call sites already do a null check. Also update the function
+        to take the implementation object by reference instead of pointer. Finally,
+        use is&lt;&gt;() / downcast&lt;&gt;() more at the call sites.
+
+        * Modules/indexeddb/IDBCursor.cpp:
+        (WebCore::IDBCursor::update):
+        (WebCore::IDBCursor::deleteFunction):
+        (WebCore::IDBCursor::setGetResult):
+        * Modules/indexeddb/IDBCursor.h:
+        (WebCore::IDBCursor::isKeyCursorWithValue):
+        (WebCore::IDBCursor::isKeyCursor): Deleted.
+        * Modules/indexeddb/IDBCursorWithValue.h:
+        (isType):
+        * bindings/js/JSBlobCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSCanvasRenderingContextCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::wrap):
+        * bindings/js/JSIDBCursorCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSPerformanceEntryCustom.cpp:
+        (WebCore::toJS):
+        * html/canvas/WebGL2RenderingContext.h:
+        * html/canvas/WebGLRenderingContext.h:
+        * page/PerformanceMark.h:
+        (isType):
+        (WebCore::PerformanceMark::isMark): Deleted.
+        * page/PerformanceMeasure.h:
+        (isType):
+        (WebCore::PerformanceMeasure::isMeasure): Deleted.
+        * page/PerformanceResourceTiming.h:
+        (isType):
+        (WebCore::PerformanceResourceTiming::isResource): Deleted.
+
+2016-04-29  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Use LIKELY() / UNLIKELY() hints when suitable in the JavaScript bindings
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=157210
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -187,7 +187,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (isKeyCursor()) {
</del><ins>+    if (!isKeyCursorWithValue()) {
</ins><span class="cx">         ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="cx">         ec.message = ASCIILiteral(&quot;Failed to execute 'update' on 'IDBCursor': The cursor is a key cursor.&quot;);
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -350,7 +350,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (isKeyCursor()) {
</del><ins>+    if (!isKeyCursorWithValue()) {
</ins><span class="cx">         ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="cx">         ec.message = ASCIILiteral(&quot;Failed to execute 'delete' on 'IDBCursor': The cursor is a key cursor.&quot;);
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -393,10 +393,10 @@
</span><span class="cx">     m_currentPrimaryKey = { vm, idbKeyDataToScriptValue(*context, getResult.primaryKeyData()) };
</span><span class="cx">     m_currentPrimaryKeyData = getResult.primaryKeyData();
</span><span class="cx"> 
</span><del>-    if (isKeyCursor())
</del><ins>+    if (isKeyCursorWithValue())
+        m_currentValue = { vm, deserializeIDBValueToJSValue(*context, getResult.value()) };
+    else
</ins><span class="cx">         m_currentValue = { };
</span><del>-    else
-        m_currentValue = { vm, deserializeIDBValueToJSValue(*context, getResult.value()) };
</del><span class="cx"> 
</span><span class="cx">     m_gotValue = true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> 
</span><span class="cx">     void setGetResult(IDBRequest&amp;, const IDBGetResult&amp;);
</span><span class="cx"> 
</span><del>-    virtual bool isKeyCursor() const { return true; }
</del><ins>+    virtual bool isKeyCursorWithValue() const { return false; }
</ins><span class="cx"> 
</span><span class="cx">     void decrementOutstandingRequestCount();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorWithValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IDBCursor.h&quot;
</span><ins>+#include &lt;wtf/TypeCasts.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -38,7 +39,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual ~IDBCursorWithValue();
</span><span class="cx"> 
</span><del>-    bool isKeyCursor() const final { return false; }
</del><ins>+    bool isKeyCursorWithValue() const  override { return true; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     IDBCursorWithValue(IDBTransaction&amp;, IDBObjectStore&amp;, const IDBCursorInfo&amp;);
</span><span class="lines">@@ -47,4 +48,8 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::IDBCursorWithValue)
+    static bool isType(const WebCore::IDBCursor&amp; cursor) { return cursor.isKeyCursorWithValue(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBlobCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -53,10 +53,10 @@
</span><span class="cx">     if (!blob)
</span><span class="cx">         return jsNull();
</span><span class="cx"> 
</span><del>-    if (blob-&gt;isFile())
-        return wrap&lt;JSFile&gt;(globalObject, static_cast&lt;File*&gt;(blob));
</del><ins>+    if (is&lt;File&gt;(*blob))
+        return wrap&lt;JSFile&gt;(globalObject, downcast&lt;File&gt;(*blob));
</ins><span class="cx"> 
</span><del>-    return wrap&lt;JSBlob&gt;(globalObject, blob);
</del><ins>+    return wrap&lt;JSBlob&gt;(globalObject, *blob);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL constructJSBlob(ExecState* exec)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCanvasRenderingContextCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -53,15 +53,14 @@
</span><span class="cx">         return jsNull();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEBGL)
</span><del>-    if (object-&gt;isWebGL1())
-        return wrap&lt;JSWebGLRenderingContext&gt;(globalObject, static_cast&lt;WebGLRenderingContext*&gt;(object));
</del><ins>+    if (is&lt;WebGLRenderingContext&gt;(*object))
+        return wrap&lt;JSWebGLRenderingContext&gt;(globalObject, downcast&lt;WebGLRenderingContext&gt;(*object));
</ins><span class="cx"> #if ENABLE(WEBGL2)
</span><del>-    if (object-&gt;isWebGL2())
-        return wrap&lt;JSWebGL2RenderingContext&gt;(globalObject, static_cast&lt;WebGL2RenderingContext*&gt;(object));
</del><ins>+    if (is&lt;WebGL2RenderingContext&gt;(*object))
+        return wrap&lt;JSWebGL2RenderingContext&gt;(globalObject, downcast&lt;WebGL2RenderingContext&gt;(*object));
</ins><span class="cx"> #endif
</span><span class="cx"> #endif
</span><del>-    ASSERT_WITH_SECURITY_IMPLICATION(object-&gt;is2d());
-    return wrap&lt;JSCanvasRenderingContext2D&gt;(globalObject, static_cast&lt;CanvasRenderingContext2D*&gt;(object));
</del><ins>+    return wrap&lt;JSCanvasRenderingContext2D&gt;(globalObject, downcast&lt;CanvasRenderingContext2D&gt;(*object));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -267,13 +267,11 @@
</span><span class="cx">     return wrapper;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename WrapperClass, typename DOMClass&gt; inline JSC::JSValue wrap(JSDOMGlobalObject* globalObject, DOMClass* domObject)
</del><ins>+template&lt;typename WrapperClass, typename DOMClass&gt; inline JSC::JSValue wrap(JSDOMGlobalObject* globalObject, DOMClass&amp; domObject)
</ins><span class="cx"> {
</span><del>-    if (!domObject)
-        return JSC::jsNull();
-    if (JSC::JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), domObject))
</del><ins>+    if (JSC::JSObject* wrapper = getCachedWrapper(globalObject-&gt;world(), &amp;domObject))
</ins><span class="cx">         return wrapper;
</span><del>-    return createWrapper&lt;WrapperClass&gt;(globalObject, domObject);
</del><ins>+    return createWrapper&lt;WrapperClass&gt;(globalObject, &amp;domObject);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename WrapperClass, typename DOMClass&gt; inline JSC::JSValue getExistingWrapper(JSDOMGlobalObject* globalObject, DOMClass* domObject)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBCursorCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/bindings/js/JSIDBCursorCustom.cpp        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -54,9 +54,13 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, IDBCursor* cursor)
</span><span class="cx"> {
</span><del>-    if (cursor-&gt;isKeyCursor())
-        return wrap&lt;JSIDBCursor&gt;(globalObject, cursor);
-    return wrap&lt;JSIDBCursorWithValue&gt;(globalObject, static_cast&lt;IDBCursorWithValue*&gt;(cursor));
</del><ins>+    if (!cursor)
+        return JSC::jsNull();
+
+    if (is&lt;IDBCursorWithValue&gt;(*cursor))
+        return wrap&lt;JSIDBCursorWithValue&gt;(globalObject, downcast&lt;IDBCursorWithValue&gt;(*cursor));
+
+    return wrap&lt;JSIDBCursor&gt;(globalObject, *cursor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMediaStreamCapabilitiesCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMediaStreamCapabilitiesCustom.cpp (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMediaStreamCapabilitiesCustom.cpp        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/bindings/js/JSMediaStreamCapabilitiesCustom.cpp        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -43,9 +43,9 @@
</span><span class="cx">         return jsNull();
</span><span class="cx"> 
</span><span class="cx">     if (object-&gt;hasVideoSource())
</span><del>-        return wrap&lt;JSAllVideoCapabilities&gt;(globalObject, static_cast&lt;AllVideoCapabilities*&gt;(object));
</del><ins>+        return wrap&lt;JSAllVideoCapabilities&gt;(globalObject, static_cast&lt;AllVideoCapabilities&gt;(*object));
</ins><span class="cx"> 
</span><del>-    return wrap&lt;JSAllAudioCapabilities&gt;(globalObject, static_cast&lt;AllAudioCapabilities*&gt;(object));
</del><ins>+    return wrap&lt;JSAllAudioCapabilities&gt;(globalObject, static_cast&lt;AllAudioCapabilities&gt;(*object));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSPerformanceEntryCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -52,19 +52,19 @@
</span><span class="cx">         return jsNull();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(RESOURCE_TIMING)
</span><del>-    if (entry-&gt;isResource())
-        return wrap&lt;JSPerformanceResourceTiming&gt;(globalObject, static_cast&lt;PerformanceResourceTiming*&gt;(entry));
</del><ins>+    if (is&lt;PerformanceResourceTiming&gt;(*entry))
+        return wrap&lt;JSPerformanceResourceTiming&gt;(globalObject, downcast&lt;PerformanceResourceTiming&gt;(*entry));
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(USER_TIMING)
</span><del>-    if (entry-&gt;isMark())
-        return wrap&lt;JSPerformanceMark&gt;(globalObject, static_cast&lt;PerformanceMark*&gt;(entry));
</del><ins>+    if (is&lt;PerformanceMark&gt;(*entry))
+        return wrap&lt;JSPerformanceMark&gt;(globalObject, downcast&lt;PerformanceMark&gt;(*entry));
</ins><span class="cx"> 
</span><del>-    if (entry-&gt;isMeasure())
-        return wrap&lt;JSPerformanceMeasure&gt;(globalObject, static_cast&lt;PerformanceMeasure*&gt;(entry));
</del><ins>+    if (is&lt;PerformanceMeasure&gt;(*entry))
+        return wrap&lt;JSPerformanceMeasure&gt;(globalObject, downcast&lt;PerformanceMeasure&gt;(*entry));
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    return wrap&lt;JSPerformanceEntry&gt;(globalObject, entry);
</del><ins>+    return wrap&lt;JSPerformanceEntry&gt;(globalObject, *entry);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGL2RenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.h        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -220,6 +220,8 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CANVASRENDERINGCONTEXT(WebCore::WebGL2RenderingContext, isWebGL2())
+
</ins><span class="cx"> #endif // WEBGL2
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlcanvasWebGLRenderingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.h        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -85,4 +85,6 @@
</span><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_CANVASRENDERINGCONTEXT(WebCore::WebGLRenderingContext, isWebGL1())
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceEntryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceEntry.h (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceEntry.h        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/page/PerformanceEntry.h        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &quot;Performance.h&quot;
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><ins>+#include &lt;wtf/TypeCasts.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -50,9 +51,9 @@
</span><span class="cx">     double startTime() const;
</span><span class="cx">     double duration() const;
</span><span class="cx"> 
</span><del>-    virtual bool isResource() { return false; }
-    virtual bool isMark() { return false; }
-    virtual bool isMeasure() { return false; }
</del><ins>+    virtual bool isResource() const { return false; }
+    virtual bool isMark() const { return false; }
+    virtual bool isMeasure() const { return false; }
</ins><span class="cx"> 
</span><span class="cx">     static bool startTimeCompareLessThan(PassRefPtr&lt;PerformanceEntry&gt; a, PassRefPtr&lt;PerformanceEntry&gt; b)
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceMarkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceMark.h (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceMark.h        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/page/PerformanceMark.h        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -34,11 +34,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class PerformanceMark : public PerformanceEntry {
</del><ins>+class PerformanceMark final : public PerformanceEntry {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;PerformanceMark&gt; create(const String&amp; name, double startTime) { return adoptRef(*new PerformanceMark(name, startTime)); }
</span><span class="cx"> 
</span><del>-    virtual bool isMark() { return true; }
</del><ins>+    bool isMark() const override { return true; }
</ins><span class="cx">     
</span><span class="cx"> private:
</span><span class="cx">     PerformanceMark(const String&amp; name, double startTime) : PerformanceEntry(name, &quot;mark&quot;, startTime, startTime) { }
</span><span class="lines">@@ -47,6 +47,10 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::PerformanceMark)
+    static bool isType(const WebCore::PerformanceEntry&amp; entry) { return entry.isMark(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif // ENABLE(USER_TIMING)
</span><span class="cx"> 
</span><span class="cx"> #endif // !defined(PerformanceMark_h)
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceMeasureh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceMeasure.h (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceMeasure.h        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/page/PerformanceMeasure.h        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -34,11 +34,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class PerformanceMeasure : public PerformanceEntry {
</del><ins>+class PerformanceMeasure final : public PerformanceEntry {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;PerformanceMeasure&gt; create(const String&amp; name, double startTime, double duration) { return adoptRef(*new PerformanceMeasure(name, startTime, duration)); }
</span><span class="cx"> 
</span><del>-    virtual bool isMeasure() { return true; }
</del><ins>+    bool isMeasure() const override { return true; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     PerformanceMeasure(const String&amp; name, double startTime, double duration) : PerformanceEntry(name, &quot;measure&quot;, startTime, duration) { }
</span><span class="lines">@@ -47,6 +47,10 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::PerformanceMeasure)
+    static bool isType(const WebCore::PerformanceEntry&amp; entry) { return entry.isMeasure(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif // ENABLE(USER_TIMING)
</span><span class="cx"> 
</span><span class="cx"> #endif // !defined(PerformanceMeasure_h)
</span></span></pre></div>
<a id="trunkSourceWebCorepagePerformanceResourceTimingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PerformanceResourceTiming.h (200286 => 200287)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PerformanceResourceTiming.h        2016-04-30 04:48:34 UTC (rev 200286)
+++ trunk/Source/WebCore/page/PerformanceResourceTiming.h        2016-04-30 04:51:31 UTC (rev 200287)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> class ResourceResponse;
</span><span class="cx"> 
</span><del>-class PerformanceResourceTiming : public PerformanceEntry {
</del><ins>+class PerformanceResourceTiming final : public PerformanceEntry {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;PerformanceResourceTiming&gt; create(const AtomicString&amp; initiatorType, const ResourceRequest&amp; request, const ResourceResponse&amp; response, double initiationTime, double finishTime, Document* requestingDocument)
</span><span class="cx">     {
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">     double requestStart() const;
</span><span class="cx">     double responseEnd() const;
</span><span class="cx"> 
</span><del>-    virtual bool isResource() { return true; }
</del><ins>+    bool isResource() const override { return true; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     PerformanceResourceTiming(const AtomicString&amp; initatorType, const ResourceRequest&amp;, const ResourceResponse&amp;, double initiationTime, double finishTime, Document*);
</span><span class="lines">@@ -85,6 +85,11 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::PerformanceResourceTiming)
+    static bool isType(const WebCore::PerformanceEntry&amp; entry) { return entry.isResource(); }
+SPECIALIZE_TYPE_TRAITS_END()
+
</ins><span class="cx"> #endif // ENABLE(RESOURCE_TIMING)
</span><span class="cx"> 
</span><span class="cx"> #endif // !defined(PerformanceResourceTiming_h)
</span></span></pre>
</div>
</div>

</body>
</html>