Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/testing/CallbackFunctionTest.h" | 5 #include "core/testing/CallbackFunctionTest.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptState.h" | 7 #include "bindings/core/v8/ScriptState.h" |
| 8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
| 9 #include "bindings/core/v8/V8TestCallback.h" | 9 #include "bindings/core/v8/V8TestCallback.h" |
| 10 #include "bindings/core/v8/V8TestInterfaceCallback.h" | |
| 11 #include "core/html/HTMLDivElement.h" | |
| 10 | 12 |
| 11 namespace blink { | 13 namespace blink { |
| 12 | 14 |
| 13 DEFINE_TRACE(CallbackFunctionTest) | 15 DEFINE_TRACE(CallbackFunctionTest) |
| 14 { | 16 { |
| 15 } | 17 } |
| 16 | 18 |
| 17 String CallbackFunctionTest::testCallback(ScriptState* scriptState, V8TestCallba ck* callback, const String& message1, const String& message2, ExceptionState& ex ceptionState) | 19 String CallbackFunctionTest::testCallback(ScriptState* scriptState, V8TestCallba ck* callback, const String& message1, const String& message2, ExceptionState& ex ceptionState) |
| 18 { | 20 { |
| 19 ScriptWrappable* scriptWrappable; | 21 ScriptWrappable* scriptWrappable; |
| 20 String returnValue; | 22 String returnValue; |
| 21 | 23 |
| 22 if (callback->call(scriptState, scriptWrappable = nullptr, message1, message 2, returnValue)) { | 24 if (callback->call(scriptState, scriptWrappable = nullptr, message1, message 2, returnValue)) { |
| 23 return String("SUCCESS: ") + returnValue; | 25 return String("SUCCESS: ") + returnValue; |
| 24 } | 26 } |
| 25 return String("Error!"); | 27 return String("Error!"); |
| 26 } | 28 } |
| 27 | 29 |
| 30 void CallbackFunctionTest::testInterfaceCallback(ScriptState* scriptState, V8Tes tInterfaceCallback* callback, HeapVector<Member<HTMLDivElement>>& div, Exception State& exceptionState) | |
|
bashi
2016/09/23 02:16:05
div -> divElements ?
lkawai
2016/09/23 02:43:42
Done.
| |
| 31 { | |
| 32 ScriptWrappable* scriptWrappable; | |
|
peria
2016/09/23 02:50:05
initialize |scriptWrappable|
lkawai
2016/09/23 05:35:45
In the past CL, I got a comment that initializatio
peria
2016/09/23 15:34:49
All variables must be initialized at their declara
| |
| 33 | |
| 34 callback->call(scriptState, scriptWrappable = nullptr, div); | |
| 35 return; | |
| 36 } | |
| 37 | |
| 28 } // namespace blink | 38 } // namespace blink |
| OLD | NEW |