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 ToV8_h | 5 #ifndef ToV8_h |
6 #define ToV8_h | 6 #define ToV8_h |
7 | 7 |
8 // ToV8() provides C++ -> V8 conversion. Note that ToV8() can return an empty | 8 // ToV8() provides C++ -> V8 conversion. Note that ToV8() can return an empty |
9 // handle. Call sites must check IsEmpty() before using return value. | 9 // handle. Call sites must check IsEmpty() before using return value. |
10 | 10 |
| 11 #include <v8.h> |
| 12 #include <utility> |
11 #include "bindings/core/v8/DOMDataStore.h" | 13 #include "bindings/core/v8/DOMDataStore.h" |
12 #include "bindings/core/v8/IDLDictionaryBase.h" | 14 #include "bindings/core/v8/IDLDictionaryBase.h" |
13 #include "bindings/core/v8/ScriptState.h" | 15 #include "bindings/core/v8/ScriptState.h" |
14 #include "bindings/core/v8/ScriptValue.h" | 16 #include "bindings/core/v8/ScriptValue.h" |
15 #include "bindings/core/v8/ScriptWrappable.h" | 17 #include "bindings/core/v8/ScriptWrappable.h" |
16 #include "bindings/core/v8/V8Binding.h" | 18 #include "bindings/core/v8/V8Binding.h" |
17 #include "core/CoreExport.h" | 19 #include "core/CoreExport.h" |
18 #include "platform/heap/Handle.h" | 20 #include "platform/heap/Handle.h" |
19 #include "wtf/Forward.h" | 21 #include "wtf/Forward.h" |
20 #include <utility> | |
21 #include <v8.h> | |
22 | 22 |
23 namespace blink { | 23 namespace blink { |
24 | 24 |
25 class DOMWindow; | 25 class DOMWindow; |
26 class Dictionary; | 26 class Dictionary; |
27 class EventTarget; | 27 class EventTarget; |
28 | 28 |
29 // ScriptWrappable | 29 // ScriptWrappable |
30 | 30 |
31 inline v8::Local<v8::Value> ToV8(ScriptWrappable* impl, | 31 inline v8::Local<v8::Value> ToV8(ScriptWrappable* impl, |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // Cannot define in ScriptValue because of the circular dependency between toV8 | 307 // Cannot define in ScriptValue because of the circular dependency between toV8 |
308 // and ScriptValue | 308 // and ScriptValue |
309 template <typename T> | 309 template <typename T> |
310 inline ScriptValue ScriptValue::from(ScriptState* scriptState, T&& value) { | 310 inline ScriptValue ScriptValue::from(ScriptState* scriptState, T&& value) { |
311 return ScriptValue(scriptState, ToV8(std::forward<T>(value), scriptState)); | 311 return ScriptValue(scriptState, ToV8(std::forward<T>(value), scriptState)); |
312 } | 312 } |
313 | 313 |
314 } // namespace blink | 314 } // namespace blink |
315 | 315 |
316 #endif // ToV8_h | 316 #endif // ToV8_h |
OLD | NEW |