From 1a12b083f76d5c0e2c8341653aed98bcaa3927f0 Mon Sep 17 00:00:00 2001 From: "haraken@chromium.org" Date: Sun, 19 Feb 2012 23:30:47 +0000 Subject: [PATCH] Rename [CheckAccessToNode] to [CheckSecurityForNode] https://bugs.webkit.org/show_bug.cgi?id=78991 Reviewed by Adam Barth. For naming consistency with [CheckSecurity], this patch renames [CheckAccessToNode] to [CheckSecurityForNode]. No tests. No change in behavior. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/CodeGeneratorV8.pm: (GenerateNormalAttrGetter): (GenerateFunctionCallback): * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/V8/V8TestObj.cpp: (WebCore): * html/HTMLEmbedElement.idl: * html/HTMLFrameElement.idl: * html/HTMLIFrameElement.idl: * html/HTMLObjectElement.idl: * page/DOMWindow.idl: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108199 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 26 ++++++++++++++++++++++ Source/WebCore/bindings/scripts/CodeGeneratorJS.pm | 4 ++-- Source/WebCore/bindings/scripts/CodeGeneratorV8.pm | 4 ++-- Source/WebCore/bindings/scripts/test/TestObj.idl | 4 ++-- .../WebCore/bindings/scripts/test/V8/V8TestObj.cpp | 2 +- Source/WebCore/html/HTMLEmbedElement.idl | 2 +- Source/WebCore/html/HTMLFrameElement.idl | 4 ++-- Source/WebCore/html/HTMLIFrameElement.idl | 4 ++-- Source/WebCore/html/HTMLObjectElement.idl | 4 ++-- Source/WebCore/page/DOMWindow.idl | 2 +- 10 files changed, 41 insertions(+), 15 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 684d387..6bb855b 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,29 @@ +2012-02-19 Kentaro Hara + + Rename [CheckAccessToNode] to [CheckSecurityForNode] + https://bugs.webkit.org/show_bug.cgi?id=78991 + + Reviewed by Adam Barth. + + For naming consistency with [CheckSecurity], this patch renames + [CheckAccessToNode] to [CheckSecurityForNode]. + + No tests. No change in behavior. + + * bindings/scripts/CodeGeneratorJS.pm: + (GenerateImplementation): + * bindings/scripts/CodeGeneratorV8.pm: + (GenerateNormalAttrGetter): + (GenerateFunctionCallback): + * bindings/scripts/test/TestObj.idl: + * bindings/scripts/test/V8/V8TestObj.cpp: + (WebCore): + * html/HTMLEmbedElement.idl: + * html/HTMLFrameElement.idl: + * html/HTMLIFrameElement.idl: + * html/HTMLObjectElement.idl: + * page/DOMWindow.idl: + 2012-02-19 James Robinson Sort WebCore XCode project files with sort-Xcode-project-files script. Unreviewed. diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm index 979b97b..e53e5c4 100644 --- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm +++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm @@ -1697,7 +1697,7 @@ sub GenerateImplementation if ($attribute->signature->extendedAttributes->{"Custom"} || $attribute->signature->extendedAttributes->{"JSCustom"} || $attribute->signature->extendedAttributes->{"CustomGetter"} || $attribute->signature->extendedAttributes->{"JSCustomGetter"}) { push(@implContent, " return castedThis->$implGetterFunctionName(exec);\n"); - } elsif ($attribute->signature->extendedAttributes->{"CheckAccessToNode"}) { + } elsif ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) { $implIncludes{"JSDOMBinding.h"} = 1; push(@implContent, " $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n"); push(@implContent, " return shouldAllowAccessToNode(exec, impl->" . $attribute->signature->name . "()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName()", "castedThis") . " : jsUndefined();\n"); @@ -2116,7 +2116,7 @@ sub GenerateImplementation push(@implContent, " ExceptionCode ec = 0;\n"); } - if ($function->signature->extendedAttributes->{"CheckAccessToNode"} and !$function->isStatic) { + if ($function->signature->extendedAttributes->{"CheckSecurityForNode"} and !$function->isStatic) { push(@implContent, " if (!shouldAllowAccessToNode(exec, impl->" . $function->signature->name . "(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n"); push(@implContent, " return JSValue::encode(jsUndefined());\n"); $implIncludes{"JSDOMBinding.h"} = 1; diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm index 3dbbc09..802fce1 100644 --- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm +++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm @@ -853,7 +853,7 @@ END } # Generate security checks if necessary - if ($attribute->signature->extendedAttributes->{"CheckAccessToNode"}) { + if ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) { push(@implContentDecls, " if (!V8BindingSecurity::shouldAllowAccessToNode(V8BindingState::Only(), imp->" . $attribute->signature->name . "()))\n return v8::Handle();\n\n"); } @@ -1417,7 +1417,7 @@ END # right before the label 'fail:'. } - if ($function->signature->extendedAttributes->{"CheckAccessToNode"}) { + if ($function->signature->extendedAttributes->{"CheckSecurityForNode"}) { push(@implContentDecls, " if (!V8BindingSecurity::shouldAllowAccessToNode(V8BindingState::Only(), imp->" . $function->signature->name . "(ec)))\n"); push(@implContentDecls, " return v8::Handle();\n"); END diff --git a/Source/WebCore/bindings/scripts/test/TestObj.idl b/Source/WebCore/bindings/scripts/test/TestObj.idl index 1f31c42..dc2a1a1 100644 --- a/Source/WebCore/bindings/scripts/test/TestObj.idl +++ b/Source/WebCore/bindings/scripts/test/TestObj.idl @@ -195,8 +195,8 @@ module test { void methodWithUnsignedLongArray(in unsigned long[] unsignedLongArray); #endif - readonly attribute [CheckAccessToNode] Document contentDocument; - [CheckAccessToNode] SVGDocument getSVGDocument() + readonly attribute [CheckSecurityForNode] Document contentDocument; + [CheckSecurityForNode] SVGDocument getSVGDocument() raises(DOMException); void convert1(in [TreatReturnedNullStringAs=Null] a); diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp index 48a68d7..59ce9d70 100644 --- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp +++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp @@ -1841,7 +1841,7 @@ static const BatchedAttribute TestObjAttrs[] = { {"floatArray", TestObjInternal::floatArrayAttrGetter, TestObjInternal::floatArrayAttrSetter, 0 /* no data */, static_cast(v8::DEFAULT), static_cast(v8::None), 0 /* on instance */}, // Attribute 'doubleArray' (Type: 'attribute' ExtAttr: '') {"doubleArray", TestObjInternal::doubleArrayAttrGetter, TestObjInternal::doubleArrayAttrSetter, 0 /* no data */, static_cast(v8::DEFAULT), static_cast(v8::None), 0 /* on instance */}, - // Attribute 'contentDocument' (Type: 'readonly attribute' ExtAttr: 'CheckAccessToNode') + // Attribute 'contentDocument' (Type: 'readonly attribute' ExtAttr: 'CheckSecurityForNode') {"contentDocument", TestObjInternal::contentDocumentAttrGetter, 0, 0 /* no data */, static_cast(v8::DEFAULT), static_cast(v8::None), 0 /* on instance */}, // Attribute 'mutablePoint' (Type: 'attribute' ExtAttr: '') {"mutablePoint", TestObjInternal::mutablePointAttrGetter, TestObjInternal::mutablePointAttrSetter, 0 /* no data */, static_cast(v8::DEFAULT), static_cast(v8::None), 0 /* on instance */}, diff --git a/Source/WebCore/html/HTMLEmbedElement.idl b/Source/WebCore/html/HTMLEmbedElement.idl index 7cfc75c..b6e3c16 100644 --- a/Source/WebCore/html/HTMLEmbedElement.idl +++ b/Source/WebCore/html/HTMLEmbedElement.idl @@ -42,7 +42,7 @@ module html { #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 - [CheckAccessToNode] SVGDocument getSVGDocument() raises(DOMException); + [CheckSecurityForNode] SVGDocument getSVGDocument() raises(DOMException); #endif #endif }; diff --git a/Source/WebCore/html/HTMLFrameElement.idl b/Source/WebCore/html/HTMLFrameElement.idl index 51a4716..f40f7b1 100644 --- a/Source/WebCore/html/HTMLFrameElement.idl +++ b/Source/WebCore/html/HTMLFrameElement.idl @@ -32,14 +32,14 @@ module html { attribute [Reflect, URL] DOMString src; // Introduced in DOM Level 2: - readonly attribute [CheckAccessToNode] Document contentDocument; + readonly attribute [CheckSecurityForNode] 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 - [CheckAccessToNode] SVGDocument getSVGDocument() + [CheckSecurityForNode] SVGDocument getSVGDocument() raises(DOMException); #endif #endif diff --git a/Source/WebCore/html/HTMLIFrameElement.idl b/Source/WebCore/html/HTMLIFrameElement.idl index 1e88269..25f9cb1 100644 --- a/Source/WebCore/html/HTMLIFrameElement.idl +++ b/Source/WebCore/html/HTMLIFrameElement.idl @@ -34,14 +34,14 @@ module html { attribute [Reflect] DOMString width; // Introduced in DOM Level 2: - readonly attribute [CheckAccessToNode] Document contentDocument; + readonly attribute [CheckSecurityForNode] 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 - [CheckAccessToNode] SVGDocument getSVGDocument() + [CheckSecurityForNode] SVGDocument getSVGDocument() raises(DOMException); #endif #endif diff --git a/Source/WebCore/html/HTMLObjectElement.idl b/Source/WebCore/html/HTMLObjectElement.idl index 2a19d63..f1055fd 100644 --- a/Source/WebCore/html/HTMLObjectElement.idl +++ b/Source/WebCore/html/HTMLObjectElement.idl @@ -49,11 +49,11 @@ module html { void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error); // Introduced in DOM Level 2: - readonly attribute [CheckAccessToNode] Document contentDocument; + readonly attribute [CheckSecurityForNode] 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 - [CheckAccessToNode] SVGDocument getSVGDocument() raises(DOMException); + [CheckSecurityForNode] SVGDocument getSVGDocument() raises(DOMException); #endif #endif diff --git a/Source/WebCore/page/DOMWindow.idl b/Source/WebCore/page/DOMWindow.idl index 79362eb..f72f512 100644 --- a/Source/WebCore/page/DOMWindow.idl +++ b/Source/WebCore/page/DOMWindow.idl @@ -62,7 +62,7 @@ module window { DOMSelection getSelection(); - readonly attribute [CheckAccessToNode] Element frameElement; + readonly attribute [CheckSecurityForNode] Element frameElement; [DoNotCheckDomainSecurity] void focus(); [DoNotCheckDomainSecurity] void blur(); -- 2.7.4