Title: [139854] trunk/Source/WebCore
Revision
139854
Author
[email protected]
Date
2013-01-16 02:02:13 -0800 (Wed, 16 Jan 2013)

Log Message

[V8] Make an Isolate parameter mandatory in SerializedScriptValue::deserialize()
https://bugs.webkit.org/show_bug.cgi?id=106916

Reviewed by Adam Barth.

This is one of steps to remove optional Isolate parameters.

No tests. No change in behavior.

* bindings/v8/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::deserialize):
(WebCore):
(WebCore::SerializedScriptValue::deserializeForInspector):
* bindings/v8/SerializedScriptValue.h:
(SerializedScriptValue):
* bindings/v8/custom/V8HistoryCustom.cpp:
(WebCore::V8History::stateAccessorGetter):
* bindings/v8/custom/V8MessageEventCustom.cpp:
(WebCore::V8MessageEvent::dataAccessorGetter):
* bindings/v8/custom/V8PopStateEventCustom.cpp:
(WebCore::V8PopStateEvent::stateAccessorGetter):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (139853 => 139854)


--- trunk/Source/WebCore/ChangeLog	2013-01-16 09:50:19 UTC (rev 139853)
+++ trunk/Source/WebCore/ChangeLog	2013-01-16 10:02:13 UTC (rev 139854)
@@ -1,3 +1,27 @@
+2013-01-16  Kentaro Hara  <[email protected]>
+
+        [V8] Make an Isolate parameter mandatory in SerializedScriptValue::deserialize()
+        https://bugs.webkit.org/show_bug.cgi?id=106916
+
+        Reviewed by Adam Barth.
+
+        This is one of steps to remove optional Isolate parameters.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/SerializedScriptValue.cpp:
+        (WebCore::SerializedScriptValue::deserialize):
+        (WebCore):
+        (WebCore::SerializedScriptValue::deserializeForInspector):
+        * bindings/v8/SerializedScriptValue.h:
+        (SerializedScriptValue):
+        * bindings/v8/custom/V8HistoryCustom.cpp:
+        (WebCore::V8History::stateAccessorGetter):
+        * bindings/v8/custom/V8MessageEventCustom.cpp:
+        (WebCore::V8MessageEvent::dataAccessorGetter):
+        * bindings/v8/custom/V8PopStateEventCustom.cpp:
+        (WebCore::V8PopStateEvent::stateAccessorGetter):
+
 2013-01-16  Ken Kania  <[email protected]>
 
         [Inspector] Add events for tracking page loads and scheduled navigations.

Modified: trunk/Source/WebCore/bindings/v8/ScriptState.h (139853 => 139854)


--- trunk/Source/WebCore/bindings/v8/ScriptState.h	2013-01-16 09:50:19 UTC (rev 139853)
+++ trunk/Source/WebCore/bindings/v8/ScriptState.h	2013-01-16 10:02:13 UTC (rev 139854)
@@ -63,6 +63,13 @@
         return v8::Local<v8::Context>::New(m_context.get());
     }
 
+    v8::Isolate* isolate()
+    {
+        if (!m_isolate)
+            m_isolate = v8::Isolate::GetCurrent();
+        return m_isolate;
+    }
+
     DOMWindow* domWindow() const;
     ScriptExecutionContext* scriptExecutionContext() const;
 
@@ -81,6 +88,7 @@
 
     v8::Local<v8::Value> m_exception;
     ScopedPersistent<v8::Context> m_context;
+    v8::Isolate* m_isolate;
 };
 
 class EmptyScriptState : public ScriptState {

Modified: trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp (139853 => 139854)


--- trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp	2013-01-16 09:50:19 UTC (rev 139853)
+++ trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp	2013-01-16 10:02:13 UTC (rev 139854)
@@ -2468,8 +2468,13 @@
     m_data = wireData.isolatedCopy();
 }
 
