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

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunction2.cpp

Issue 2312093003: Generated bindings for IDL callback functions (Closed)
Patch Set: Did rebase-update Created 4 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
Index: third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunction2.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunction2.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunction2.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..dd618dc72ecce4ea90a959a61516dda355e53c68
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8VoidCallbackFunction2.cpp
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
+
+#include "V8VoidCallbackFunction2.h"
+
+#include "wtf/Assertions.h"
+#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/V8Binding.h"
+
+namespace blink {
+
+V8VoidCallbackFunction2::V8VoidCallbackFunction2(v8::Local<v8::Function> callback, ScriptState* scriptState)
+ : m_callback(scriptState->isolate(), callback)
+ , m_scriptState(scriptState)
+{
+ m_callback.setPhantom();
+}
+
+DEFINE_TRACE(V8VoidCallbackFunction2)
+{
+}
+
+bool V8VoidCallbackFunction2::call(ScriptValue thisValue)
+{
+ if (!m_scriptState->contextIsValid())
+ return false;
+
+ ScriptState::Scope scope(m_scriptState.get());
+
+ if (m_callback.isEmpty())
+ return false;
+
+ v8::Local<v8::Value> *argv = 0;
+
+ v8::Local<v8::Value> currentValue;
+ v8::TryCatch exceptionCatcher(m_scriptState->isolate());
+ exceptionCatcher.SetVerbose(true);
+ if (V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate()), m_scriptState->getExecutionContext(), m_scriptState->context()->Global(), 0, argv, m_scriptState->isolate()).ToLocal(&currentValue))
+ {
+ returnValue = cppValue;
+ return true;
+ }
+ else { return false; }
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698