[V8] Pass Isolate to toV8() (Part3)
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2012 18:47:43 +0000 (18:47 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Apr 2012 18:47:43 +0000 (18:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=84261

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/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::openCallback):
(WebCore::V8DOMWindow::indexedPropertyGetter):
(WebCore::V8DOMWindow::namedPropertyGetter):
* bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp:
(WebCore::V8DirectoryEntrySync::getDirectoryCallback):
(WebCore::V8DirectoryEntrySync::getFileCallback):
* bindings/v8/custom/V8DocumentCustom.cpp:
(WebCore::V8Document::evaluateCallback):
(WebCore::V8Document::getCSSCanvasContextCallback):
(WebCore::V8Document::createTouchListCallback):
* bindings/v8/custom/V8DocumentLocationCustom.cpp:
(WebCore::V8Document::locationAccessorGetter):
* bindings/v8/custom/V8EntryCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8EntrySyncCustom.cpp:
(WebCore::toV8):
* bindings/v8/custom/V8EventCustom.cpp:
(WebCore::V8Event::dataTransferAccessorGetter):
(WebCore::V8Event::clipboardDataAccessorGetter):
(WebCore):
* bindings/v8/custom/V8FileReaderCustom.cpp:
(WebCore::V8FileReader::resultAccessorGetter):
* bindings/v8/custom/V8HTMLAllCollectionCustom.cpp:
(WebCore::getItem):
(WebCore::V8HTMLAllCollection::callAsFunctionCallback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114925 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp
Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp
Source/WebCore/bindings/v8/custom/V8EntryCustom.cpp
Source/WebCore/bindings/v8/custom/V8EntrySyncCustom.cpp
Source/WebCore/bindings/v8/custom/V8EventCustom.cpp
Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp

index 4f428c8..de534ef 100644 (file)
@@ -1,5 +1,46 @@
 2012-04-23  Kentaro Hara  <haraken@chromium.org>
 
+        [V8] Pass Isolate to toV8() (Part3)
+        https://bugs.webkit.org/show_bug.cgi?id=84261
+
+        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/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::openCallback):
+        (WebCore::V8DOMWindow::indexedPropertyGetter):
+        (WebCore::V8DOMWindow::namedPropertyGetter):
+        * bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp:
+        (WebCore::V8DirectoryEntrySync::getDirectoryCallback):
+        (WebCore::V8DirectoryEntrySync::getFileCallback):
+        * bindings/v8/custom/V8DocumentCustom.cpp:
+        (WebCore::V8Document::evaluateCallback):
+        (WebCore::V8Document::getCSSCanvasContextCallback):
+        (WebCore::V8Document::createTouchListCallback):
+        * bindings/v8/custom/V8DocumentLocationCustom.cpp:
+        (WebCore::V8Document::locationAccessorGetter):
+        * bindings/v8/custom/V8EntryCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8EntrySyncCustom.cpp:
+        (WebCore::toV8):
+        * bindings/v8/custom/V8EventCustom.cpp:
+        (WebCore::V8Event::dataTransferAccessorGetter):
+        (WebCore::V8Event::clipboardDataAccessorGetter):
+        (WebCore):
+        * bindings/v8/custom/V8FileReaderCustom.cpp:
+        (WebCore::V8FileReader::resultAccessorGetter):
+        * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp:
+        (WebCore::getItem):
+        (WebCore::V8HTMLAllCollection::callAsFunctionCallback):
+
+2012-04-23  Kentaro Hara  <haraken@chromium.org>
+
         [V8] Pass Isolate to toV8() (Part2)
         https://bugs.webkit.org/show_bug.cgi?id=84259
 
index eb65c5e..32e589d 100644 (file)
@@ -463,7 +463,7 @@ v8::Handle<v8::Value> V8DOMWindow::openCallback(const v8::Arguments& args)
     if (!openedWindow)
         return v8::Undefined();
 
-    return toV8(openedWindow.release());
+    return toV8(openedWindow.release(), args.GetIsolate());
 }
 
 v8::Handle<v8::Value> V8DOMWindow::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
