Commit 46904191 authored by haraken@chromium.org's avatar haraken@chromium.org

Rename [CheckDomainSecurity] to [CheckSecurity]

https://bugs.webkit.org/show_bug.cgi?id=78874

Reviewed by Adam Barth.

"Domain security" isn't a term that's used elsewhere.
This patch renames IDL attributes as follows:

- [CheckDomainSecurity] => [CheckSecurity]
- [DoNotCheckDomainSecurity] => [DoNotCheckSecurity]
- [DoNotCheckDomainSecurityOnGetter] => [DoNotCheckSecurityOnGetter]
- [DoNotCheckDomainSecurityOnSetter] => [DoNotCheckSecurityOnSetter]

No tests. No change in behavior.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertyDescriptorBody):
(GenerateImplementation):
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeader):
(IsVisibleAcrossOrigins):
(GenerateFunctionCallback):
(GenerateSingleBatchedAttribute):
(GenerateImplementation):
(GenerateToV8Converters):
* bindings/scripts/test/TestDomainSecurity.idl:
* bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
(WebCore::ConfigureV8TestActiveDOMObjectTemplate):
* page/DOMWindow.idl:
* page/History.idl:
* page/Location.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2e42674d
2012-02-19 Kentaro Hara <haraken@chromium.org>
Rename [CheckDomainSecurity] to [CheckSecurity]
https://bugs.webkit.org/show_bug.cgi?id=78874
Reviewed by Adam Barth.
"Domain security" isn't a term that's used elsewhere.
This patch renames IDL attributes as follows:
- [CheckDomainSecurity] => [CheckSecurity]
- [DoNotCheckDomainSecurity] => [DoNotCheckSecurity]
- [DoNotCheckDomainSecurityOnGetter] => [DoNotCheckSecurityOnGetter]
- [DoNotCheckDomainSecurityOnSetter] => [DoNotCheckSecurityOnSetter]
No tests. No change in behavior.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertyDescriptorBody):
(GenerateImplementation):
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeader):
(IsVisibleAcrossOrigins):
(GenerateFunctionCallback):
(GenerateSingleBatchedAttribute):
(GenerateImplementation):
(GenerateToV8Converters):
* bindings/scripts/test/TestDomainSecurity.idl:
* bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
(WebCore::ConfigureV8TestActiveDOMObjectTemplate):
* page/DOMWindow.idl:
* page/History.idl:
* page/Location.idl:
2012-02-19 James Robinson <jamesr@chromium.org>
Unreviewed, rolling out r108195.
......@@ -497,7 +497,7 @@ sub GenerateGetOwnPropertyDescriptorBody
my $namespaceMaybe = ($inlined ? "JSC::" : "");
my @getOwnPropertyDescriptorImpl = ();
if ($dataNode->extendedAttributes->{"CheckDomainSecurity"}) {
if ($dataNode->extendedAttributes->{"CheckSecurity"}) {
if ($interfaceName eq "DOMWindow") {
push(@implContent, " if (!thisObject->allowsAccessFrom(exec))\n");
} else {
......@@ -1688,9 +1688,9 @@ sub GenerateImplementation
$needsMarkChildren = 1;
}
if ($dataNode->extendedAttributes->{"CheckDomainSecurity"} &&
!$attribute->signature->extendedAttributes->{"DoNotCheckDomainSecurity"} &&
!$attribute->signature->extendedAttributes->{"DoNotCheckDomainSecurityOnGetter"}) {
if ($dataNode->extendedAttributes->{"CheckSecurity"} &&
!$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"} &&
!$attribute->signature->extendedAttributes->{"DoNotCheckSecurityOnGetter"}) {
push(@implContent, " if (!castedThis->allowsAccessFrom(exec))\n");
push(@implContent, " return jsUndefined();\n");
}
......@@ -1803,7 +1803,7 @@ sub GenerateImplementation
push(@implContent, "{\n");
push(@implContent, " ${className}* domObject = static_cast<$className*>(asObject(slotBase));\n");
if ($dataNode->extendedAttributes->{"CheckDomainSecurity"}) {
if ($dataNode->extendedAttributes->{"CheckSecurity"}) {
push(@implContent, " if (!domObject->allowsAccessFrom(exec))\n");
push(@implContent, " return jsUndefined();\n");
}
......@@ -1874,7 +1874,7 @@ sub GenerateImplementation
push(@implContent, "void ${putFunctionName}(ExecState* exec, JSObject* thisObject, JSValue value)\n");
push(@implContent, "{\n");
if ($dataNode->extendedAttributes->{"CheckDomainSecurity"} && !$attribute->signature->extendedAttributes->{"DoNotCheckDomainSecurity"}) {
if ($dataNode->extendedAttributes->{"CheckSecurity"} && !$attribute->signature->extendedAttributes->{"DoNotCheckSecurity"}) {
if ($interfaceName eq "DOMWindow") {
push(@implContent, " if (!static_cast<$className*>(thisObject)->allowsAccessFrom(exec))\n");
} else {
......@@ -1999,7 +1999,7 @@ sub GenerateImplementation
push(@implContent, "void ${constructorFunctionName}(ExecState* exec, JSObject* thisObject, JSValue value)\n");
push(@implContent, "{\n");
if ($dataNode->extendedAttributes->{"CheckDomainSecurity"}) {
if ($dataNode->extendedAttributes->{"CheckSecurity"}) {
if ($interfaceName eq "DOMWindow") {
push(@implContent, " if (!static_cast<$className*>(thisObject)->allowsAccessFrom(exec))\n");
} else {
......@@ -2090,8 +2090,8 @@ sub GenerateImplementation
push(@implContent, " ASSERT_GC_OBJECT_INHERITS(castedThis, &${className}::s_info);\n") unless ($function->isStatic);
if ($dataNode->extendedAttributes->{"CheckDomainSecurity"} and
!$function->signature->extendedAttributes->{"DoNotCheckDomainSecurity"} and
if ($dataNode->extendedAttributes->{"CheckSecurity"} and
!$function->signature->extendedAttributes->{"DoNotCheckSecurity"} and
!$function->isStatic) {
push(@implContent, " if (!castedThis->allowsAccessFrom(exec))\n");
push(@implContent, " return JSValue::encode(jsUndefined());\n");
......
......@@ -407,7 +407,7 @@ END
GenerateHeaderCustomCall($dataNode);
GenerateHeaderCustomInternalFieldIndices($dataNode);
if ($dataNode->extendedAttributes->{"CheckDomainSecurity"}) {
if ($dataNode->extendedAttributes->{"CheckSecurity"}) {
push(@headerContent, <<END);
static bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType, v8::Local<v8::Value> data);
static bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType, v8::Local<v8::Value> data);
......@@ -675,7 +675,7 @@ sub IsNodeSubType
sub IsVisibleAcrossOrigins
{
my $dataNode = shift;
return $dataNode->extendedAttributes->{"CheckDomainSecurity"} && !($dataNode->name eq "DOMWindow");
return $dataNode->extendedAttributes->{"CheckSecurity"} && !($dataNode->name eq "DOMWindow");
}
sub IsConstructable
......@@ -1387,9 +1387,9 @@ END
}
# Check domain security if needed
if (($dataNode->extendedAttributes->{"CheckDomainSecurity"}
if (($dataNode->extendedAttributes->{"CheckSecurity"}
|| $interfaceName eq "DOMWindow")
&& !$function->signature->extendedAttributes->{"DoNotCheckDomainSecurity"}) {
&& !$function->signature->extendedAttributes->{"DoNotCheckSecurity"}) {
# We have not find real use cases yet.
push(@implContentDecls, <<END);
if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), true))
......@@ -1929,11 +1929,11 @@ sub GenerateSingleBatchedAttribute
my $attrExt = $attribute->signature->extendedAttributes;
my $accessControl = "v8::DEFAULT";
if ($attrExt->{"DoNotCheckDomainSecurityOnGetter"}) {
if ($attrExt->{"DoNotCheckSecurityOnGetter"}) {
$accessControl = "v8::ALL_CAN_READ";
} elsif ($attrExt->{"DoNotCheckDomainSecurityOnSetter"}) {
} elsif ($attrExt->{"DoNotCheckSecurityOnSetter"}) {
$accessControl = "v8::ALL_CAN_WRITE";
} elsif ($attrExt->{"DoNotCheckDomainSecurity"}) {
} elsif ($attrExt->{"DoNotCheckSecurity"}) {
$accessControl = "v8::ALL_CAN_READ";
if (!($attribute->type =~ /^readonly/) && !($attrExt->{"V8ReadOnly"})) {
$accessControl .= " | v8::ALL_CAN_WRITE";
......@@ -2333,7 +2333,7 @@ sub GenerateImplementation
# If the function does not need domain security check, we need to
# generate an access getter that returns different function objects
# for different calling context.
if (($dataNode->extendedAttributes->{"CheckDomainSecurity"} || ($interfaceName eq "DOMWindow")) && $function->signature->extendedAttributes->{"DoNotCheckDomainSecurity"}) {
if (($dataNode->extendedAttributes->{"CheckSecurity"} || ($interfaceName eq "DOMWindow")) && $function->signature->extendedAttributes->{"DoNotCheckSecurity"}) {
if (!$isCustom || $function->{overloadIndex} == 1) {
GenerateDomainSafeFunctionGetter($function, $implClassName);
}
......@@ -2393,8 +2393,8 @@ sub GenerateImplementation
if ($attrExt->{"V8EnabledAtRuntime"} || RequiresCustomSignature($function) || $attrExt->{"V8DoNotCheckSignature"}) {
next;
}
if ($attrExt->{"DoNotCheckDomainSecurity"} &&
($dataNode->extendedAttributes->{"CheckDomainSecurity"} || $interfaceName eq "DOMWindow")) {
if ($attrExt->{"DoNotCheckSecurity"} &&
($dataNode->extendedAttributes->{"CheckSecurity"} || $interfaceName eq "DOMWindow")) {
next;
}
if ($attrExt->{"NotEnumerable"} || $attrExt->{"V8ReadOnly"}) {
......@@ -2460,7 +2460,7 @@ END
}
my $access_check = "";
if ($dataNode->extendedAttributes->{"CheckDomainSecurity"} && !($interfaceName eq "DOMWindow")) {
if ($dataNode->extendedAttributes->{"CheckSecurity"} && !($interfaceName eq "DOMWindow")) {
$access_check = "instance->SetAccessCheckCallbacks(V8${interfaceName}::namedSecurityCheck, V8${interfaceName}::indexedSecurityCheck, v8::External::Wrap(&V8${interfaceName}::info));";
}
......@@ -2617,8 +2617,8 @@ END
$conditional = "if (${enable_function}())\n ";
}
if ($attrExt->{"DoNotCheckDomainSecurity"} &&
($dataNode->extendedAttributes->{"CheckDomainSecurity"} || $interfaceName eq "DOMWindow")) {
if ($attrExt->{"DoNotCheckSecurity"} &&
($dataNode->extendedAttributes->{"CheckSecurity"} || $interfaceName eq "DOMWindow")) {
# Mark the accessor as ReadOnly and set it on the proto object so
# it can be shadowed. This is really a hack to make it work.
# There are several sceneria to call into the accessor:
......@@ -3045,7 +3045,7 @@ END
# FIXME: We need a better way of recovering the correct prototype chain
# for every sort of object. For now, we special-case cross-origin visible
# objects (i.e., those with CheckDomainSecurity).
# objects (i.e., those with CheckSecurity).
if (IsVisibleAcrossOrigins($dataNode)) {
push(@implContent, <<END);
if (impl->frame()) {
......
......@@ -28,10 +28,10 @@
module test {
interface [
CheckDomainSecurity
CheckSecurity
] TestActiveDOMObject {
readonly attribute long excitingAttr;
void excitingFunction(in Node nextChild);
[DoNotCheckDomainSecurity] void postMessage(in DOMString message);
[DoNotCheckSecurity] void postMessage(in DOMString message);
};
}
......@@ -117,7 +117,7 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestActiveDOMObjectTempla
v8::Handle<v8::Signature> excitingFunctionSignature = v8::Signature::New(desc, excitingFunctionArgc, excitingFunctionArgv);
proto->Set(v8::String::New("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectInternal::excitingFunctionCallback, v8::Handle<v8::Value>(), excitingFunctionSignature));
// Function 'postMessage' (ExtAttr: 'DoNotCheckDomainSecurity')
// Function 'postMessage' (ExtAttr: 'DoNotCheckSecurity')
proto->SetAccessor(v8::String::New("postMessage"), TestActiveDOMObjectInternal::postMessageAttrGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
// Custom toString template
......
......@@ -27,7 +27,7 @@
module window {
interface [
CheckDomainSecurity,
CheckSecurity,
JSCustomDefineOwnProperty,
CustomDeleteProperty,
CustomGetOwnPropertySlot,
......@@ -44,7 +44,7 @@ module window {
] DOMWindow {
// DOM Level 0
attribute [Replaceable] Screen screen;
attribute [Replaceable, DoNotCheckDomainSecurityOnGetter, JSCustomGetter] History history;
attribute [Replaceable, DoNotCheckSecurityOnGetter, JSCustomGetter] History history;
attribute [Replaceable] BarInfo locationbar;
attribute [Replaceable] BarInfo menubar;
attribute [Replaceable] BarInfo personalbar;
......@@ -55,7 +55,7 @@ module window {
attribute [Replaceable] Navigator clientInformation;
readonly attribute Crypto crypto;
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
attribute [DoNotCheckDomainSecurity, JSCustom, V8CustomSetter, V8Unforgeable] Location location;
attribute [DoNotCheckSecurity, JSCustom, V8CustomSetter, V8Unforgeable] Location location;
#endif
attribute [Replaceable, CustomGetter, V8CustomSetter] Event event;
......@@ -64,9 +64,9 @@ module window {
readonly attribute [CheckSecurityForNode] Element frameElement;
[DoNotCheckDomainSecurity] void focus();
[DoNotCheckDomainSecurity] void blur();
[DoNotCheckDomainSecurity, CallWith=ScriptExecutionContext] void close();
[DoNotCheckSecurity] void focus();
[DoNotCheckSecurity] void blur();
[DoNotCheckSecurity, CallWith=ScriptExecutionContext] void close();
void print();
void stop();
......@@ -115,9 +115,9 @@ module window {
void resizeBy(in [Optional=DefaultIsUndefined] float x, in [Optional=DefaultIsUndefined] float y); // FIXME: this should take longs not floats.
void resizeTo(in [Optional=DefaultIsUndefined] float width, in [Optional=DefaultIsUndefined] float height); // FIXME: this should take longs not floats.
readonly attribute [DoNotCheckDomainSecurity] boolean closed;
readonly attribute [DoNotCheckSecurity] boolean closed;
attribute [Replaceable, DoNotCheckDomainSecurityOnGetter] unsigned long length;
attribute [Replaceable, DoNotCheckSecurityOnGetter] unsigned long length;
attribute DOMString name;
......@@ -129,13 +129,13 @@ module window {
#endif
// Self referential attributes
attribute [Replaceable, DoNotCheckDomainSecurityOnGetter] DOMWindow self;
readonly attribute [DoNotCheckDomainSecurity, V8Unforgeable] DOMWindow window;
attribute [Replaceable, DoNotCheckDomainSecurityOnGetter] DOMWindow frames;
attribute [Replaceable, DoNotCheckSecurityOnGetter] DOMWindow self;
readonly attribute [DoNotCheckSecurity, V8Unforgeable] DOMWindow window;
attribute [Replaceable, DoNotCheckSecurityOnGetter] DOMWindow frames;
attribute [Replaceable, DoNotCheckDomainSecurityOnGetter, V8CustomSetter] DOMWindow opener;
attribute [Replaceable, DoNotCheckDomainSecurityOnGetter] DOMWindow parent;
attribute [Replaceable, DoNotCheckDomainSecurityOnGetter, V8Unforgeable, V8ReadOnly] DOMWindow top;
attribute [Replaceable, DoNotCheckSecurityOnGetter, V8CustomSetter] DOMWindow opener;
attribute [Replaceable, DoNotCheckSecurityOnGetter] DOMWindow parent;
attribute [Replaceable, DoNotCheckSecurityOnGetter, V8Unforgeable, V8ReadOnly] DOMWindow top;
// DOM Level 2 AbstractView Interface
readonly attribute Document document;
......@@ -191,18 +191,18 @@ module window {
// cross-document messaging
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
[DoNotCheckDomainSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin)
[DoNotCheckSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin)
raises(DOMException);
[DoNotCheckDomainSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array messagePorts)
[DoNotCheckSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array messagePorts)
raises(DOMException);
[DoNotCheckDomainSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin)
[DoNotCheckSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin)
raises(DOMException);
[DoNotCheckDomainSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array transferList)
[DoNotCheckSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array transferList)
raises(DOMException);
#else
// There's no good way to expose an array via the ObjC bindings, so for now just allow passing in a single port.
[DoNotCheckDomainSecurity, Custom] void postMessage(in SerializedScriptValue message, in [Optional] MessagePort messagePort, in DOMString targetOrigin)
[DoNotCheckSecurity, Custom] void postMessage(in SerializedScriptValue message, in [Optional] MessagePort messagePort, in DOMString targetOrigin)
raises(DOMException);
#endif
......@@ -797,7 +797,7 @@ module window {
#if defined(V8_BINDING) && V8_BINDING
// window.toString() requires special handling in V8
[V8DoNotCheckSignature, DoNotCheckDomainSecurity, Custom, NotEnumerable] DOMString toString();
[V8DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] DOMString toString();
#endif // defined(V8_BINDING)
};
......
......@@ -27,7 +27,7 @@ module window {
interface [
#if defined(V8_BINDING) && V8_BINDING
CheckDomainSecurity,
CheckSecurity,
#endif
JSCustomGetOwnPropertySlotAndDescriptor,
CustomNamedSetter,
......@@ -39,9 +39,9 @@ module window {
readonly attribute unsigned long length;
readonly attribute [CachedAttribute, Custom] SerializedScriptValue state;
[DoNotCheckDomainSecurity, CallWith=ScriptExecutionContext] void back();
[DoNotCheckDomainSecurity, CallWith=ScriptExecutionContext] void forward();
[DoNotCheckDomainSecurity, CallWith=ScriptExecutionContext] void go(in [Optional=DefaultIsUndefined] long distance);
[DoNotCheckSecurity, CallWith=ScriptExecutionContext] void back();
[DoNotCheckSecurity, CallWith=ScriptExecutionContext] void forward();
[DoNotCheckSecurity, CallWith=ScriptExecutionContext] void go(in [Optional=DefaultIsUndefined] long distance);
[Custom, V8EnabledAtRuntime] void pushState(in any data, in DOMString title, in [Optional] DOMString url)
raises(DOMException);
......
......@@ -30,7 +30,7 @@ module window {
interface [
#if defined(V8_BINDING) && V8_BINDING
CheckDomainSecurity,
CheckSecurity,
#endif
JSCustomGetOwnPropertySlotAndDescriptor,
CustomNamedSetter,
......@@ -44,7 +44,7 @@ module window {
V8CustomToJSObject
] Location {
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
attribute [DoNotCheckDomainSecurityOnSetter, CustomSetter, V8Unforgeable] DOMString href;
attribute [DoNotCheckSecurityOnSetter, CustomSetter, V8Unforgeable] DOMString href;
#endif
[Custom, V8Unforgeable] void assign(in [Optional=DefaultIsUndefined] DOMString url);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment