| 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 <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "bindings/core/v8/DOMDataStore.h" | 13 #include "bindings/core/v8/DOMDataStore.h" |
| 14 #include "bindings/core/v8/IDLDictionaryBase.h" | 14 #include "bindings/core/v8/IDLDictionaryBase.h" |
| 15 #include "bindings/core/v8/ScriptState.h" | 15 #include "bindings/core/v8/ScriptState.h" |
| 16 #include "bindings/core/v8/ScriptValue.h" | 16 #include "bindings/core/v8/ScriptValue.h" |
| 17 #include "bindings/core/v8/ScriptWrappable.h" | 17 #include "bindings/core/v8/ScriptWrappable.h" |
| 18 #include "bindings/core/v8/V8Binding.h" | 18 #include "bindings/core/v8/V8Binding.h" |
| 19 #include "core/CoreExport.h" | 19 #include "core/CoreExport.h" |
| 20 #include "core/dom/ArrayBufferViewHelpers.h" |
| 20 #include "platform/heap/Handle.h" | 21 #include "platform/heap/Handle.h" |
| 21 #include "platform/wtf/Forward.h" | 22 #include "platform/wtf/Forward.h" |
| 22 #include "v8/include/v8.h" | 23 #include "v8/include/v8.h" |
| 23 | 24 |
| 24 namespace blink { | 25 namespace blink { |
| 25 | 26 |
| 26 // ScriptWrappable | 27 // ScriptWrappable |
| 27 | 28 |
| 28 inline v8::Local<v8::Value> ToV8(ScriptWrappable* impl, | 29 inline v8::Local<v8::Value> ToV8(ScriptWrappable* impl, |
| 29 v8::Local<v8::Object> creation_context, | 30 v8::Local<v8::Object> creation_context, |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 // Cannot define in ScriptValue because of the circular dependency between toV8 | 298 // Cannot define in ScriptValue because of the circular dependency between toV8 |
| 298 // and ScriptValue | 299 // and ScriptValue |
| 299 template <typename T> | 300 template <typename T> |
| 300 inline ScriptValue ScriptValue::From(ScriptState* script_state, T&& value) { | 301 inline ScriptValue ScriptValue::From(ScriptState* script_state, T&& value) { |
| 301 return ScriptValue(script_state, ToV8(std::forward<T>(value), script_state)); | 302 return ScriptValue(script_state, ToV8(std::forward<T>(value), script_state)); |
| 302 } | 303 } |
| 303 | 304 |
| 304 } // namespace blink | 305 } // namespace blink |
| 305 | 306 |
| 306 #endif // ToV8ForPlatform_h | 307 #endif // ToV8ForPlatform_h |
| OLD | NEW |