Title: [125494] trunk/Source/WebCore
Revision
125494
Author
[email protected]
Date
2012-08-13 18:45:51 -0700 (Mon, 13 Aug 2012)

Log Message

[V8] Move GCEventData class from V8Binding.h to ScriptGCEvent.h
https://bugs.webkit.org/show_bug.cgi?id=93818

Reviewed by Adam Barth.

(1) This patch moves GCEventData class from V8Binding.h to ScriptGCEvent.h.
(2) This patch makes GCEventData::startTime and GCEventData::usedHeapSize
private members.
(3) This patch removes unused forward declarations from V8Binding.h.

No tests. No change in behavior.

* bindings/v8/ScriptGCEvent.cpp:
(WebCore::ScriptGCEvent::gcPrologueCallback):
(WebCore::ScriptGCEvent::gcEpilogueCallback):
* bindings/v8/ScriptGCEvent.h:
(GCEventData):
(WebCore::GCEventData::GCEventData):
(WebCore::GCEventData::clear):
(WebCore::GCEventData::listeners):
(WebCore::GCEventData::startTime):
(WebCore::GCEventData::setStartTime):
(WebCore::GCEventData::usedHeapSize):
(WebCore::GCEventData::setUsedHeapSize):
(WebCore):
* bindings/v8/V8Binding.h:
(WebCore):
* bindings/v8/V8PerIsolateData.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125493 => 125494)


--- trunk/Source/WebCore/ChangeLog	2012-08-14 01:39:32 UTC (rev 125493)
+++ trunk/Source/WebCore/ChangeLog	2012-08-14 01:45:51 UTC (rev 125494)
@@ -1,5 +1,36 @@
 2012-08-13  Kentaro Hara  <[email protected]>
 
+        [V8] Move GCEventData class from V8Binding.h to ScriptGCEvent.h
+        https://bugs.webkit.org/show_bug.cgi?id=93818
+
+        Reviewed by Adam Barth.
+
+        (1) This patch moves GCEventData class from V8Binding.h to ScriptGCEvent.h.
+        (2) This patch makes GCEventData::startTime and GCEventData::usedHeapSize
+        private members.
+        (3) This patch removes unused forward declarations from V8Binding.h.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/ScriptGCEvent.cpp:
+        (WebCore::ScriptGCEvent::gcPrologueCallback):
+        (WebCore::ScriptGCEvent::gcEpilogueCallback):
+        * bindings/v8/ScriptGCEvent.h:
+        (GCEventData):
+        (WebCore::GCEventData::GCEventData):
+        (WebCore::GCEventData::clear):
+        (WebCore::GCEventData::listeners):
+        (WebCore::GCEventData::startTime):
+        (WebCore::GCEventData::setStartTime):
+        (WebCore::GCEventData::usedHeapSize):
+        (WebCore::GCEventData::setUsedHeapSize):
+        (WebCore):
+        * bindings/v8/V8Binding.h:
+        (WebCore):
+        * bindings/v8/V8PerIsolateData.cpp:
+
+2012-08-13  Kentaro Hara  <[email protected]>
+
         [V8] Move checkNewLegal() from V8Proxy.h to SafeAllocation.h
         https://bugs.webkit.org/show_bug.cgi?id=93830
 

Modified: trunk/Source/WebCore/bindings/v8/ScriptGCEvent.cpp (125493 => 125494)


