Title: [123166] trunk/Source/WebCore
Revision
123166
Author
[email protected]
Date
2012-07-19 17:21:16 -0700 (Thu, 19 Jul 2012)

Log Message

Unreviewed, reverting http://trac.webkit.org/changeset/123149.
It broke an IDB test on Chromium page cycler.

* bindings/v8/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore):
* bindings/v8/SerializedScriptValue.h:
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::initMessageEvent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (123165 => 123166)


--- trunk/Source/WebCore/ChangeLog	2012-07-20 00:20:55 UTC (rev 123165)
+++ trunk/Source/WebCore/ChangeLog	2012-07-20 00:21:16 UTC (rev 123166)
@@ -1,3 +1,16 @@
+2012-07-19  Dmitry Titov  <[email protected]>
+
+        Unreviewed, reverting http://trac.webkit.org/changeset/123149.
+        It broke an IDB test on Chromium page cycler.
+
+        * bindings/v8/SerializedScriptValue.cpp:
+        (WebCore::SerializedScriptValue::SerializedScriptValue):
+        (WebCore):
+        * bindings/v8/SerializedScriptValue.h:
+        * dom/MessageEvent.cpp:
+        (WebCore::MessageEvent::MessageEvent):
+        (WebCore::MessageEvent::initMessageEvent):
+
 2012-07-19  Julien Chaffraix  <[email protected]>
 
         [CSS2.1] Anonymous tables should be inline/block-level based off their parent

Modified: trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp (123165 => 123166)


--- trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp	2012-07-20 00:20:55 UTC (rev 123165)
+++ trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp	2012-07-20 00:21:16 UTC (rev 123166)
@@ -2201,7 +2201,6 @@
 }
 
 SerializedScriptValue::SerializedScriptValue()
-    : m_externallyAllocatedMemory(0)
 {
 }
 
@@ -2253,7 +2252,6 @@
                                              MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers,
                                              bool& didThrow,
                                              v8::Isolate* isolate)
-    : m_externallyAllocatedMemory(0)
 {
     didThrow = false;
     Writer writer(isolate);
@@ -2300,7 +2298,6 @@
 }
 
 SerializedScriptValue::SerializedScriptValue(const String& wireData)
-    : m_externallyAllocatedMemory(0)
 {
     m_data = wireData.isolatedCopy();
 }
@@ -2325,17 +2322,4 @@
 }
 #endif
 
-void SerializedScriptValue::registerMemoryAllocatedWithCurrentScriptContext()
-{
-    if (m_externallyAllocatedMemory)
-        return;
-    m_externallyAllocatedMemory = static_cast<intptr_t>(m_data.length());
-    v8::V8::AdjustAmountOfExternalAllocatedMemory(m_externallyAllocatedMemory);
-}
-
-SerializedScriptValue::~SerializedScriptValue()
-{
-    v8::V8::AdjustAmountOfExternalAllocatedMemory(-m_externallyAllocatedMemory);
-}
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/v8/SerializedScriptValue.h (123165 => 123166)


--- trunk/Source/WebCore/bindings/v8/SerializedScriptValue.h	2012-07-20 00:20:55 UTC (rev 123165)
+++ trunk/Source/WebCore/bindings/v8/SerializedScriptValue.h	2012-07-20 00:21:16 UTC (rev 123166)
@@ -45,8 +45,6 @@
 
 class SerializedScriptValue : public ThreadSafeRefCounted<SerializedScriptValue> {
 public:
-    virtual ~SerializedScriptValue();
-
     // If a serialization error occurs (e.g., cyclic input value) this
     // function returns an empty representation, schedules a V8 exception to
     // be thrown using v8::ThrowException(), and sets |didThrow|. In this case
@@ -79,12 +77,6 @@
 
     const Vector<String>& blobURLs() const { return m_blobURLs; }
 
-    // Informs the V8 about external memory allocated and owned by this object. Large values should contribute
-    // to GC counters to eventually trigger a GC, otherwise flood of postMessage() can cause OOM.
-    // Ok to invoke multiple times (only adds memory once).
-    // The memory registration is revoked automatically in destructor.
-    void registerMemoryAllocatedWithCurrentScriptContext();
-
 private:
     enum StringDataMode {
         StringValue,
@@ -101,7 +93,6 @@
     String m_data;
     OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray;
     Vector<String> m_blobURLs;
-    intptr_t m_externallyAllocatedMemory;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/MessageEvent.cpp (123165 => 123166)


--- trunk/Source/WebCore/dom/MessageEvent.cpp	2012-07-20 00:20:55 UTC (rev 123165)
+++ trunk/Source/WebCore/dom/MessageEvent.cpp	2012-07-20 00:21:16 UTC (rev 123166)
@@ -73,10 +73,6 @@
     , m_source(source)
     , m_ports(ports)
 {
-#if USE(V8)
-    if (m_dataAsSerializedScriptValue)
-        m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptContext();
-#endif
 }
 
 MessageEvent::MessageEvent(const String& data)
@@ -138,11 +134,6 @@
     m_lastEventId = lastEventId;
     m_source = source;
     m_ports = ports;
-
-#if USE(V8)
-    if (m_dataAsSerializedScriptValue)
-        m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptContext();
-#endif
 }
 
 // FIXME: Remove this when we have custom ObjC binding support.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to