Title: [114924] trunk/Source/WebCore
Revision
114924
Author
hara...@chromium.org
Date
2012-04-23 11:42:51 -0700 (Mon, 23 Apr 2012)

Log Message

[V8] Pass Isolate to toV8() (Part2)
https://bugs.webkit.org/show_bug.cgi?id=84259

Reviewed by Nate Chapin.

The objective is to pass Isolate to all toV8()s.
Since there are a lot of toV8(), I'll make the change
step by step. This patch passes Isolate to toV8() in
several custom bindings.

No tests. No change in behavior.

* bindings/v8/custom/V8BlobCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8CSSRuleCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8CSSStyleSheetCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8CSSValueCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
(WebCore::toV8Object):
(WebCore::V8CanvasRenderingContext2D::strokeStyleAccessorGetter):
(WebCore::V8CanvasRenderingContext2D::fillStyleAccessorGetter):
* bindings/v8/custom/V8ConsoleCustom.cpp:
(WebCore::V8Console::memoryAccessorGetter):
* bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
(WebCore::V8SQLStatementErrorCallback::handleEvent):
* bindings/v8/custom/V8DOMStringMapCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8DOMTokenListCustom.cpp:
(WebCore::toV8):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114923 => 114924)


--- trunk/Source/WebCore/ChangeLog	2012-04-23 18:34:58 UTC (rev 114923)
+++ trunk/Source/WebCore/ChangeLog	2012-04-23 18:42:51 UTC (rev 114924)
@@ -1,5 +1,40 @@
 2012-04-23  Kentaro Hara  <hara...@chromium.org>
 
+        [V8] Pass Isolate to toV8() (Part2)
+        https://bugs.webkit.org/show_bug.cgi?id=84259
+
+        Reviewed by Nate Chapin.
+
+        The objective is to pass Isolate to all toV8()s.
+        Since there are a lot of toV8(), I'll make the change
+        step by step. This patch passes Isolate to toV8() in
+        several custom bindings.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/custom/V8BlobCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8CSSRuleCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8CSSStyleSheetCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8CSSValueCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
+        (WebCore::toV8Object):
+        (WebCore::V8CanvasRenderingContext2D::strokeStyleAccessorGetter):
+        (WebCore::V8CanvasRenderingContext2D::fillStyleAccessorGetter):
+        * bindings/v8/custom/V8ConsoleCustom.cpp:
+        (WebCore::V8Console::memoryAccessorGetter):
+        * bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
+        (WebCore::V8SQLStatementErrorCallback::handleEvent):
+        * bindings/v8/custom/V8DOMStringMapCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8DOMTokenListCustom.cpp:
+        (WebCore::toV8):
+
+2012-04-23  Kentaro Hara  <hara...@chromium.org>
+
         [V8][Refactoring] Remove V8Proxy::toV8()
         https://bugs.webkit.org/show_bug.cgi?id=84257
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp (114923 => 114924)


--- trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp	2012-04-23 18:34:58 UTC (rev 114923)
+++ trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
@@ -44,7 +44,7 @@
         return v8::Null();
 
     if (impl->isFile())
-        return toV8(static_cast<File*>(impl));
+        return toV8(static_cast<File*>(impl), isolate);
 
     return V8Blob::wrap(impl);
 }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp (114923 => 114924)


--- trunk/Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp	2012-04-23 18:34:58 UTC (rev 114923)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CSSRuleCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
@@ -54,23 +54,23 @@
         // -> Use the base class wrapper here.
         return V8CSSRule::wrap(impl);
     case CSSRule::STYLE_RULE:
-        return toV8(static_cast<CSSStyleRule*>(impl));
+        return toV8(static_cast<CSSStyleRule*>(impl), isolate);
     case CSSRule::CHARSET_RULE:
-        return toV8(static_cast<CSSCharsetRule*>(impl));
+        return toV8(static_cast<CSSCharsetRule*>(impl), isolate);
     case CSSRule::IMPORT_RULE:
