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

Log Message

[V8] Pass Isolate around in V8Collection.h
https://bugs.webkit.org/show_bug.cgi?id=84299

Reviewed by Nate Chapin.

The objective is to pass Isolate around in V8 bindings.
This patch passes Isolate around in V8Collection.h.

No tests. No change in behavior.

* bindings/v8/V8Collection.h:
(WebCore::getV8Object):
(WebCore::getNamedPropertyOfCollection):
(WebCore::collectionNamedPropertyGetter):
(WebCore::getIndexedPropertyOfCollection):
(WebCore::collectionIndexedPropertyGetter):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114933 => 114934)


--- trunk/Source/WebCore/ChangeLog	2012-04-23 19:49:02 UTC (rev 114933)
+++ trunk/Source/WebCore/ChangeLog	2012-04-23 20:06:11 UTC (rev 114934)
@@ -1,5 +1,24 @@
 2012-04-23  Kentaro Hara  <hara...@chromium.org>
 
+        [V8] Pass Isolate around in V8Collection.h
+        https://bugs.webkit.org/show_bug.cgi?id=84299
+
+        Reviewed by Nate Chapin.
+
+        The objective is to pass Isolate around in V8 bindings.
+        This patch passes Isolate around in V8Collection.h.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/V8Collection.h:
+        (WebCore::getV8Object):
+        (WebCore::getNamedPropertyOfCollection):
+        (WebCore::collectionNamedPropertyGetter):
+        (WebCore::getIndexedPropertyOfCollection):
+        (WebCore::collectionIndexedPropertyGetter):
+
+2012-04-23  Kentaro Hara  <hara...@chromium.org>
+
         [V8] Pass Isolate to toV8() (Part5)
         https://bugs.webkit.org/show_bug.cgi?id=84271
 

Modified: trunk/Source/WebCore/bindings/v8/V8Collection.h (114933 => 114934)


--- trunk/Source/WebCore/bindings/v8/V8Collection.h	2012-04-23 19:49:02 UTC (rev 114933)
+++ trunk/Source/WebCore/bindings/v8/V8Collection.h	2012-04-23 20:06:11 UTC (rev 114934)
@@ -42,11 +42,11 @@
 // FIXME: These functions should be named using to* since they return the item (get* is used for method that take a ref param).
 // See https://bugs.webkit.org/show_bug.cgi?id=24664.
 
-template<class T> static v8::Handle<v8::Value> getV8Object(T* implementation)
+template<class T> static v8::Handle<v8::Value> getV8Object(T* implementation, v8::Isolate* isolate)
 {
     if (!implementation)
         return v8::Handle<v8::Value>();
-    return toV8(implementation);
+    return toV8(implementation, isolate);
 }
 
 template<class Collection> static Collection* toNativeCollection(v8::Local<v8::Object> object)
@@ -54,20 +54,20 @@
     return reinterpret_cast<Collection*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
 }
 
-template<class T> static v8::Handle<v8::Value> getV8Object(PassRefPtr<T> implementation)
+template<class T> static v8::Handle<v8::Value> getV8Object(PassRefPtr<T> implementation, v8::Isolate* isolate)
 {
-    return getV8Object(implementation.get());
+    return getV8Object(implementation.get(), isolate);
 }
 
 // Returns named property of a collection.
-template<class Collection, class ItemType> static v8::Handle<v8::Value> getNamedPropertyOfCollection(v8::Local<v8::String> name, v8::Local<v8::Object> object)
+template<class Collection, class ItemType> static v8::Handle<v8::Value> getNamedPropertyOfCollection(v8::Local<v8::String> name, v8::Local<v8::Object> object, v8::Isolate* isolate)
 {
     // FIXME: assert object is a collection type
     ASSERT(V8DOMWrapper::maybeDOMWrapper(object));
     ASSERT(V8DOMWrapper::domWrapperType(object) != &V8Node::info);
     Collection* collection = toNativeCollection<Collection>(object);
     AtomicString propertyName = toAtomicWebCoreStringWithNullCheck(name);
-    return getV8Object<ItemType>(collection->namedItem(propertyName));
+    return getV8Object<ItemType>(collection->namedItem(propertyName), isolate);
 }
 
 // A template of named property accessor of collections.
@@ -78,23 +78,23 @@
     if (info.Holder()->HasRealNamedCallbackProperty(name))
         return notHandledByInterceptor();
 
-    return getNamedPropertyOfCollection<Collection, ItemType>(name, info.Holder());
+    return getNamedPropertyOfCollection<Collection, ItemType>(name, info.Holder(), info.GetIsolate());
 }
 
 // Returns the property at the index of a collection.
-template<class Collection, class ItemType> static v8::Handle<v8::Value> getIndexedPropertyOfCollection(uint32_t index, v8::Local<v8::Object> object)
+template<class Collection, class ItemType> static v8::Handle<v8::Value> getIndexedPropertyOfCollection(uint32_t index, v8::Local<v8::Object> object, v8::Isolate* isolate)
 {
     // FIXME: Assert that object must be a collection type.
     ASSERT(V8DOMWrapper::maybeDOMWrapper(object));
     ASSERT(V8DOMWrapper::domWrapperType(object) != &V8Node::info);
     Collection* collection = toNativeCollection<Collection>(object);
-    return getV8Object<ItemType>(collection->item(index));
+    return getV8Object<ItemType>(collection->item(index), isolate);
 }
 
 // A template of index interceptor of collections.
 template<class Collection, class ItemType> static v8::Handle<v8::Value> collectionIndexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
 {
-    return getIndexedPropertyOfCollection<Collection, ItemType>(index, info.Holder());
+    return getIndexedPropertyOfCollection<Collection, ItemType>(index, info.Holder(), info.GetIsolate());
 }
 
 // Get an array containing the names of indexed properties of HTMLSelectElement and HTMLFormElement.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to