Title: [132033] trunk/Source/WebCore
Revision
132033
Author
morr...@google.com
Date
2012-10-21 23:44:10 -0700 (Sun, 21 Oct 2012)

Log Message

[V8] V8EnablePerContext shouldn't require document() accessor to the native object.
https://bugs.webkit.org/show_bug.cgi?id=99954

Reviewed by Kentaro Hara.

It now refers ScriptExecutionContext of the creation context instead of document() of
wrapped object.

No new tests. No behavior change at this time.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateImplementation):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (132032 => 132033)


--- trunk/Source/WebCore/ChangeLog	2012-10-22 06:37:29 UTC (rev 132032)
+++ trunk/Source/WebCore/ChangeLog	2012-10-22 06:44:10 UTC (rev 132033)
@@ -1,3 +1,18 @@
+2012-10-21  MORITA Hajime  <morr...@google.com>
+
+        [V8] V8EnablePerContext shouldn't require document() accessor to the native object.
+        https://bugs.webkit.org/show_bug.cgi?id=99954
+
+        Reviewed by Kentaro Hara.
+
+        It now refers ScriptExecutionContext of the creation context instead of document() of
+        wrapped object.
+
+        No new tests. No behavior change at this time.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GenerateImplementation):
+
 2012-10-21  Kent Tamura  <tk...@chromium.org>
 
         Page popup: Fix crash by events after closing

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (132032 => 132033)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-10-22 06:37:29 UTC (rev 132032)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-10-22 06:44:10 UTC (rev 132033)
@@ -3057,8 +3057,9 @@
 void ${className}::installPerContextProperties(v8::Handle<v8::Object> instance, ${nativeType}* impl)
 {
     v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetPrototype());
+    ScriptExecutionContext* context = toScriptExecutionContext(proto->CreationContext());
     // When building QtWebkit with V8 this variable is unused when none of the features are enabled.
-    UNUSED_PARAM(proto);
+    UNUSED_PARAM(context);
 END
 
         # Setup the enable-by-settings attrs if we have them
@@ -3066,7 +3067,7 @@
             my $enableFunction = GetContextEnableFunction($runtimeAttr->signature);
             my $conditionalString = $codeGenerator->GenerateConditionalString($runtimeAttr->signature);
             push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString;
-            push(@implContent, "    if (${enableFunction}(impl->document())) {\n");
+            push(@implContent, "    if (context && context->isDocument() && ${enableFunction}(static_cast<Document*>(context))) {\n");
             push(@implContent, "        static const V8DOMConfiguration::BatchedAttribute attrData =\\\n");
             GenerateSingleBatchedAttribute($interfaceName, $runtimeAttr, ";", "    ");
             push(@implContent, <<END);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to