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 "bindings/core/v8/GeneratedCodeHelper.h" | 5 #include "bindings/core/v8/GeneratedCodeHelper.h" |
6 | 6 |
7 #include "bindings/core/v8/SerializedScriptValue.h" | |
8 #include "bindings/core/v8/V8BindingForCore.h" | 7 #include "bindings/core/v8/V8BindingForCore.h" |
| 8 #include "bindings/core/v8/serialization/SerializedScriptValue.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 void V8ConstructorAttributeGetter( | 12 void V8ConstructorAttributeGetter( |
13 v8::Local<v8::Name> property_name, | 13 v8::Local<v8::Name> property_name, |
14 const v8::PropertyCallbackInfo<v8::Value>& info) { | 14 const v8::PropertyCallbackInfo<v8::Value>& info) { |
15 v8::Local<v8::Value> data = info.Data(); | 15 v8::Local<v8::Value> data = info.Data(); |
16 DCHECK(data->IsExternal()); | 16 DCHECK(data->IsExternal()); |
17 V8PerContextData* per_context_data = | 17 V8PerContextData* per_context_data = |
18 V8PerContextData::From(info.Holder()->CreationContext()); | 18 V8PerContextData::From(info.Holder()->CreationContext()); |
19 if (!per_context_data) | 19 if (!per_context_data) |
20 return; | 20 return; |
21 V8SetReturnValue(info, per_context_data->ConstructorForType( | 21 V8SetReturnValue(info, per_context_data->ConstructorForType( |
22 WrapperTypeInfo::Unwrap(data))); | 22 WrapperTypeInfo::Unwrap(data))); |
23 } | 23 } |
24 | 24 |
25 v8::Local<v8::Value> V8Deserialize(v8::Isolate* isolate, | 25 v8::Local<v8::Value> V8Deserialize(v8::Isolate* isolate, |
26 PassRefPtr<SerializedScriptValue> value) { | 26 PassRefPtr<SerializedScriptValue> value) { |
27 if (value) | 27 if (value) |
28 return value->Deserialize(isolate); | 28 return value->Deserialize(isolate); |
29 return v8::Null(isolate); | 29 return v8::Null(isolate); |
30 } | 30 } |
31 | 31 |
32 } // namespace blink | 32 } // namespace blink |
OLD | NEW |