Title: [106536] trunk/Source/WebCore
Revision
106536
Author
[email protected]
Date
2012-02-02 00:00:20 -0800 (Thu, 02 Feb 2012)

Log Message

Rename [CheckFrameSecurity] and [SVGCheckSecurity] to [CheckAccessToNode]
https://bugs.webkit.org/show_bug.cgi?id=77601

Reviewed by Adam Barth.

[CheckFrameSecurity] and [SVGCheckSecurity] have the same meaning; i.e. generate code
to check allowAccessToNode() for a given attribute or method. This patch renames them
to [CheckAccessToNode].

No tests. No changes in behavior.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateNormalAttrGetter):
(GenerateFunctionCallback):
* html/HTMLEmbedElement.idl:
* html/HTMLFrameElement.idl:
* html/HTMLIFrameElement.idl:
* html/HTMLObjectElement.idl:

* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/V8/V8TestObj.cpp: Updated the test results.
(WebCore):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106535 => 106536)


--- trunk/Source/WebCore/ChangeLog	2012-02-02 07:48:28 UTC (rev 106535)
+++ trunk/Source/WebCore/ChangeLog	2012-02-02 08:00:20 UTC (rev 106536)
@@ -1,3 +1,30 @@
+2012-02-02  Kentaro Hara  <[email protected]>
+
+        Rename [CheckFrameSecurity] and [SVGCheckSecurity] to [CheckAccessToNode]
+        https://bugs.webkit.org/show_bug.cgi?id=77601
+
+        Reviewed by Adam Barth.
+
+        [CheckFrameSecurity] and [SVGCheckSecurity] have the same meaning; i.e. generate code
+        to check allowAccessToNode() for a given attribute or method. This patch renames them
+        to [CheckAccessToNode].
+
+        No tests. No changes in behavior.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GenerateNormalAttrGetter):
+        (GenerateFunctionCallback):
+        * html/HTMLEmbedElement.idl:
+        * html/HTMLFrameElement.idl:
+        * html/HTMLIFrameElement.idl:
+        * html/HTMLObjectElement.idl:
+
+        * bindings/scripts/test/TestObj.idl:
+        * bindings/scripts/test/V8/V8TestObj.cpp: Updated the test results.
+        (WebCore):
+
 2012-02-01  Kentaro Hara  <[email protected]>
 
         Rename [V8DisallowShadowing] to [V8Unforgeable]

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (106535 => 106536)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-02-02 07:48:28 UTC (rev 106535)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2012-02-02 08:00:20 UTC (rev 106536)
@@ -1697,11 +1697,10 @@
 
                 if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCCustom"} || $attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCCustomGetter"}) {
                     push(@implContent, "    return castedThis->$implGetterFunctionName(exec);\n");
-                } elsif ($attribute->signature->extendedAttributes->{"CheckFrameSecurity"}) {
-                    $implIncludes{"Document.h"} = 1;
+                } elsif ($attribute->signature->extendedAttributes->{"CheckAccessToNode"}) {
                     $implIncludes{"JSDOMBinding.h"} = 1;
                     push(@implContent, "    $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
-                    push(@implContent, "    return allowAccessToNode(exec, impl->contentDocument()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName()", "castedThis") . " : jsUndefined();\n");
+                    push(@implContent, "    return allowAccessToNode(exec, impl->" . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName()", "castedThis") . " : jsUndefined();\n");
                 } elsif ($type eq "EventListener") {
                     $implIncludes{"EventListener.h"} = 1;
                     push(@implContent, "    UNUSED_PARAM(exec);\n");
@@ -2131,8 +2130,8 @@
                     push(@implContent, "    ExceptionCode ec = 0;\n");
                 }
 
-                if ($function->signature->extendedAttributes->{"SVGCheckSecurityDocument"} and !$function->isStatic) {
-                    push(@implContent, "    if (!allowAccessToNode(exec, impl->getSVGDocument(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n");
+                if ($function->signature->extendedAttributes->{"CheckAccessToNode"} and !$function->isStatic) {
+                    push(@implContent, "    if (!allowAccessToNode(exec, impl->" . $function->signature->name . "(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n");
                     push(@implContent, "        return JSValue::encode(jsUndefined());\n");
                     $implIncludes{"JSDOMBinding.h"} = 1;
                 }

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (106535 => 106536)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-02-02 07:48:28 UTC (rev 106535)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2012-02-02 08:00:20 UTC (rev 106536)
@@ -865,8 +865,8 @@
     }
 
     # Generate security checks if necessary
-    if ($attribute->signature->extendedAttributes->{"CheckFrameSecurity"}) {
-        push(@implContentDecls, "    if (!V8BindingSecurity::allowAccessToNode(V8BindingState::Only(), imp->contentDocument()))\n    return v8::Handle<v8::Value>();\n\n");
+    if ($attribute->signature->extendedAttributes->{"CheckAccessToNode"}) {
+        push(@implContentDecls, "    if (!V8BindingSecurity::allowAccessToNode(V8BindingState::Only(), imp->" . $attribute->signature->name . "()))\n    return v8::Handle<v8::Value>();\n\n");
     }
 
     my $useExceptions = 1 if @{$attribute->getterExceptions};
@@ -1433,10 +1433,9 @@
         AddToImplIncludes("ScriptCallStack.h");
         AddToImplIncludes("ScriptCallStackFactory.h");
     }
-    if ($function->signature->extendedAttributes->{"SVGCheckSecurityDocument"}) {
-        push(@implContentDecls, <<END);
-    if (!V8BindingSecurity::allowAccessToNode(V8BindingState::Only(), imp->getSVGDocument(ec)))
-        return v8::Handle<v8::Value>();
+    if ($function->signature->extendedAttributes->{"CheckAccessToNode"}) {
+        push(@implContentDecls, "    if (!V8BindingSecurity::allowAccessToNode(V8BindingState::Only(), imp->" . $function->signature->name . "(ec)))\n");
+        push(@implContentDecls, "        return v8::Handle<v8::Value>();\n");
 END
     }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (106535 => 106536)


--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2012-02-02 07:48:28 UTC (rev 106535)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl	2012-02-02 08:00:20 UTC (rev 106536)
@@ -184,8 +184,8 @@
         attribute double[]                  doubleArray;
 #endif
 
-        readonly attribute [CheckFrameSecurity] Document contentDocument;
-        [SVGCheckSecurityDocument] SVGDocument getSVGDocument()
+        readonly attribute [CheckAccessToNode] Document contentDocument;
+        [CheckAccessToNode] SVGDocument getSVGDocument()
             raises(DOMException);
 
         void convert1(in [ConvertNullStringTo=Null] a);

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp (106535 => 106536)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp	2012-02-02 07:48:28 UTC (rev 106535)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp	2012-02-02 08:00:20 UTC (rev 106536)
@@ -1640,7 +1640,7 @@
     {"floatArray", TestObjInternal::floatArrayAttrGetter, TestObjInternal::floatArrayAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
     // Attribute 'doubleArray' (Type: 'attribute' ExtAttr: '')
     {"doubleArray", TestObjInternal::doubleArrayAttrGetter, TestObjInternal::doubleArrayAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
-    // Attribute 'contentDocument' (Type: 'readonly attribute' ExtAttr: 'CheckFrameSecurity')
+    // Attribute 'contentDocument' (Type: 'readonly attribute' ExtAttr: 'CheckAccessToNode')
     {"contentDocument", TestObjInternal::contentDocumentAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
     // Attribute 'mutablePoint' (Type: 'attribute' ExtAttr: '')
     {"mutablePoint", TestObjInternal::mutablePointAttrGetter, TestObjInternal::mutablePointAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},

Modified: trunk/Source/WebCore/html/HTMLEmbedElement.idl (106535 => 106536)


--- trunk/Source/WebCore/html/HTMLEmbedElement.idl	2012-02-02 07:48:28 UTC (rev 106535)
+++ trunk/Source/WebCore/html/HTMLEmbedElement.idl	2012-02-02 08:00:20 UTC (rev 106536)
@@ -42,7 +42,7 @@
 
 #if defined(ENABLE_SVG) && ENABLE_SVG
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C || defined(ENABLE_SVG_DOM_OBJC_BINDINGS) && ENABLE_SVG_DOM_OBJC_BINDINGS
-    [SVGCheckSecurityDocument] SVGDocument getSVGDocument() raises(DOMException);
+    [CheckAccessToNode] SVGDocument getSVGDocument() raises(DOMException);
 #endif
 #endif
     };

Modified: trunk/Source/WebCore/html/HTMLFrameElement.idl (106535 => 106536)


--- trunk/Source/WebCore/html/HTMLFrameElement.idl	2012-02-02 07:48:28 UTC (rev 106535)
+++ trunk/Source/WebCore/html/HTMLFrameElement.idl	2012-02-02 08:00:20 UTC (rev 106536)
@@ -32,14 +32,14 @@
         attribute [Reflect, URL] DOMString src;
 
         // Introduced in DOM Level 2:
-        readonly attribute [CheckFrameSecurity] Document contentDocument;
+        readonly attribute [CheckAccessToNode] Document contentDocument;
 
         // Extensions
         readonly attribute DOMWindow contentWindow;
 
 #if defined(ENABLE_SVG) && ENABLE_SVG
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C || defined(ENABLE_SVG_DOM_OBJC_BINDINGS) && ENABLE_SVG_DOM_OBJC_BINDINGS
-        [SVGCheckSecurityDocument] SVGDocument getSVGDocument()
+        [CheckAccessToNode] SVGDocument getSVGDocument()
             raises(DOMException);
 #endif
 #endif

Modified: trunk/Source/WebCore/html/HTMLIFrameElement.idl (106535 => 106536)


--- trunk/Source/WebCore/html/HTMLIFrameElement.idl	2012-02-02 07:48:28 UTC (rev 106535)
+++ trunk/Source/WebCore/html/HTMLIFrameElement.idl	2012-02-02 08:00:20 UTC (rev 106536)
@@ -34,14 +34,14 @@
         attribute [Reflect] DOMString width;
 
         // Introduced in DOM Level 2:
-        readonly attribute [CheckFrameSecurity] Document contentDocument;
+        readonly attribute [CheckAccessToNode] Document contentDocument;
 
         // Extensions
         readonly attribute DOMWindow contentWindow;
 
 #if defined(ENABLE_SVG) && ENABLE_SVG
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C || defined(ENABLE_SVG_DOM_OBJC_BINDINGS) && ENABLE_SVG_DOM_OBJC_BINDINGS
-        [SVGCheckSecurityDocument] SVGDocument getSVGDocument()
+        [CheckAccessToNode] SVGDocument getSVGDocument()
             raises(DOMException);
 #endif
 #endif

Modified: trunk/Source/WebCore/html/HTMLObjectElement.idl (106535 => 106536)


--- trunk/Source/WebCore/html/HTMLObjectElement.idl	2012-02-02 07:48:28 UTC (rev 106535)
+++ trunk/Source/WebCore/html/HTMLObjectElement.idl	2012-02-02 08:00:20 UTC (rev 106536)
@@ -49,11 +49,11 @@
         void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
 
         // Introduced in DOM Level 2:
-        readonly attribute [CheckFrameSecurity] Document contentDocument;
+        readonly attribute [CheckAccessToNode] Document contentDocument;
 
 #if defined(ENABLE_SVG) && ENABLE_SVG
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C || defined(ENABLE_SVG_DOM_OBJC_BINDINGS) && ENABLE_SVG_DOM_OBJC_BINDINGS
-        [SVGCheckSecurityDocument] SVGDocument getSVGDocument() raises(DOMException);
+        [CheckAccessToNode] SVGDocument getSVGDocument() raises(DOMException);
 #endif
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to