@@ -480,7 +480,7 @@ v8::Handle<v8::Value> V8DOMWindow::indexedPropertyGetter(uint32_t index, const v
 
     Frame* child = frame->tree()->scopedChild(index);
     if (child)
-        return toV8(child->domWindow());
+        return toV8(child->domWindow(), info.GetIsolate());
 
     return notHandledByInterceptor();
 }
@@ -503,7 +503,7 @@ v8::Handle<v8::Value> V8DOMWindow::namedPropertyGetter(v8::Local<v8::String> nam
     AtomicString propName = v8StringToAtomicWebCoreString(name);
     Frame* child = frame->tree()->scopedChild(propName);
     if (child)
-        return toV8(child->domWindow());
+        return toV8(child->domWindow(), info.GetIsolate());
 
     // Search IDL functions defined in the prototype
     if (!info.Holder()->GetRealNamedProperty(name).IsEmpty())
@@ -517,8 +517,8 @@ v8::Handle<v8::Value> V8DOMWindow::namedPropertyGetter(v8::Local<v8::String> nam
             HTMLCollection* items = doc->windowNamedItems(propName);
             if (items->length() >= 1) {
                 if (items->length() == 1)
-                    return toV8(items->firstItem());
-                return toV8(items);
+                    return toV8(items->firstItem(), info.GetIsolate());
+                return toV8(items, info.GetIsolate());
             }
         }
     }
index 897848b..a6dcd76 100644 (file)
@@ -107,7 +107,7 @@ v8::Handle<v8::Value> V8DirectoryEntrySync::getDirectoryCallback(const v8::Argum
         V8Proxy::setDOMException(ec);
         return v8::Handle<v8::Value>();
     }
-    return toV8(result.release());
+    return toV8(result.release(), args.GetIsolate());
 }
 
 v8::Handle<v8::Value> V8DirectoryEntrySync::getFileCallback(const v8::Arguments& args)
@@ -126,7 +126,7 @@ v8::Handle<v8::Value> V8DirectoryEntrySync::getFileCallback(const v8::Arguments&
         V8Proxy::setDOMException(ec);
         return v8::Handle<v8::Value>();
     }
-    return toV8(result.release());
+    return toV8(result.release(), args.GetIsolate());
 }
 
 
index 1e28212..5793626 100644 (file)
@@ -91,7 +91,7 @@ v8::Handle<v8::Value> V8Document::evaluateCallback(const v8::Arguments& args)
     if (ec)
         return throwError(ec);
 
-    return toV8(result.release());
+    return toV8(result.release(), args.GetIsolate());
 }
 
 v8::Handle<v8::Value> V8Document::getCSSCanvasContextCallback(const v8::Arguments& args)
@@ -107,10 +107,10 @@ v8::Handle<v8::Value> V8Document::getCSSCanvasContextCallback(const v8::Argument
     if (!result)
         return v8::Undefined();
     if (result->is2d())
-        return toV8(static_cast<CanvasRenderingContext2D*>(result));
+        return toV8(static_cast<CanvasRenderingContext2D*>(result), args.GetIsolate());
 #if ENABLE(WEBGL)
     else if (result->is3d())
-        return toV8(static_cast<WebGLRenderingContext*>(result));
+        return toV8(static_cast<WebGLRenderingContext*>(result), args.GetIsolate());
 #endif // ENABLE(WEBGL)
     ASSERT_NOT_REACHED();
     return v8::Undefined();
@@ -147,7 +147,7 @@ v8::Handle<v8::Value> V8Document::createTouchListCallback(const v8::Arguments& a
         touchList->append(V8Touch::toNative(args[i]->ToObject()));
     }
 
-    return toV8(touchList.release());
+    return toV8(touchList.release(), args.GetIsolate());
 }
 #endif
 
