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

Log Message

[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):

Modified Paths

Diff

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


--- trunk/Source/WebCore/ChangeLog	2012-04-23 18:42:51 UTC (rev 114924)
+++ trunk/Source/WebCore/ChangeLog	2012-04-23 18:47:43 UTC (rev 114925)
@@ -1,5 +1,46 @@
 2012-04-23  Kentaro Hara  <hara...@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  <hara...@chromium.org>
+
         [V8] Pass Isolate to toV8() (Part2)
         https://bugs.webkit.org/show_bug.cgi?id=84259
 

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


--- trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp	2012-04-23 18:47:43 UTC (rev 114925)
@@ -463,7 +463,7 @@
     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 @@
 
     Frame* child = frame->tree()->scopedChild(index);
     if (child)
-        return toV8(child->domWindow());
+        return toV8(child->domWindow(), info.GetIsolate());
 
     return notHandledByInterceptor();
 }
@@ -503,7 +503,7 @@
     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 @@
             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());
             }
         }
     }

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


--- trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DirectoryEntrySyncCustom.cpp	2012-04-23 18:47:43 UTC (rev 114925)
@@ -107,7 +107,7 @@
         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 @@
         V8Proxy::setDOMException(ec);
         return v8::Handle<v8::Value>();
     }
-    return toV8(result.release());
+    return toV8(result.release(), args.GetIsolate());
 }
 
 

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


--- trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp	2012-04-23 18:47:43 UTC (rev 114925)
@@ -91,7 +91,7 @@
     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 @@
     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 @@
         touchList->append(V8Touch::toNative(args[i]->ToObject()));
     }
 
-    return toV8(touchList.release());
+    return toV8(touchList.release(), args.GetIsolate());
 }
 #endif
 

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


--- trunk/Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp	2012-04-23 18:47:43 UTC (rev 114925)
@@ -41,7 +41,7 @@
         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)

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


--- trunk/Source/WebCore/bindings/v8/custom/V8EntryCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
+++ trunk/Source/WebCore/bindings/v8/custom/V8EntryCustom.cpp	2012-04-23 18:47:43 UTC (rev 114925)
@@ -50,10 +50,10 @@
         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

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


--- trunk/Source/WebCore/bindings/v8/custom/V8EntrySyncCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
+++ trunk/Source/WebCore/bindings/v8/custom/V8EntrySyncCustom.cpp	2012-04-23 18:47:43 UTC (rev 114925)
@@ -50,10 +50,10 @@
         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

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


--- trunk/Source/WebCore/bindings/v8/custom/V8EventCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
+++ trunk/Source/WebCore/bindings/v8/custom/V8EventCustom.cpp	2012-04-23 18:47:43 UTC (rev 114925)
@@ -54,7 +54,7 @@
     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 @@
     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)
 {

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


--- trunk/Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
+++ trunk/Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp	2012-04-23 18:47:43 UTC (rev 114925)
@@ -46,7 +46,7 @@
     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());
 }
 

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


--- trunk/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp	2012-04-23 18:42:51 UTC (rev 114924)
+++ trunk/Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp	2012-04-23 18:47:43 UTC (rev 114925)
@@ -121,7 +121,7 @@
         return v8::Undefined();
 
     if (Node* node = imp->namedItemWithIndex(name, index->Uint32Value()))
-        return toV8(node);
+        return toV8(node, args.GetIsolate());
 
     return v8::Undefined();
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to