Title: [141719] trunk/Source/WebCore
Revision
141719
Author
hara...@chromium.org
Date
2013-02-03 15:53:55 -0800 (Sun, 03 Feb 2013)

Log Message

[V8] Pass an Isolate to HasInstance() (part 3)
https://bugs.webkit.org/show_bug.cgi?id=108622

Reviewed by Adam Barth.

This is one of efforts to pass an Isolate to GetTemplate().

No tests. No change in behavior.

* bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
(WebCore::V8InjectedScriptHost::isHTMLAllCollectionCallback):
(WebCore::V8InjectedScriptHost::typeCallback):
(WebCore::V8InjectedScriptHost::getEventListenersCallback):
* bindings/v8/custom/V8NodeCustom.cpp:
(WebCore::V8Node::insertBeforeCallback):
(WebCore::V8Node::replaceChildCallback):
(WebCore::V8Node::removeChildCallback):
(WebCore::V8Node::appendChildCallback):
* bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
(WebCore::toWebGLUniformLocation):
(WebCore::V8WebGLRenderingContext::getAttachedShadersCallback):
(WebCore::V8WebGLRenderingContext::getProgramParameterCallback):
(WebCore::V8WebGLRenderingContext::getShaderParameterCallback):
(WebCore::V8WebGLRenderingContext::getUniformCallback):
(WebCore::vertexAttribAndUniformHelperf):
(WebCore::uniformHelperi):
(WebCore::uniformMatrixHelper):
* bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
(WebCore::isDocumentType):
(WebCore::V8XMLHttpRequest::sendCallback):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141718 => 141719)


--- trunk/Source/WebCore/ChangeLog	2013-02-03 23:26:25 UTC (rev 141718)
+++ trunk/Source/WebCore/ChangeLog	2013-02-03 23:53:55 UTC (rev 141719)
@@ -1,5 +1,38 @@
 2013-02-03  Kentaro Hara  <hara...@chromium.org>
 
+        [V8] Pass an Isolate to HasInstance() (part 3)
+        https://bugs.webkit.org/show_bug.cgi?id=108622
+
+        Reviewed by Adam Barth.
+
+        This is one of efforts to pass an Isolate to GetTemplate().
+
+        No tests. No change in behavior.
+
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::V8InjectedScriptHost::isHTMLAllCollectionCallback):
+        (WebCore::V8InjectedScriptHost::typeCallback):
+        (WebCore::V8InjectedScriptHost::getEventListenersCallback):
+        * bindings/v8/custom/V8NodeCustom.cpp:
+        (WebCore::V8Node::insertBeforeCallback):
+        (WebCore::V8Node::replaceChildCallback):
+        (WebCore::V8Node::removeChildCallback):
+        (WebCore::V8Node::appendChildCallback):
+        * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
+        (WebCore::toWebGLUniformLocation):
+        (WebCore::V8WebGLRenderingContext::getAttachedShadersCallback):
+        (WebCore::V8WebGLRenderingContext::getProgramParameterCallback):
+        (WebCore::V8WebGLRenderingContext::getShaderParameterCallback):
+        (WebCore::V8WebGLRenderingContext::getUniformCallback):
+        (WebCore::vertexAttribAndUniformHelperf):
+        (WebCore::uniformHelperi):
+        (WebCore::uniformMatrixHelper):
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::isDocumentType):
+        (WebCore::V8XMLHttpRequest::sendCallback):
+
+2013-02-03  Kentaro Hara  <hara...@chromium.org>
+
         [V8] Pass an Isolate to HasInstance() (part 2)
         https://bugs.webkit.org/show_bug.cgi?id=108620
 

Modified: trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp (141718 => 141719)


--- trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp	2013-02-03 23:26:25 UTC (rev 141718)
+++ trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp	2013-02-03 23:53:55 UTC (rev 141719)
@@ -112,7 +112,7 @@
         return v8Boolean(false, args.GetIsolate());
 
     v8::HandleScope handleScope;
