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

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

Issue 339063003: Add invokeCallback functionality to the code generator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/bindings/templates/callback_interface.cpp ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestCallbackInterface.cpp
diff --git a/Source/bindings/tests/results/V8TestCallbackInterface.cpp b/Source/bindings/tests/results/V8TestCallbackInterface.cpp
index b396a607d3376e687687a9aedf3d9d9bc7cbdd2e..e8379b54f7a1e5cfb42eebdc16b66baf9297e13a 100644
--- a/Source/bindings/tests/results/V8TestCallbackInterface.cpp
+++ b/Source/bindings/tests/results/V8TestCallbackInterface.cpp
@@ -9,6 +9,7 @@
#include "bindings/tests/v8/V8TestInterfaceEmpty.h"
#include "bindings/tests/v8/V8TestInterfaceWillBeGarbageCollected.h"
+#include "bindings/v8/ScriptController.h"
#include "bindings/v8/V8Binding.h"
#include "core/dom/ExecutionContext.h"
#include "wtf/Assertions.h"
@@ -40,7 +41,7 @@ void V8TestCallbackInterface::voidMethod()
ScriptState::Scope scope(m_scriptState.get());
v8::Handle<v8::Value> *argv = 0;
- invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), 0, argv);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), 0, argv, m_scriptState->isolate());
}
bool V8TestCallbackInterface::booleanMethod()
@@ -55,7 +56,10 @@ bool V8TestCallbackInterface::booleanMethod()
ScriptState::Scope scope(m_scriptState.get());
v8::Handle<v8::Value> *argv = 0;
- return invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), 0, argv);
+ v8::TryCatch exceptionCatcher;
+ exceptionCatcher.SetVerbose(true);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), 0, argv, m_scriptState->isolate());
+ return !exceptionCatcher.HasCaught();
}
void V8TestCallbackInterface::voidMethodBooleanArg(bool boolArg)
@@ -76,7 +80,7 @@ void V8TestCallbackInterface::voidMethodBooleanArg(bool boolArg)
}
v8::Handle<v8::Value> argv[] = { boolArgHandle };
- invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), 1, argv);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), 1, argv, m_scriptState->isolate());
}
void V8TestCallbackInterface::voidMethodSequenceArg(const Vector<RefPtr<TestInterfaceEmpty> >& sequenceArg)
@@ -97,7 +101,7 @@ void V8TestCallbackInterface::voidMethodSequenceArg(const Vector<RefPtr<TestInte
}
v8::Handle<v8::Value> argv[] = { sequenceArgHandle };
- invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), 1, argv);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), 1, argv, m_scriptState->isolate());
}
void V8TestCallbackInterface::voidMethodFloatArg(float floatArg)
@@ -118,7 +122,7 @@ void V8TestCallbackInterface::voidMethodFloatArg(float floatArg)
}
v8::Handle<v8::Value> argv[] = { floatArgHandle };
- invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), 1, argv);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), 1, argv, m_scriptState->isolate());
}
void V8TestCallbackInterface::voidMethodTestInterfaceEmptyArg(TestInterfaceEmpty* testInterfaceEmptyArg)
@@ -139,7 +143,7 @@ void V8TestCallbackInterface::voidMethodTestInterfaceEmptyArg(TestInterfaceEmpty
}
v8::Handle<v8::Value> argv[] = { testInterfaceEmptyArgHandle };
- invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), 1, argv);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), 1, argv, m_scriptState->isolate());
}
void V8TestCallbackInterface::voidMethodTestInterfaceEmptyStringArg(TestInterfaceEmpty* testInterfaceEmptyArg, const String& stringArg)
@@ -166,7 +170,7 @@ void V8TestCallbackInterface::voidMethodTestInterfaceEmptyStringArg(TestInterfac
}
v8::Handle<v8::Value> argv[] = { testInterfaceEmptyArgHandle, stringArgHandle };
- invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), 2, argv);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), 2, argv, m_scriptState->isolate());
}
void V8TestCallbackInterface::callbackWithThisValueVoidMethodStringArg(ScriptValue thisValue, const String& stringArg)
@@ -193,7 +197,7 @@ void V8TestCallbackInterface::callbackWithThisValueVoidMethodStringArg(ScriptVal
}
v8::Handle<v8::Value> argv[] = { stringArgHandle };
- invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), thisHandle, 1, argv);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), thisHandle, 1, argv, m_scriptState->isolate());
}
void V8TestCallbackInterface::voidMethodWillBeGarbageCollectedSequenceArg(const WillBeHeapVector<RefPtrWillBeMember<TestInterfaceWillBeGarbageCollected> >& sequenceArg)
@@ -214,7 +218,7 @@ void V8TestCallbackInterface::voidMethodWillBeGarbageCollectedSequenceArg(const
}
v8::Handle<v8::Value> argv[] = { sequenceArgHandle };
- invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), 1, argv);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), 1, argv, m_scriptState->isolate());
}
void V8TestCallbackInterface::voidMethodWillBeGarbageCollectedArrayArg(const WillBeHeapVector<RefPtrWillBeMember<TestInterfaceWillBeGarbageCollected> >& arrayArg)
@@ -235,7 +239,7 @@ void V8TestCallbackInterface::voidMethodWillBeGarbageCollectedArrayArg(const Wil
}
v8::Handle<v8::Value> argv[] = { arrayArgHandle };
- invokeCallback(m_scriptState.get(), m_callback.newLocal(isolate), 1, argv);
+ ScriptController::callFunction(m_scriptState->executionContext(), m_callback.newLocal(isolate), m_scriptState->context()->Global(), 1, argv, m_scriptState->isolate());
}
} // namespace WebCore
« no previous file with comments | « Source/bindings/templates/callback_interface.cpp ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698