-        return toV8(static_cast<CSSImportRule*>(impl));
+        return toV8(static_cast<CSSImportRule*>(impl), isolate);
     case CSSRule::MEDIA_RULE:
-        return toV8(static_cast<CSSMediaRule*>(impl));
+        return toV8(static_cast<CSSMediaRule*>(impl), isolate);
     case CSSRule::FONT_FACE_RULE:
-        return toV8(static_cast<CSSFontFaceRule*>(impl));
+        return toV8(static_cast<CSSFontFaceRule*>(impl), isolate);
     case CSSRule::PAGE_RULE:
-        return toV8(static_cast<CSSPageRule*>(impl));
+        return toV8(static_cast<CSSPageRule*>(impl), isolate);
     case CSSRule::WEBKIT_KEYFRAME_RULE:
-        return toV8(static_cast<WebKitCSSKeyframeRule*>(impl));
+        return toV8(static_cast<WebKitCSSKeyframeRule*>(impl), isolate);
     case CSSRule::WEBKIT_KEYFRAMES_RULE:
-        return toV8(static_cast<WebKitCSSKeyframesRule*>(impl));
+        return toV8(static_cast<WebKitCSSKeyframesRule*>(impl), isolate);
     case CSSRule::WEBKIT_REGION_RULE:
-        return toV8(static_cast<WebKitCSSRegionRule*>(impl));
+        return toV8(static_cast<WebKitCSSRegionRule*>(impl), isolate);
     }
     return V8CSSRule::wrap(impl);
 }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8CSSStyleSheetCustom.cpp (114923 => 114924)


--- trunk/Source/WebCore/bindings/v8/custom/V8CSSStyleSheetCustom.cpp	2012-04-23 18:34:58 UTC (rev 114923)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CSSStyleSheetCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
@@ -44,7 +44,7 @@
     // Add a hidden reference from stylesheet object to its owner node.
     Node* ownerNode = impl->ownerNode();
     if (ownerNode && !wrapper.IsEmpty())
-        V8DOMWrapper::setNamedHiddenReference(wrapper, "ownerNode", toV8(ownerNode));
+        V8DOMWrapper::setNamedHiddenReference(wrapper, "ownerNode", toV8(ownerNode, isolate));
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp (114923 => 114924)


--- trunk/Source/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp	2012-04-23 18:34:58 UTC (rev 114923)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CSSValueCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
@@ -47,16 +47,16 @@
     if (!impl)
         return v8::Null();
     if (impl->isWebKitCSSTransformValue())
-        return toV8(static_cast<WebKitCSSTransformValue*>(impl));
+        return toV8(static_cast<WebKitCSSTransformValue*>(impl), isolate);
     if (impl->isValueList())
-        return toV8(static_cast<CSSValueList*>(impl));
+        return toV8(static_cast<CSSValueList*>(impl), isolate);
     if (impl->isPrimitiveValue())
-        return toV8(static_cast<CSSPrimitiveValue*>(impl));
+        return toV8(static_cast<CSSPrimitiveValue*>(impl), isolate);
 #if ENABLE(SVG)
     if (impl->isSVGPaint())
-        return toV8(static_cast<SVGPaint*>(impl));
+        return toV8(static_cast<SVGPaint*>(impl), isolate);
     if (impl->isSVGColor())
-        return toV8(static_cast<SVGColor*>(impl));
+        return toV8(static_cast<SVGColor*>(impl), isolate);
 #endif
     return V8CSSValue::wrap(impl);
 }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp (114923 => 114924)


--- trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp	2012-04-23 18:34:58 UTC (rev 114923)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
@@ -49,13 +49,13 @@
 
 namespace WebCore {
 
-static v8::Handle<v8::Value> toV8Object(CanvasStyle* style)
+static v8::Handle<v8::Value> toV8Object(CanvasStyle* style, v8::Isolate* isolate)
 {
     if (style->canvasGradient())
-        return toV8(style->canvasGradient());
+        return toV8(style->canvasGradient(), isolate);
 
     if (style->canvasPattern())
-        return toV8(style->canvasPattern());
+        return toV8(style->canvasPattern(), isolate);
 
     return v8String(style->color());
 }
@@ -74,7 +74,7 @@
 v8::Handle<v8::Value> V8CanvasRenderingContext2D::strokeStyleAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
     CanvasRenderingContext2D* impl = V8CanvasRenderingContext2D::toNative(info.Holder());
-    return toV8Object(impl->strokeStyle());
+    return toV8Object(impl->strokeStyle(), info.GetIsolate());
 }
 
 void V8CanvasRenderingContext2D::strokeStyleAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
@@ -89,7 +89,7 @@
 v8::Handle<v8::Value> V8CanvasRenderingContext2D::fillStyleAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
     CanvasRenderingContext2D* impl = V8CanvasRenderingContext2D::toNative(info.Holder());
-    return toV8Object(impl->fillStyle());
+    return toV8Object(impl->fillStyle(), info.GetIsolate());
 }
 
 void V8CanvasRenderingContext2D::fillStyleAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)

Modified: trunk/Source/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp (114923 => 114924)


--- trunk/Source/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp	2012-04-23 18:34:58 UTC (rev 114923)
+++ trunk/Source/WebCore/bindings/v8/custom/V8ConsoleCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
@@ -94,7 +94,7 @@
 {
     INC_STATS("DOM.Console.memoryAccessorGetter");
     Console* imp = V8Console::toNative(info.Holder());
-    return toV8(imp->memory());
+    return toV8(imp->memory(), info.GetIsolate());
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp (114923 => 114924)


--- trunk/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp	2012-04-23 18:34:58 UTC (rev 114923)
+++ trunk/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp	2012-04-23 18:42:51 UTC (rev 114924)
@@ -56,8 +56,8 @@
 
     v8::Context::Scope scope(v8Context);
 
-    v8::Handle<v8::Value> transactionHandle = toV8(transaction);
-    v8::Handle<v8::Value> errorHandle = toV8(error);
+    v8::Handle<v8::Value> transactionHandle = toV8(transaction, 0);
+    v8::Handle<v8::Value> errorHandle = toV8(error, 0);
     if (transactionHandle.IsEmpty() || errorHandle.IsEmpty()) {
         if (!isScriptControllerTerminating())
             CRASH();

Modified: trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp (114923 => 114924)


--- trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp	2012-04-23 18:34:58 UTC (rev 114923)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
@@ -92,7 +92,7 @@
     // Add a hidden reference from the element to the DOMStringMap.
     Element* element = impl->element();
     if (!wrapper.IsEmpty() && element) {
-        v8::Handle<v8::Value> elementValue = toV8(element);
+        v8::Handle<v8::Value> elementValue = toV8(element, isolate);
         if (!elementValue.IsEmpty() && elementValue->IsObject())
             elementValue.As<v8::Object>()->SetHiddenValue(V8HiddenPropertyName::domStringMap(), wrapper);
     }

Modified: trunk/Source/WebCore/bindings/v8/custom/V8DOMTokenListCustom.cpp (114923 => 114924)


--- trunk/Source/WebCore/bindings/v8/custom/V8DOMTokenListCustom.cpp	2012-04-23 18:34:58 UTC (rev 114923)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DOMTokenListCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
@@ -46,7 +46,7 @@
     // Add a hidden reference from the element to the DOMTokenList.
     Element* element = impl->element();
     if (!wrapper.IsEmpty() && element) {
-        v8::Handle<v8::Value> elementValue = toV8(element);
+        v8::Handle<v8::Value> elementValue = toV8(element, isolate);
         if (!elementValue.IsEmpty() && elementValue->IsObject())
             elementValue.As<v8::Object>()->SetHiddenValue(V8HiddenPropertyName::domTokenList(), wrapper);
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to