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

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

Issue 2408083003: Drop [ExperimentalCallbackFunction] (Closed)
Patch Set: Update tests and expectations Created 4 years, 2 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/AnyCallbackFunctionOptionalAnyArg.cpp
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionInterfaceArg.cpp b/third_party/WebKit/Source/bindings/tests/results/core/AnyCallbackFunctionOptionalAnyArg.cpp
similarity index 70%
copy from third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionInterfaceArg.cpp
copy to third_party/WebKit/Source/bindings/tests/results/core/AnyCallbackFunctionOptionalAnyArg.cpp
index 71c336beec9cb4900f92384f7497f845eebff9bf..72e959fb9c843b38f36333aac940099b2004728e 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/VoidCallbackFunctionInterfaceArg.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/AnyCallbackFunctionOptionalAnyArg.cpp
@@ -6,30 +6,30 @@
// clang-format off
-#include "VoidCallbackFunctionInterfaceArg.h"
+#include "AnyCallbackFunctionOptionalAnyArg.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/ScriptValue.h"
#include "bindings/core/v8/ToV8.h"
#include "bindings/core/v8/V8Binding.h"
-#include "bindings/core/v8/V8HTMLDivElement.h"
#include "core/dom/ExecutionContext.h"
#include "wtf/Assertions.h"
namespace blink {
-VoidCallbackFunctionInterfaceArg::VoidCallbackFunctionInterfaceArg(v8::Isolate* isolate, v8::Local<v8::Function> callback)
+AnyCallbackFunctionOptionalAnyArg::AnyCallbackFunctionOptionalAnyArg(v8::Isolate* isolate, v8::Local<v8::Function> callback)
: m_callback(isolate, callback)
{
DCHECK(!m_callback.isEmpty());
m_callback.setPhantom();
}
-DEFINE_TRACE(VoidCallbackFunctionInterfaceArg)
+DEFINE_TRACE(AnyCallbackFunctionOptionalAnyArg)
{
}
-bool VoidCallbackFunctionInterfaceArg::call(ScriptState* scriptState, ScriptWrappable* scriptWrappable, HTMLDivElement* divElement)
+bool AnyCallbackFunctionOptionalAnyArg::call(ScriptState* scriptState, ScriptWrappable* scriptWrappable, ScriptValue optionalAnyArg, ScriptValue& returnValue)
{
if (!scriptState->contextIsValid())
return false;
@@ -47,11 +47,11 @@ bool VoidCallbackFunctionInterfaceArg::call(ScriptState* scriptState, ScriptWrap
TrackExceptionState exceptionState;
ScriptState::Scope scope(scriptState);
- v8::Local<v8::Value> divElementArgument = toV8(divElement, scriptState->context()->Global(), scriptState->isolate());
+ v8::Local<v8::Value> optionalAnyArgArgument = optionalAnyArg.v8Value();
v8::Local<v8::Value> thisValue = toV8(scriptWrappable, scriptState->context()->Global(), scriptState->isolate());
- v8::Local<v8::Value> argv[] = { divElementArgument };
+ v8::Local<v8::Value> argv[] = { optionalAnyArgArgument };
v8::Local<v8::Value> v8ReturnValue;
v8::TryCatch exceptionCatcher(scriptState->isolate());
@@ -59,6 +59,8 @@ bool VoidCallbackFunctionInterfaceArg::call(ScriptState* scriptState, ScriptWrap
if (V8ScriptRunner::callFunction(m_callback.newLocal(scriptState->isolate()), scriptState->getExecutionContext(), thisValue, 1, argv, scriptState->isolate()).ToLocal(&v8ReturnValue))
{
+ ScriptValue cppValue = ScriptValue(ScriptState::current(scriptState->isolate()), v8ReturnValue);
+ returnValue = cppValue;
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698