| Index: third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl
|
| diff --git a/third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl
|
| index 8390f85535d9592c3dcb32121768fa70dd6078ce..16735eb1a9fd196b1d058585be27b8e562f5c55c 100644
|
| --- a/third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl
|
| +++ b/third_party/WebKit/Source/bindings/templates/callback_function.cpp.tmpl
|
| @@ -12,43 +12,43 @@
|
| namespace blink {
|
|
|
| // static
|
| -{{cpp_class}}* {{cpp_class}}::create(ScriptState* scriptState, v8::Local<v8::Value> callback) {
|
| - if (isUndefinedOrNull(callback))
|
| +{{cpp_class}}* {{cpp_class}}::Create(ScriptState* scriptState, v8::Local<v8::Value> callback) {
|
| + if (IsUndefinedOrNull(callback))
|
| return nullptr;
|
| return new {{cpp_class}}(scriptState, v8::Local<v8::Function>::Cast(callback));
|
| }
|
|
|
| {{cpp_class}}::{{cpp_class}}(ScriptState* scriptState, v8::Local<v8::Function> callback)
|
| : m_scriptState(scriptState),
|
| - m_callback(scriptState->isolate(), this, callback) {
|
| - DCHECK(!m_callback.isEmpty());
|
| + m_callback(scriptState->GetIsolate(), this, callback) {
|
| + DCHECK(!m_callback.IsEmpty());
|
| }
|
|
|
| DEFINE_TRACE_WRAPPERS({{cpp_class}}) {
|
| - visitor->traceWrappers(m_callback.cast<v8::Value>());
|
| + visitor->TraceWrappers(m_callback.Cast<v8::Value>());
|
| }
|
|
|
| bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) {
|
| - if (m_callback.isEmpty())
|
| + if (m_callback.IsEmpty())
|
| return false;
|
|
|
| - if (!m_scriptState->contextIsValid())
|
| + if (!m_scriptState->ContextIsValid())
|
| return false;
|
|
|
| - ExecutionContext* context = m_scriptState->getExecutionContext();
|
| + ExecutionContext* context = m_scriptState->GetExecutionContext();
|
| DCHECK(context);
|
| - if (context->isContextSuspended() || context->isContextDestroyed())
|
| + if (context->IsContextSuspended() || context->IsContextDestroyed())
|
| return false;
|
|
|
| // TODO(bashi): Make sure that using DummyExceptionStateForTesting is OK.
|
| // crbug.com/653769
|
| DummyExceptionStateForTesting exceptionState;
|
| - ScriptState::Scope scope(m_scriptState.get());
|
| - v8::Isolate* isolate = m_scriptState->isolate();
|
| + ScriptState::Scope scope(m_scriptState.Get());
|
| + v8::Isolate* isolate = m_scriptState->GetIsolate();
|
|
|
| v8::Local<v8::Value> thisValue = ToV8(
|
| scriptWrappable,
|
| - m_scriptState->context()->Global(),
|
| + m_scriptState->GetContext()->Global(),
|
| isolate);
|
|
|
| {% for argument in arguments %}
|
| @@ -64,7 +64,7 @@ bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) {
|
| exceptionCatcher.SetVerbose(true);
|
|
|
| v8::Local<v8::Value> v8ReturnValue;
|
| - if (!V8ScriptRunner::callFunction(m_callback.newLocal(isolate),
|
| + if (!V8ScriptRunner::CallFunction(m_callback.NewLocal(isolate),
|
| context,
|
| thisValue,
|
| {{arguments | length}},
|
| @@ -80,10 +80,10 @@ bool {{cpp_class}}::call({{argument_declarations | join(', ')}}) {
|
| return true;
|
| }
|
|
|
| -{{cpp_class}}* NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
|
| - {{cpp_class}}* nativeValue = {{cpp_class}}::create(ScriptState::current(isolate), value);
|
| +{{cpp_class}}* NativeValueTraits<{{cpp_class}}>::NativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
|
| + {{cpp_class}}* nativeValue = {{cpp_class}}::Create(ScriptState::Current(isolate), value);
|
| if (!nativeValue)
|
| - exceptionState.throwTypeError("Unable to convert value to {{callback_function_name}}.");
|
| + exceptionState.ThrowTypeError("Unable to convert value to {{callback_function_name}}.");
|
| return nativeValue;
|
| }
|
|
|
|
|