Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Unified Diff: Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp

Issue 1153613007: bindings: Use CreateDataProperty() instead of ForceSet() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix uninitialized error Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp b/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
index 7d970b09f22e6be7be0bde7d409fd315b2935210..b202b1f8850861cfdabf1d6c1c2271d0df13c4af 100644
--- a/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterfaceCheckSecurity.cpp
@@ -30,17 +30,17 @@ const WrapperTypeInfo& TestInterfaceCheckSecurity::s_wrapperTypeInfo = V8TestInt
namespace TestInterfaceCheckSecurityV8Internal {
template<class CallbackInfo>
-static void TestInterfaceCheckSecurityForceSetAttributeOnThis(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
+static bool TestInterfaceCheckSecurityCreateDataProperty(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
{
TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info.Holder());
v8::String::Utf8Value attributeName(name);
ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), exceptionState)) {
exceptionState.throwIfNeeded();
- return;
+ return false;
}
ASSERT(info.This()->IsObject());
- v8::Local<v8::Object>::Cast(info.This())->ForceSet(info.GetIsolate()->GetCurrentContext(), name, v8Value);
+ return v8CallBoolean(v8::Local<v8::Object>::Cast(info.This())->CreateDataProperty(info.GetIsolate()->GetCurrentContext(), name, v8Value));
}
static void readonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -204,7 +204,7 @@ static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCal
static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "doNotCheckSecurityReplaceableReadonlyLongAttribute");
- TestInterfaceCheckSecurityForceSetAttributeOnThis(propertyName, v8Value, info);
+ TestInterfaceCheckSecurityCreateDataProperty(propertyName, v8Value, info);
}
static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
@@ -232,7 +232,7 @@ static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeGetterCall
static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "doNotCheckSecurityReplaceableReadonlyLongAccessor");
- TestInterfaceCheckSecurityForceSetAttributeOnThis(propertyName, v8Value, info);
+ TestInterfaceCheckSecurityCreateDataProperty(propertyName, v8Value, info);
}
static void doNotCheckSecurityReplaceableReadonlyLongAccessorAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)

Powered by Google App Engine
This is Rietveld 408576698