-    return v8::Boolean::New(V8HTMLAllCollection::HasInstance(args[0]));
+    return v8::Boolean::New(V8HTMLAllCollection::HasInstance(args[0], args.GetIsolate()));
 }
 
 v8::Handle<v8::Value> V8InjectedScriptHost::typeCallback(const v8::Arguments& args)
@@ -133,19 +133,19 @@
         return v8::String::NewSymbol("date");
     if (value->IsRegExp())
         return v8::String::NewSymbol("regexp");
-    if (V8Node::HasInstance(value))
+    if (V8Node::HasInstance(value, args.GetIsolate()))
         return v8::String::NewSymbol("node");
-    if (V8NodeList::HasInstance(value))
+    if (V8NodeList::HasInstance(value, args.GetIsolate()))
         return v8::String::NewSymbol("array");
-    if (V8HTMLCollection::HasInstance(value))
+    if (V8HTMLCollection::HasInstance(value, args.GetIsolate()))
         return v8::String::NewSymbol("array");
-    if (V8Int8Array::HasInstance(value) || V8Int16Array::HasInstance(value) || V8Int32Array::HasInstance(value))
+    if (V8Int8Array::HasInstance(value, args.GetIsolate()) || V8Int16Array::HasInstance(value, args.GetIsolate()) || V8Int32Array::HasInstance(value, args.GetIsolate()))
         return v8::String::NewSymbol("array");
-    if (V8Uint8Array::HasInstance(value) || V8Uint16Array::HasInstance(value) || V8Uint32Array::HasInstance(value))
+    if (V8Uint8Array::HasInstance(value, args.GetIsolate()) || V8Uint16Array::HasInstance(value, args.GetIsolate()) || V8Uint32Array::HasInstance(value, args.GetIsolate()))
         return v8::String::NewSymbol("array");
-    if (V8Float32Array::HasInstance(value) || V8Float64Array::HasInstance(value))
+    if (V8Float32Array::HasInstance(value, args.GetIsolate()) || V8Float64Array::HasInstance(value, args.GetIsolate()))
         return v8::String::NewSymbol("array");
-    if (V8Uint8ClampedArray::HasInstance(value))
+    if (V8Uint8ClampedArray::HasInstance(value, args.GetIsolate()))
         return v8::String::NewSymbol("array");
     return v8::Undefined();
 }
@@ -243,7 +243,7 @@
     v8::HandleScope handleScope;
 
     v8::Local<v8::Value> value = args[0];
-    if (!V8Node::HasInstance(value))
+    if (!V8Node::HasInstance(value, args.GetIsolate()))
         return v8::Undefined();
     Node* node = V8Node::toNative(value->ToObject());
     if (!node)

Modified: trunk/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp (141718 => 141719)


--- trunk/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp	2013-02-03 23:26:25 UTC (rev 141718)
+++ trunk/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp	2013-02-03 23:53:55 UTC (rev 141719)
@@ -66,8 +66,8 @@
     v8::Handle<v8::Object> holder = args.Holder();
     Node* imp = V8Node::toNative(holder);
     ExceptionCode ec = 0;
