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

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

Issue 23799009: Always pass v8::Isolate to v8::Number::New() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/tests/results/V8TestCallback.h ('k') | Source/bindings/v8/IDBBindingUtilities.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestCallback.cpp
diff --git a/Source/bindings/tests/results/V8TestCallback.cpp b/Source/bindings/tests/results/V8TestCallback.cpp
index 650b4cae4b62432ee04d7543d10a3a17631be882..588ec60c2c3da67e868fce9796a41b6ececbd940 100644
--- a/Source/bindings/tests/results/V8TestCallback.cpp
+++ b/Source/bindings/tests/results/V8TestCallback.cpp
@@ -217,6 +217,35 @@ bool V8TestCallback::callbackWithSequence(const Vector<RefPtr<TestObj> >& sequen
return !invokeCallback(m_callback.newLocal(isolate), 1, argv, callbackReturnValue, scriptExecutionContext(), isolate);
}
+bool V8TestCallback::callbackWithFloat(float floatParam)
+{
+ if (!canInvokeCallback())
+ return true;
+
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::HandleScope handleScope(isolate);
+
+ v8::Handle<v8::Context> v8Context = toV8Context(scriptExecutionContext(), m_world.get());
+ if (v8Context.IsEmpty())
+ return true;
+
+ v8::Context::Scope scope(v8Context);
+
+ v8::Handle<v8::Value> floatParamHandle = v8::Number::New(isolate, floatParam);
+ if (floatParamHandle.IsEmpty()) {
+ if (!isScriptControllerTerminating())
+ CRASH();
+ return true;
+ }
+
+ v8::Handle<v8::Value> argv[] = {
+ floatParamHandle
+ };
+
+ bool callbackReturnValue = false;
+ return !invokeCallback(m_callback.newLocal(isolate), 1, argv, callbackReturnValue, scriptExecutionContext(), isolate);
+}
+
bool V8TestCallback::callbackWithThisArg(ScriptValue thisValue, int param)
{
if (!canInvokeCallback())
« no previous file with comments | « Source/bindings/tests/results/V8TestCallback.h ('k') | Source/bindings/v8/IDBBindingUtilities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698