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

Unified Diff: Source/bindings/tests/results/V8TestObject.cpp

Issue 68563003: Create DOM exceptions in the correct context. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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/V8TestObject.cpp
diff --git a/Source/bindings/tests/results/V8TestObject.cpp b/Source/bindings/tests/results/V8TestObject.cpp
index b882b1c4776d7fe4801a51ba604e0860ab87f456..9cf74c55bb81bedcf09c81ec206c4ff20d3d4cf5 100644
--- a/Source/bindings/tests/results/V8TestObject.cpp
+++ b/Source/bindings/tests/results/V8TestObject.cpp
@@ -851,7 +851,7 @@ static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
int jsValue = imp->attrWithGetterException(es);
if (UNLIKELY(es.throwIfNeeded()))
return;
@@ -896,7 +896,7 @@ static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue,
{
TestObj* imp = V8TestObject::toNative(info.Holder());
V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
imp->setAttrWithSetterException(cppValue, es);
es.throwIfNeeded();
}
@@ -911,7 +911,7 @@ static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>
static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
String jsValue = imp->stringAttrWithGetterException(es);
if (UNLIKELY(es.throwIfNeeded()))
return;
@@ -956,7 +956,7 @@ static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> js
{
TestObj* imp = V8TestObject::toNative(info.Holder());
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
imp->setStringAttrWithSetterException(cppValue, es);
es.throwIfNeeded();
}
@@ -1078,7 +1078,7 @@ static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::L
static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
ScriptState* currentState = ScriptState::current();
if (!currentState)
return v8Undefined();
@@ -1123,7 +1123,7 @@ static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::
static void withExecutionContextAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
ExecutionContext* scriptContext = getExecutionContext();
RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptContext, es);
if (UNLIKELY(es.throwIfNeeded()))
@@ -1195,7 +1195,7 @@ static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v
static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
ScriptState* currentState = ScriptState::current();
if (!currentState)
return v8Undefined();
@@ -1817,7 +1817,7 @@ static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::L
static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), es)) {
v8SetReturnValueNull(info);
es.throwIfNeeded();
@@ -2074,7 +2074,7 @@ static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::S
static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
bool isNull = false;
int jsValue = imp->nullableStringValue(isNull, es);
if (isNull) {
@@ -2803,7 +2803,7 @@ static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, c
if (!imp)
return;
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
imp->setHrefThrows(cppValue, es);
es.throwIfNeeded();
}
@@ -3001,7 +3001,7 @@ static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
return;
}
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0);
RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, es);
@@ -3068,7 +3068,7 @@ static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value
static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
imp->methodWithException(es);
if (es.throwIfNeeded())
return;
@@ -3100,7 +3100,7 @@ static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in
{
EventTarget* impl = V8TestObject::toNative(info.Holder());
if (DOMWindow* window = impl->toDOMWindow()) {
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) {
es.throwIfNeeded();
return;
@@ -3130,7 +3130,7 @@ static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>&
{
EventTarget* impl = V8TestObject::toNative(info.Holder());
if (DOMWindow* window = impl->toDOMWindow()) {
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) {
es.throwIfNeeded();
return;
@@ -3206,7 +3206,7 @@ static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::
static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
ScriptState* currentState = ScriptState::current();
if (!currentState)
return;
@@ -3232,7 +3232,7 @@ static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbac
static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
ScriptState* currentState = ScriptState::current();
if (!currentState)
return;
@@ -3297,7 +3297,7 @@ static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionC
static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
ScriptState* currentState = ScriptState::current();
if (!currentState)
return;
@@ -4198,7 +4198,7 @@ static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
return;
}
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, info.GetIsolate()));
Vector<String> result = imp->stringArrayFunction(values, es);
if (es.throwIfNeeded())
@@ -4220,7 +4220,7 @@ static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
return;
}
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
RefPtr<DOMStringList> result = imp->domStringListFunction(values, es);
if (es.throwIfNeeded())
@@ -4238,7 +4238,7 @@ static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v
static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(es), es)) {
v8SetReturnValueNull(info);
es.throwIfNeeded();
@@ -4349,7 +4349,7 @@ static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
return;
}
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) {
throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod", "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate());
return;
@@ -4393,7 +4393,7 @@ static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info
return;
}
TestObj* imp = V8TestObject::toNative(info.Holder());
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue()));
V8TRYCATCH_VOID(int, b, toInt32(info[2]));
@@ -4927,7 +4927,7 @@ static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
{
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
TestObj* collection = V8TestObject::toNative(info.Holder());
Vector<String> names;
collection->namedPropertyEnumerator(names, es);
@@ -4943,7 +4943,7 @@ static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
{
TestObj* collection = V8TestObject::toNative(info.Holder());
AtomicString propertyName = toWebCoreAtomicString(name);
- ExceptionState es(info.GetIsolate());
+ ExceptionState es(info.Holder(), info.GetIsolate());
bool result = collection->namedPropertyQuery(propertyName, es);
if (es.throwIfNeeded())
return;

Powered by Google App Engine
This is Rietveld 408576698