<!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>[164677] 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/164677">164677</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2014-02-25 15:17:08 -0800 (Tue, 25 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove unused ThreadSpecificInspectorCounters.
&lt;https://webkit.org/b/129337&gt;

We were keeping count of all the JS event listeners in every thread
to support an old Chromium feature that's no longer relevant.

Removing this gets rid of expensive thread-local storage lookups.

Reviewed by Anders Carlsson.

* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::JSEventListener):
(WebCore::JSEventListener::~JSEventListener):
* inspector/InspectorCounters.cpp:
* inspector/InspectorCounters.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::setDOMCounters):
* inspector/protocol/Timeline.json:
* platform/ThreadGlobalData.cpp:
(WebCore::ThreadGlobalData::ThreadGlobalData):
(WebCore::ThreadGlobalData::destroy):
* platform/ThreadGlobalData.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSEventListenercpp">trunk/Source/WebCore/bindings/js/JSEventListener.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCounterscpp">trunk/Source/WebCore/inspector/InspectorCounters.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCountersh">trunk/Source/WebCore/inspector/InspectorCounters.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgentcpp">trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorprotocolTimelinejson">trunk/Source/WebCore/inspector/protocol/Timeline.json</a></li>
<li><a href="#trunkSourceWebCoreplatformThreadGlobalDatacpp">trunk/Source/WebCore/platform/ThreadGlobalData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformThreadGlobalDatah">trunk/Source/WebCore/platform/ThreadGlobalData.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (164676 => 164677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/ChangeLog        2014-02-25 23:17:08 UTC (rev 164677)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-02-25  Andreas Kling  &lt;akling@apple.com&gt;
+
+        Remove unused ThreadSpecificInspectorCounters.
+        &lt;https://webkit.org/b/129337&gt;
+
+        We were keeping count of all the JS event listeners in every thread
+        to support an old Chromium feature that's no longer relevant.
+
+        Removing this gets rid of expensive thread-local storage lookups.
+
+        Reviewed by Anders Carlsson.
+
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::JSEventListener):
+        (WebCore::JSEventListener::~JSEventListener):
+        * inspector/InspectorCounters.cpp:
+        * inspector/InspectorCounters.h:
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::setDOMCounters):
+        * inspector/protocol/Timeline.json:
+        * platform/ThreadGlobalData.cpp:
+        (WebCore::ThreadGlobalData::ThreadGlobalData):
+        (WebCore::ThreadGlobalData::destroy):
+        * platform/ThreadGlobalData.h:
+
</ins><span class="cx"> 2014-02-25  Laszlo Vidacs  &lt;lvidacs.u-szeged@partner.samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         display:table with padding and/or borders in border-box calculates height incorrectly
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSEventListenercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSEventListener.cpp (164676 => 164677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2014-02-25 23:17:08 UTC (rev 164677)
</span><span class="lines">@@ -51,16 +51,10 @@
</span><span class="cx">         m_jsFunction = JSC::Weak&lt;JSC::JSObject&gt;(function);
</span><span class="cx">     } else
</span><span class="cx">         ASSERT(!function);
</span><del>-#if ENABLE(INSPECTOR)
-    ThreadLocalInspectorCounters::current().incrementCounter(ThreadLocalInspectorCounters::JSEventListenerCounter);
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSEventListener::~JSEventListener()
</span><span class="cx"> {
</span><del>-#if ENABLE(INSPECTOR)
-    ThreadLocalInspectorCounters::current().decrementCounter(ThreadLocalInspectorCounters::JSEventListenerCounter);
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSObject* JSEventListener::initializeJSFunction(ScriptExecutionContext*) const
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCounterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCounters.cpp (164676 => 164677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCounters.cpp        2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/inspector/InspectorCounters.cpp        2014-02-25 23:17:08 UTC (rev 164677)
</span><span class="lines">@@ -34,8 +34,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;InspectorCounters.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;ThreadGlobalData.h&quot;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> int InspectorCounters::s_counters[CounterTypeLength];
</span><span class="lines">@@ -45,22 +43,6 @@
</span><span class="cx">     return s_counters[type];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ThreadLocalInspectorCounters::ThreadLocalInspectorCounters()
-{
-    for (size_t i = 0; i &lt; CounterTypeLength; i++)
-        m_counters[i] = 0;
-}
-
-int ThreadLocalInspectorCounters::counterValue(CounterType type)
-{
-    return m_counters[type];
-}
-
-ThreadLocalInspectorCounters&amp; ThreadLocalInspectorCounters::current()
-{
-    return threadGlobalData().inspectorCounters();
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INSPECTOR)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCountersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCounters.h (164676 => 164677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCounters.h        2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/inspector/InspectorCounters.h        2014-02-25 23:17:08 UTC (rev 164677)
</span><span class="lines">@@ -83,36 +83,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-
-#if ENABLE(INSPECTOR)
-class ThreadLocalInspectorCounters {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    enum CounterType {
-        JSEventListenerCounter,
-        CounterTypeLength
-    };
-    ThreadLocalInspectorCounters();
-
-    inline void incrementCounter(CounterType type)
-    {
-        ++m_counters[type];
-    }
-
-    inline void decrementCounter(CounterType type)
-    {
-        --m_counters[type];
-    }
-
-    int counterValue(CounterType);
-
-    static ThreadLocalInspectorCounters&amp; current();
-
-private:
-    int m_counters[CounterTypeLength];
-};
-#endif
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // !defined(InspectorCounters_h)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (164676 => 164677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2014-02-25 23:17:08 UTC (rev 164677)
</span><span class="lines">@@ -582,11 +582,9 @@
</span><span class="cx">             documentCount = InspectorCounters::counterValue(InspectorCounters::DocumentCounter);
</span><span class="cx">             nodeCount = InspectorCounters::counterValue(InspectorCounters::NodeCounter);
</span><span class="cx">         }
</span><del>-        int listenerCount = ThreadLocalInspectorCounters::current().counterValue(ThreadLocalInspectorCounters::JSEventListenerCounter);
</del><span class="cx">         RefPtr&lt;Inspector::TypeBuilder::Timeline::DOMCounters&gt; counters = Inspector::TypeBuilder::Timeline::DOMCounters::create()
</span><span class="cx">             .setDocuments(documentCount)
</span><del>-            .setNodes(nodeCount)
-            .setJsEventListeners(listenerCount);
</del><ins>+            .setNodes(nodeCount);
</ins><span class="cx">         record-&gt;setCounters(counters.release());
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorprotocolTimelinejson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/protocol/Timeline.json (164676 => 164677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/protocol/Timeline.json        2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/inspector/protocol/Timeline.json        2014-02-25 23:17:08 UTC (rev 164677)
</span><span class="lines">@@ -7,8 +7,7 @@
</span><span class="cx">             &quot;type&quot;: &quot;object&quot;,
</span><span class="cx">             &quot;properties&quot;: [
</span><span class="cx">                 { &quot;name&quot;: &quot;documents&quot;, &quot;type&quot;: &quot;integer&quot; },
</span><del>-                { &quot;name&quot;: &quot;nodes&quot;, &quot;type&quot;: &quot;integer&quot; },
-                { &quot;name&quot;: &quot;jsEventListeners&quot;, &quot;type&quot;: &quot;integer&quot; }
</del><ins>+                { &quot;name&quot;: &quot;nodes&quot;, &quot;type&quot;: &quot;integer&quot; }
</ins><span class="cx">             ],
</span><span class="cx">             &quot;description&quot;: &quot;Current values of DOM counters.&quot;
</span><span class="cx">         },
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformThreadGlobalDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ThreadGlobalData.cpp (164676 => 164677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ThreadGlobalData.cpp        2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/platform/ThreadGlobalData.cpp        2014-02-25 23:17:08 UTC (rev 164677)
</span><span class="lines">@@ -67,9 +67,6 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     , m_cachedConverterTEC(adoptPtr(new TECConverterWrapper))
</span><span class="cx"> #endif
</span><del>-#if ENABLE(INSPECTOR)
-    , m_inspectorCounters(adoptPtr(new ThreadLocalInspectorCounters()))
-#endif
</del><span class="cx"> {
</span><span class="cx">     // This constructor will have been called on the main thread before being called on
</span><span class="cx">     // any other thread, and is only called once per thread - this makes this a convenient
</span><span class="lines">@@ -91,10 +88,6 @@
</span><span class="cx"> 
</span><span class="cx">     m_cachedConverterICU.clear();
</span><span class="cx"> 
</span><del>-#if ENABLE(INSPECTOR)
-    m_inspectorCounters.clear();
-#endif
-
</del><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx">     m_inputTypes = nullptr;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformThreadGlobalDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ThreadGlobalData.h (164676 => 164677)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ThreadGlobalData.h        2014-02-25 23:03:44 UTC (rev 164676)
+++ trunk/Source/WebCore/platform/ThreadGlobalData.h        2014-02-25 23:17:08 UTC (rev 164677)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> 
</span><span class="cx">     class EventNames;
</span><span class="cx">     class ReplayInputTypes;
</span><del>-    class ThreadLocalInspectorCounters;
</del><span class="cx">     class ThreadTimers;
</span><span class="cx"> 
</span><span class="cx">     struct CachedResourceRequestInitiators;
</span><span class="lines">@@ -72,10 +71,6 @@
</span><span class="cx">         void setWebCoreThreadData();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(INSPECTOR)
-        ThreadLocalInspectorCounters&amp; inspectorCounters() { return *m_inspectorCounters; }
-#endif
-
</del><span class="cx">     private:
</span><span class="cx">         OwnPtr&lt;CachedResourceRequestInitiators&gt; m_cachedResourceRequestInitiators;
</span><span class="cx">         OwnPtr&lt;EventNames&gt; m_eventNames;
</span><span class="lines">@@ -95,10 +90,6 @@
</span><span class="cx">         OwnPtr&lt;TECConverterWrapper&gt; m_cachedConverterTEC;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(INSPECTOR)
-        OwnPtr&lt;ThreadLocalInspectorCounters&gt; m_inspectorCounters;
-#endif
-
</del><span class="cx">         static ThreadSpecific&lt;ThreadGlobalData&gt;* staticData;
</span><span class="cx"> #if USE(WEB_THREAD)
</span><span class="cx">         static ThreadGlobalData* sharedMainThreadStaticData;
</span></span></pre>
</div>
</div>

</body>
</html>