[V8] Pass Isolate to GetNamedProperty()
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Apr 2012 05:07:55 +0000 (05:07 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Apr 2012 05:07:55 +0000 (05:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=84277

Reviewed by Nate Chapin.

The objective is to pass Isolate around in V8 bindings.
This patch passes Isolate to GetNamedProperty().

(GenerateHeader):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::getter):
* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::V8HTMLDocument::GetNamedProperty):
(WebCore::V8HTMLDocument::allAccessorGetter):

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp

index b55983e..3f91f89 100644 (file)
@@ -1,3 +1,20 @@
+2012-04-23  Kentaro Hara  <haraken@chromium.org>
+
+        [V8] Pass Isolate to GetNamedProperty()
+        https://bugs.webkit.org/show_bug.cgi?id=84277
+
+        Reviewed by Nate Chapin.
+
+        The objective is to pass Isolate around in V8 bindings.
+        This patch passes Isolate to GetNamedProperty().
+
+        (GenerateHeader):
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::getter):
+        * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+        (WebCore::V8HTMLDocument::GetNamedProperty):
+        (WebCore::V8HTMLDocument::allAccessorGetter):
+
 2012-04-23  Michael Nordman  <michaeln@google.com>
 
         [chromium] DomStorage event handling mods.
index 92f3361..42baa4f 100644 (file)
@@ -344,7 +344,7 @@ END
     if ($implClassName eq "HTMLDocument") {
       push(@headerContent, <<END);
   static v8::Local<v8::Object> WrapInShadowObject(v8::Local<v8::Object> wrapper, Node* impl);
-  static v8::Handle<v8::Value> GetNamedProperty(HTMLDocument* htmlDocument, const AtomicString& key);
+  static v8::Handle<v8::Value> GetNamedProperty(HTMLDocument* htmlDocument, const AtomicString& key, v8::Isolate*);
 END
     }
 
index 1c44a41..e5926af 100644 (file)
@@ -550,7 +550,7 @@ v8::Handle<v8::Value> getter(v8::Local<v8::String> property, const v8::AccessorI
     AtomicString name = v8StringToAtomicWebCoreString(property);
     HTMLDocument* htmlDocument = V8HTMLDocument::toNative(info.Holder());
     ASSERT(htmlDocument);
-    v8::Handle<v8::Value> result = V8HTMLDocument::GetNamedProperty(htmlDocument, name);
+    v8::Handle<v8::Value> result = V8HTMLDocument::GetNamedProperty(htmlDocument, name, info.GetIsolate());
     if (!result.IsEmpty())
         return result;
     v8::Handle<v8::Value> prototype = info.Holder()->GetPrototype();
index 5b3d7a4..b5d8575 100644 (file)
@@ -79,7 +79,7 @@ v8::Local<v8::Object> V8HTMLDocument::WrapInShadowObject(v8::Local<v8::Object> w
     return shadow;
 }
 
-v8::Handle<v8::Value> V8HTMLDocument::GetNamedProperty(HTMLDocument* htmlDocument, const AtomicString& key)
+v8::Handle<v8::Value> V8HTMLDocument::GetNamedProperty(HTMLDocument* htmlDocument, const AtomicString& key, v8::Isolate* isolate)
 {
     if (!htmlDocument->hasNamedItem(key.impl()) && !htmlDocument->hasExtraNamedItem(key.impl()))
         return v8::Handle<v8::Value>();
@@ -92,12 +92,12 @@ v8::Handle<v8::Value> V8HTMLDocument::GetNamedProperty(HTMLDocument* htmlDocumen
         Node* node = items->firstItem();
         Frame* frame = 0;
         if (node->hasTagName(HTMLNames::iframeTag) && (frame = static_cast<HTMLIFrameElement*>(node)->contentFrame()))
-            return toV8(frame->domWindow());
+            return toV8(frame->domWindow(), isolate);
 
-        return toV8(node);
+        return toV8(node, isolate);
     }
 
-    return toV8(items);
+    return toV8(items, isolate);
 }
 
 // HTMLDocument ----------------------------------------------------------------