--- trunk/Source/WebCore/bindings/v8/ScriptGCEvent.cpp	2012-08-14 01:39:32 UTC (rev 125493)
+++ trunk/Source/WebCore/bindings/v8/ScriptGCEvent.cpp	2012-08-14 01:45:51 UTC (rev 125494)
@@ -90,21 +90,21 @@
 void ScriptGCEvent::gcPrologueCallback(v8::GCType type, v8::GCCallbackFlags flags)
 {
     GCEventData* gcEventData = isolateGCEventData();
-    gcEventData->startTime = WTF::monotonicallyIncreasingTime();
-    gcEventData->usedHeapSize = getUsedHeapSize();
+    gcEventData->setStartTime(WTF::monotonicallyIncreasingTime());
+    gcEventData->setUsedHeapSize(getUsedHeapSize());
 }
 
 void ScriptGCEvent::gcEpilogueCallback(v8::GCType type, v8::GCCallbackFlags flags)
 {
     GCEventData* gcEventData = isolateGCEventData();
-    if (!gcEventData->usedHeapSize)
+    if (!gcEventData->usedHeapSize())
         return;
     double endTime = WTF::monotonicallyIncreasingTime();
     size_t usedHeapSize = getUsedHeapSize();
-    size_t collectedBytes = usedHeapSize > gcEventData->usedHeapSize ? 0 : gcEventData->usedHeapSize - usedHeapSize;
+    size_t collectedBytes = usedHeapSize > gcEventData->usedHeapSize() ? 0 : gcEventData->usedHeapSize() - usedHeapSize;
     GCEventData::GCEventListeners& listeners = gcEventData->listeners();
     for (GCEventData::GCEventListeners::iterator i = listeners.begin(); i != listeners.end(); ++i)
-        (*i)->didGC(gcEventData->startTime, endTime, collectedBytes);
+        (*i)->didGC(gcEventData->startTime(), endTime, collectedBytes);
     gcEventData->clear();
 }
     

Modified: trunk/Source/WebCore/bindings/v8/ScriptGCEvent.h (125493 => 125494)


--- trunk/Source/WebCore/bindings/v8/ScriptGCEvent.h	2012-08-14 01:39:32 UTC (rev 125493)
+++ trunk/Source/WebCore/bindings/v8/ScriptGCEvent.h	2012-08-14 01:45:51 UTC (rev 125494)
@@ -49,10 +49,38 @@
     size_t jsHeapSizeLimit;
 };
 
+class ScriptGCEventListener;
+
+class GCEventData {
+public:
+    typedef Vector<ScriptGCEventListener*> GCEventListeners;
+
+    GCEventData()
+        : m_startTime(0.0)
+        , m_usedHeapSize(0)
+    { }
+
+    void clear()
+    {
+        m_startTime = 0.0;
+        m_usedHeapSize = 0;
+    }
+
+    GCEventListeners& listeners() { return m_listeners; }
+
+    double startTime() { return m_startTime; }
+    void setStartTime(double startTime) { m_startTime = startTime; }
+    size_t usedHeapSize() { return m_usedHeapSize; }
+    void setUsedHeapSize(size_t usedHeapSize) { m_usedHeapSize = usedHeapSize; }
+
+private:
+    double m_startTime;
+    size_t m_usedHeapSize;
+    GCEventListeners m_listeners;
+};
+
 #if ENABLE(INSPECTOR)
 
-class ScriptGCEventListener;
-
 class ScriptGCEvent
 {
 public:

Modified: trunk/Source/WebCore/bindings/v8/V8Binding.h (125493 => 125494)


--- trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-08-14 01:39:32 UTC (rev 125493)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.h	2012-08-14 01:45:51 UTC (rev 125494)
@@ -48,32 +48,7 @@
 namespace WebCore {
 
     class DOMStringList;
-    class EventListener;
-    class EventTarget;
-    class ExternalStringVisitor;
-    class MemoryObjectInfo;
-    class ScriptGCEventListener;
 
-    class GCEventData {
-    public:
-        typedef Vector<ScriptGCEventListener*> GCEventListeners;
-
-        GCEventData() : startTime(0.0), usedHeapSize(0) { }
-        void clear()
-        {
-            startTime = 0.0;
-            usedHeapSize = 0;
-        }
-        GCEventListeners& listeners() { return m_listeners; }
-
-        // FIXME: Make these members private.
-        double startTime;
-        size_t usedHeapSize;
-
-    private:
-        GCEventListeners m_listeners;
-    };
-
     // Since v8::Null(isolate) crashes if we pass a null isolate,
     // we need to use v8NullWithCheck(isolate) if an isolate can be null.
     //

Modified: trunk/Source/WebCore/bindings/v8/V8PerIsolateData.cpp (125493 => 125494)


--- trunk/Source/WebCore/bindings/v8/V8PerIsolateData.cpp	2012-08-14 01:39:32 UTC (rev 125493)
+++ trunk/Source/WebCore/bindings/v8/V8PerIsolateData.cpp	2012-08-14 01:45:51 UTC (rev 125494)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "V8PerIsolateData.h"
 
+#include "ScriptGCEvent.h"
 #include "V8Binding.h"
 
 namespace WebCore {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to