-v8::Handle<v8::Value> SerializedScriptValue::deserialize(MessagePortArray* messagePorts, v8::Isolate* isolate)
+v8::Handle<v8::Value> SerializedScriptValue::deserialize(MessagePortArray* messagePorts)
 {
+    return deserialize(v8::Isolate::GetCurrent(), messagePorts);
+}
+
+v8::Handle<v8::Value> SerializedScriptValue::deserialize(v8::Isolate* isolate, MessagePortArray* messagePorts)
+{
     if (!m_data.impl())
         return v8NullWithCheck(isolate);
     COMPILE_ASSERT(sizeof(BufferValueType) == 2, BufferValueTypeIsTwoBytes);
@@ -2479,12 +2484,12 @@
 }
 
 #if ENABLE(INSPECTOR)
-ScriptValue SerializedScriptValue::deserializeForInspector(ScriptState* scriptState, v8::Isolate* isolate)
+ScriptValue SerializedScriptValue::deserializeForInspector(ScriptState* scriptState)
 {
     v8::HandleScope handleScope;
     v8::Context::Scope contextScope(scriptState->context());
 
-    return ScriptValue(deserialize(0, isolate));
+    return ScriptValue(deserialize(scriptState->isolate()));
 }
 #endif
 

Modified: trunk/Source/WebCore/bindings/v8/SerializedScriptValue.h (139853 => 139854)


--- trunk/Source/WebCore/bindings/v8/SerializedScriptValue.h	2013-01-16 09:50:19 UTC (rev 139853)
+++ trunk/Source/WebCore/bindings/v8/SerializedScriptValue.h	2013-01-16 10:02:13 UTC (rev 139854)
@@ -80,10 +80,11 @@
 
     // Deserializes the value (in the current context). Returns a null value in
     // case of failure.
-    v8::Handle<v8::Value> deserialize(MessagePortArray* = 0, v8::Isolate* = 0);
+    v8::Handle<v8::Value> deserialize(MessagePortArray* = 0);
+    v8::Handle<v8::Value> deserialize(v8::Isolate*, MessagePortArray* = 0);
 
 #if ENABLE(INSPECTOR)
-    ScriptValue deserializeForInspector(ScriptState*, v8::Isolate* = 0);
+    ScriptValue deserializeForInspector(ScriptState*);
 #endif
 
     const Vector<String>& blobURLs() const { return m_blobURLs; }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp (139853 => 139854)


--- trunk/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp	2013-01-16 09:50:19 UTC (rev 139853)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp	2013-01-16 10:02:13 UTC (rev 139854)
@@ -51,7 +51,7 @@
         return value;
 
     SerializedScriptValue* serialized = history->state();
-    value = serialized ? serialized->deserialize(0, info.GetIsolate()) : v8::Handle<v8::Value>(v8Null(info.GetIsolate()));
+    value = serialized ? serialized->deserialize(info.GetIsolate()) : v8::Handle<v8::Value>(v8Null(info.GetIsolate()));
     info.Holder()->SetHiddenValue(V8HiddenPropertyName::state(), value);
 
     return value;

Modified: trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp (139853 => 139854)


--- trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp	2013-01-16 09:50:19 UTC (rev 139853)
+++ trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp	2013-01-16 10:02:13 UTC (rev 139854)
@@ -59,7 +59,7 @@
 
     case MessageEvent::DataTypeSerializedScriptValue:
         if (SerializedScriptValue* serializedValue = event->dataAsSerializedScriptValue())
-            result = serializedValue->deserialize(event->ports(), info.GetIsolate());
+            result = serializedValue->deserialize(info.GetIsolate(), event->ports());
         else
             result = v8Null(info.GetIsolate());
         break;

Modified: trunk/Source/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp (139853 => 139854)


--- trunk/Source/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp	2013-01-16 09:50:19 UTC (rev 139853)
+++ trunk/Source/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp	2013-01-16 10:02:13 UTC (rev 139854)
@@ -76,10 +76,10 @@
             if (!result.IsEmpty())
                 return cacheState(info.Holder(), result);
         }
-        result = event->serializedState()->deserialize(0, info.GetIsolate());
+        result = event->serializedState()->deserialize(info.GetIsolate());
         v8History->SetHiddenValue(V8HiddenPropertyName::state(), result);
     } else
-        result = event->serializedState()->deserialize(0, info.GetIsolate());
+        result = event->serializedState()->deserialize(info.GetIsolate());
 
     return cacheState(info.Holder(), result);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to