-    Node* newChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
-    Node* refChild = V8Node::HasInstance(args[1]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
+    Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+    Node* refChild = V8Node::HasInstance(args[1], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
     bool success = imp->insertBefore(newChild, refChild, ec, true);
     if (ec)
         return setDOMException(ec, args.GetIsolate());
@@ -82,8 +82,8 @@
     v8::Handle<v8::Object> holder = args.Holder();
     Node* imp = V8Node::toNative(holder);
     ExceptionCode ec = 0;
-    Node* newChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
-    Node* oldChild = V8Node::HasInstance(args[1]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
+    Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+    Node* oldChild = V8Node::HasInstance(args[1], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
     bool success = imp->replaceChild(newChild, oldChild, ec, true);
     if (ec)
         return setDOMException(ec, args.GetIsolate());
@@ -97,7 +97,7 @@
     v8::Handle<v8::Object> holder = args.Holder();
     Node* imp = V8Node::toNative(holder);
     ExceptionCode ec = 0;
-    Node* oldChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+    Node* oldChild = V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     bool success = imp->removeChild(oldChild, ec);
     if (ec)
         return setDOMException(ec, args.GetIsolate());
@@ -112,7 +112,7 @@
     v8::Handle<v8::Object> holder = args.Holder();
     Node* imp = V8Node::toNative(holder);
     ExceptionCode ec = 0;
-    Node* newChild = V8Node::HasInstance(args[0]) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+    Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     bool success = imp->appendChild(newChild, ec, true );
     if (ec)
         return setDOMException(ec, args.GetIsolate());

Modified: trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp (141718 => 141719)


--- trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp	2013-02-03 23:26:25 UTC (rev 141718)
+++ trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp	2013-02-03 23:53:55 UTC (rev 141719)
@@ -255,7 +255,7 @@
     return toV8Object(info, args.Holder(), args.GetIsolate());
 }
 
-static WebGLUniformLocation* toWebGLUniformLocation(v8::Handle<v8::Value> value, bool& ok)
+static WebGLUniformLocation* toWebGLUniformLocation(v8::Handle<v8::Value> value, bool& ok, v8::Isolate* isolate)
 {
     ok = false;
     WebGLUniformLocation* location = 0;
@@ -277,9 +277,9 @@
 
     ExceptionCode ec = 0;
     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
-    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0]))
+    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0], args.GetIsolate()))
         return throwTypeError(0, args.GetIsolate());
-    WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+    WebGLProgram* program = V8WebGLProgram::HasInstance(args[0], args.GetIsolate()) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     Vector<RefPtr<WebGLShader> > shaders;
     bool succeed = context->getAttachedShaders(program, shaders, ec);
     if (ec) {
@@ -346,9 +346,9 @@
 
     ExceptionCode ec = 0;
     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
-    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0]))
+    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0], args.GetIsolate()))
         return throwTypeError(0, args.GetIsolate());
-    WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+    WebGLProgram* program = V8WebGLProgram::HasInstance(args[0], args.GetIsolate()) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     unsigned pname = toInt32(args[1]);
     WebGLGetInfo info = context->getProgramParameter(program, pname, ec);
     if (ec)
@@ -368,9 +368,9 @@
 
     ExceptionCode ec = 0;
     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
-    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLShader::HasInstance(args[0]))
+    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLShader::HasInstance(args[0], args.GetIsolate()))
         return throwTypeError(0, args.GetIsolate());
-    WebGLShader* shader = V8WebGLShader::HasInstance(args[0]) ? V8WebGLShader::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+    WebGLShader* shader = V8WebGLShader::HasInstance(args[0], args.GetIsolate()) ? V8WebGLShader::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     unsigned pname = toInt32(args[1]);
     WebGLGetInfo info = context->getShaderParameter(shader, pname, ec);
     if (ec)
@@ -403,14 +403,14 @@
 
     ExceptionCode ec = 0;
     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
-    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0]))
+    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0], args.GetIsolate()))
         return throwTypeError(0, args.GetIsolate());
-    WebGLProgram* program = V8WebGLProgram::HasInstance(args[0]) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
+    WebGLProgram* program = V8WebGLProgram::HasInstance(args[0], args.GetIsolate()) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
 
-    if (args.Length() > 1 && !isUndefinedOrNull(args[1]) && !V8WebGLUniformLocation::HasInstance(args[1]))
+    if (args.Length() > 1 && !isUndefinedOrNull(args[1]) && !V8WebGLUniformLocation::HasInstance(args[1], args.GetIsolate()))
         return throwTypeError(0, args.GetIsolate());
     bool ok = false;
-    WebGLUniformLocation* location = toWebGLUniformLocation(args[1], ok);
+    WebGLUniformLocation* location = toWebGLUniformLocation(args[1], ok, args.GetIsolate());
 
     WebGLGetInfo info = context->getUniform(program, location, ec);
     if (ec)
@@ -472,14 +472,14 @@
     if (isFunctionToCallForAttribute(functionToCall))
         index = toInt32(args[0]);
     else {
-        if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0]))
+        if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0], args.GetIsolate()))
             return throwTypeError(0, args.GetIsolate());
-        location = toWebGLUniformLocation(args[0], ok);
+        location = toWebGLUniformLocation(args[0], ok, args.GetIsolate());
     }
 
     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
 
-    if (V8Float32Array::HasInstance(args[1])) {
+    if (V8Float32Array::HasInstance(args[1], args.GetIsolate())) {
         Float32Array* array = V8Float32Array::toNative(args[1]->ToObject());
         ASSERT(array != NULL);
         ExceptionCode ec = 0;
@@ -543,12 +543,12 @@
         return throwNotEnoughArgumentsError(args.GetIsolate());
 
     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
-    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0]))
+    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0], args.GetIsolate()))
         return throwTypeError(0, args.GetIsolate());
     bool ok = false;
-    WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok);
+    WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok, args.GetIsolate());
 
-    if (V8Int32Array::HasInstance(args[1])) {
+    if (V8Int32Array::HasInstance(args[1], args.GetIsolate())) {
         Int32Array* array = V8Int32Array::toNative(args[1]->ToObject());
         ASSERT(array != NULL);
         ExceptionCode ec = 0;
@@ -645,13 +645,13 @@
 
     WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
 
-    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0]))
+    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0], args.GetIsolate()))
         return throwTypeError(0, args.GetIsolate());
     bool ok = false;
-    WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok);
+    WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok, args.GetIsolate());
     
     bool transpose = args[1]->BooleanValue();
-    if (V8Float32Array::HasInstance(args[2])) {
+    if (V8Float32Array::HasInstance(args[2], args.GetIsolate())) {
         Float32Array* array = V8Float32Array::toNative(args[2]->ToObject());
         ASSERT(array != NULL);
         ExceptionCode ec = 0;

Modified: trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp (141718 => 141719)


--- trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp	2013-02-03 23:26:25 UTC (rev 141718)
+++ trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp	2013-02-03 23:53:55 UTC (rev 141719)
@@ -158,10 +158,10 @@
     return v8::Undefined();
 }
 
-static bool isDocumentType(v8::Handle<v8::Value> value)
+static bool isDocumentType(v8::Handle<v8::Value> value, v8::Isolate* isolate)
 {
     // FIXME: add other document types.
-    return V8Document::HasInstance(value) || V8HTMLDocument::HasInstance(value);
+    return V8Document::HasInstance(value, isolate) || V8HTMLDocument::HasInstance(value, isolate);
 }
 
 v8::Handle<v8::Value> V8XMLHttpRequest::sendCallback(const v8::Arguments& args)
@@ -177,28 +177,28 @@
         v8::Handle<v8::Value> arg = args[0];
         if (isUndefinedOrNull(arg))
             xmlHttpRequest->send(ec);
-        else if (isDocumentType(arg)) {
+        else if (isDocumentType(arg, args.GetIsolate())) {
             v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
             Document* document = V8Document::toNative(object);
             ASSERT(document);
             xmlHttpRequest->send(document, ec);
-        } else if (V8Blob::HasInstance(arg)) {
+        } else if (V8Blob::HasInstance(arg, args.GetIsolate())) {
             v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
             Blob* blob = V8Blob::toNative(object);
             ASSERT(blob);
             xmlHttpRequest->send(blob, ec);
-        } else if (V8DOMFormData::HasInstance(arg)) {
+        } else if (V8DOMFormData::HasInstance(arg, args.GetIsolate())) {
             v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
             DOMFormData* domFormData = V8DOMFormData::toNative(object);
             ASSERT(domFormData);
             xmlHttpRequest->send(domFormData, ec);
 #if ENABLE(WEBGL) || ENABLE(BLOB)
-        } else if (V8ArrayBuffer::HasInstance(arg)) {
+        } else if (V8ArrayBuffer::HasInstance(arg, args.GetIsolate())) {
             v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
             ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(object);
             ASSERT(arrayBuffer);
             xmlHttpRequest->send(arrayBuffer, ec);
-        } else if (V8ArrayBufferView::HasInstance(arg)) {
+        } else if (V8ArrayBufferView::HasInstance(arg, args.GetIsolate())) {
             v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
             ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(object);
             ASSERT(arrayBufferView);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to