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

Side by Side Diff: gin/dictionary.cc

Issue 1727063002: gin: Add out-of-line copy ctors for complex classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « gin/dictionary.h ('k') | gin/object_template_builder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "gin/dictionary.h" 5 #include "gin/dictionary.h"
6 6
7 namespace gin { 7 namespace gin {
8 8
9 Dictionary::Dictionary(v8::Isolate* isolate) 9 Dictionary::Dictionary(v8::Isolate* isolate)
10 : isolate_(isolate) { 10 : isolate_(isolate) {
11 } 11 }
12 12
13 Dictionary::Dictionary(v8::Isolate* isolate, 13 Dictionary::Dictionary(v8::Isolate* isolate,
14 v8::Local<v8::Object> object) 14 v8::Local<v8::Object> object)
15 : isolate_(isolate), 15 : isolate_(isolate),
16 object_(object) { 16 object_(object) {
17 } 17 }
18 18
19 Dictionary::Dictionary(const Dictionary& other) = default;
20
19 Dictionary::~Dictionary() { 21 Dictionary::~Dictionary() {
20 } 22 }
21 23
22 Dictionary Dictionary::CreateEmpty(v8::Isolate* isolate) { 24 Dictionary Dictionary::CreateEmpty(v8::Isolate* isolate) {
23 Dictionary dictionary(isolate); 25 Dictionary dictionary(isolate);
24 dictionary.object_ = v8::Object::New(isolate); 26 dictionary.object_ = v8::Object::New(isolate);
25 return dictionary; 27 return dictionary;
26 } 28 }
27 29
28 v8::Local<v8::Value> Converter<Dictionary>::ToV8(v8::Isolate* isolate, 30 v8::Local<v8::Value> Converter<Dictionary>::ToV8(v8::Isolate* isolate,
29 Dictionary val) { 31 Dictionary val) {
30 return val.object_; 32 return val.object_;
31 } 33 }
32 34
33 bool Converter<Dictionary>::FromV8(v8::Isolate* isolate, 35 bool Converter<Dictionary>::FromV8(v8::Isolate* isolate,
34 v8::Local<v8::Value> val, 36 v8::Local<v8::Value> val,
35 Dictionary* out) { 37 Dictionary* out) {
36 if (!val->IsObject()) 38 if (!val->IsObject())
37 return false; 39 return false;
38 *out = Dictionary(isolate, v8::Local<v8::Object>::Cast(val)); 40 *out = Dictionary(isolate, v8::Local<v8::Object>::Cast(val));
39 return true; 41 return true;
40 } 42 }
41 43
42 } // namespace gin 44 } // namespace gin
OLDNEW
« no previous file with comments | « gin/dictionary.h ('k') | gin/object_template_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698