OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8IteratorResultValue_h | 5 #ifndef V8IteratorResultValue_h |
6 #define V8IteratorResultValue_h | 6 #define V8IteratorResultValue_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptValue.h" | 8 #include "bindings/core/v8/ScriptValue.h" |
9 #include "bindings/core/v8/ToV8.h" | 9 #include "bindings/core/v8/ToV8.h" |
10 #include "core/CoreExport.h" | 10 #include "core/CoreExport.h" |
11 #include <v8.h> | 11 #include <v8.h> |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 CORE_EXPORT v8::Handle<v8::Object> v8IteratorResultValue(v8::Isolate*, bool done
, v8::Handle<v8::Value>); | 15 CORE_EXPORT v8::Local<v8::Object> v8IteratorResultValue(v8::Isolate*, bool done,
v8::Local<v8::Value>); |
16 | 16 |
17 template<typename T> | 17 template<typename T> |
18 inline ScriptValue v8IteratorResult(ScriptState* scriptState, const T& value) | 18 inline ScriptValue v8IteratorResult(ScriptState* scriptState, const T& value) |
19 { | 19 { |
20 return ScriptValue( | 20 return ScriptValue( |
21 scriptState, | 21 scriptState, |
22 v8IteratorResultValue( | 22 v8IteratorResultValue( |
23 scriptState->isolate(), | 23 scriptState->isolate(), |
24 false, | 24 false, |
25 toV8(value, scriptState->context()->Global(), scriptState->isolate()
))); | 25 toV8(value, scriptState->context()->Global(), scriptState->isolate()
))); |
26 } | 26 } |
27 | 27 |
28 inline ScriptValue v8IteratorResultDone(ScriptState* scriptState) | 28 inline ScriptValue v8IteratorResultDone(ScriptState* scriptState) |
29 { | 29 { |
30 return ScriptValue( | 30 return ScriptValue( |
31 scriptState, | 31 scriptState, |
32 v8IteratorResultValue( | 32 v8IteratorResultValue( |
33 scriptState->isolate(), | 33 scriptState->isolate(), |
34 true, | 34 true, |
35 v8::Undefined(scriptState->isolate()))); | 35 v8::Undefined(scriptState->isolate()))); |
36 } | 36 } |
37 | 37 |
38 } // namespace blink | 38 } // namespace blink |
39 | 39 |
40 #endif // V8IteratorResultValue_h | 40 #endif // V8IteratorResultValue_h |
OLD | NEW |