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

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

Issue 2730183003: bindings: Add C++ versions of WebIDL types and generalize NativeValueTraits. (Closed)
Patch Set: Created 3 years, 10 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/LongCallbackFunction.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.cpp b/third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.cpp
index bd4c57bee75ad36acdd49e14fa4446704beb60c0..12a83e58c313c952d5b04647b37b5e2757340f9f 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/LongCallbackFunction.cpp
@@ -13,9 +13,11 @@
#include "LongCallbackFunction.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/IDLTypes.h"
#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/ToV8.h"
#include "bindings/core/v8/V8Binding.h"
+#include "bindings/core/v8/V8BindingForIDLTypes.h"
#include "core/dom/ExecutionContext.h"
#include "wtf/Assertions.h"
@@ -69,7 +71,7 @@ bool LongCallbackFunction::call(ScriptWrappable* scriptWrappable, int32_t num1,
exceptionCatcher.SetVerbose(true);
if (V8ScriptRunner::callFunction(m_callback.newLocal(m_scriptState->isolate()), m_scriptState->getExecutionContext(), thisValue, 2, argv, m_scriptState->isolate()).ToLocal(&v8ReturnValue)) {
- int32_t cppValue = toInt32(m_scriptState->isolate(), v8ReturnValue, NormalConversion, exceptionState);
+ int32_t cppValue = NativeValueTraits<IDLLong>::nativeValue(m_scriptState->isolate(), v8ReturnValue, exceptionState, NormalConversion);
if (exceptionState.hadException())
return false;
returnValue = cppValue;
@@ -78,4 +80,8 @@ bool LongCallbackFunction::call(ScriptWrappable* scriptWrappable, int32_t num1,
return false;
}
+LongCallbackFunction* NativeValueTraits<LongCallbackFunction>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
+ return LongCallbackFunction::create(ScriptState::current(isolate), value);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698