Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/GeneratedCodeHelper.cpp

Issue 2857143005: Gather serialization-related code into a directory. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/bindings.gni ('k') | third_party/WebKit/Source/bindings/core/v8/ScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698