index 4cabd95..b45377c 100644 (file)
@@ -41,7 +41,7 @@ v8::Handle<v8::Value> V8Document::locationAccessorGetter(v8::Local<v8::String> n
         return v8::Null();
 
     DOMWindow* window = document->frame()->domWindow();
-    return toV8(window->location());
+    return toV8(window->location(), info.GetIsolate());
 }
 
 void V8Document::locationAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
index 5519e74..dc3a53f 100644 (file)
@@ -50,10 +50,10 @@ v8::Handle<v8::Value> toV8(Entry* impl, v8::Isolate* isolate)
         return v8::Null();
 
     if (impl->isFile())
-        return toV8(static_cast<FileEntry*>(impl));
+        return toV8(static_cast<FileEntry*>(impl), isolate);
 
     ASSERT(impl->isDirectory());
-    return toV8(static_cast<DirectoryEntry*>(impl));
+    return toV8(static_cast<DirectoryEntry*>(impl), isolate);
 }
 
 } // namespace WebCore
index 8cbfcf5..13ae6d8 100644 (file)
@@ -50,10 +50,10 @@ v8::Handle<v8::Value> toV8(EntrySync* impl, v8::Isolate* isolate)
         return v8::Null();
 
     if (impl->isFile())
-        return toV8(static_cast<FileEntrySync*>(impl));
+        return toV8(static_cast<FileEntrySync*>(impl), isolate);
 
     ASSERT(impl->isDirectory());
-    return toV8(static_cast<DirectoryEntrySync*>(impl));
+    return toV8(static_cast<DirectoryEntrySync*>(impl), isolate);
 }
 
 } // namespace WebCore
index 52eddb7..deec604 100644 (file)
@@ -54,7 +54,7 @@ v8::Handle<v8::Value> V8Event::dataTransferAccessorGetter(v8::Local<v8::String>
     Event* event = V8Event::toNative(info.Holder());
 
     if (event->isDragEvent())
-        return toV8(static_cast<MouseEvent*>(event)->clipboard());
+        return toV8(static_cast<MouseEvent*>(event)->clipboard(), info.GetIsolate());
 
     return v8::Undefined();
 }
@@ -64,14 +64,14 @@ v8::Handle<v8::Value> V8Event::clipboardDataAccessorGetter(v8::Local<v8::String>
     Event* event = V8Event::toNative(info.Holder());
 
     if (event->isClipboardEvent())
-        return toV8(static_cast<ClipboardEvent*>(event)->clipboard());
+        return toV8(static_cast<ClipboardEvent*>(event)->clipboard(), info.GetIsolate());
 
     return v8::Undefined();
 }
 
 #define TRY_TO_WRAP_WITH_INTERFACE(interfaceName) \
     if (eventNames().interfaceFor##interfaceName == desiredInterface) \
-        return toV8(static_cast<interfaceName*>(event));
+        return toV8(static_cast<interfaceName*>(event), isolate);
 
 v8::Handle<v8::Value> toV8(Event* event, v8::Isolate *isolate)
 {
index b5b5748..0cffe6d 100755 (executable)
@@ -46,7 +46,7 @@ v8::Handle<v8::Value> V8FileReader::resultAccessorGetter(v8::Local<v8::String> n
     v8::Handle<v8::Object> holder = info.Holder();
     FileReader* imp = V8FileReader::toNative(holder);
     if (imp->readType() == FileReaderLoader::ReadAsArrayBuffer)
-        return toV8(imp->arrayBufferResult());
+        return toV8(imp->arrayBufferResult(), info.GetIsolate());
     return v8StringOrNull(imp->stringResult());
 }
 
index 1dc7836..c663c21 100644 (file)
@@ -121,7 +121,7 @@ v8::Handle<v8::Value> V8HTMLAllCollection::callAsFunctionCallback(const v8::Argu
         return v8::Undefined();
 
     if (Node* node = imp->namedItemWithIndex(name, index->Uint32Value()))
-        return toV8(node);
+        return toV8(node, args.GetIsolate());
 
     return v8::Undefined();
 }