+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.
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 {
$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");
}
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");
}
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 {
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 {
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");
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);
sub IsVisibleAcrossOrigins
{
my $dataNode = shift;
- return $dataNode->extendedAttributes->{"CheckDomainSecurity"} && !($dataNode->name eq "DOMWindow");
+ return $dataNode->extendedAttributes->{"CheckSecurity"} && !($dataNode->name eq "DOMWindow");
}
sub IsConstructable
}
# 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))
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";
# 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);
}
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"}) {
}
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));";
}
$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:
# 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()) {
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);
};
}
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
module window {
interface [
- CheckDomainSecurity,
+ CheckSecurity,
JSCustomDefineOwnProperty,
CustomDeleteProperty,
CustomGetOwnPropertySlot,
] 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;
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;
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();
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;
#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;
// 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
#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)
};
interface [
#if defined(V8_BINDING) && V8_BINDING
- CheckDomainSecurity,
+ CheckSecurity,
#endif
JSCustomGetOwnPropertySlotAndDescriptor,
CustomNamedSetter,
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);
interface [
#if defined(V8_BINDING) && V8_BINDING
- CheckDomainSecurity,
+ CheckSecurity,
#endif
JSCustomGetOwnPropertySlotAndDescriptor,
CustomNamedSetter,
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);