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

Side by Side Diff: gin/object_template_builder.h

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, 9 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.cc ('k') | gin/object_template_builder.cc » ('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 #ifndef GIN_OBJECT_TEMPLATE_BUILDER_H_ 5 #ifndef GIN_OBJECT_TEMPLATE_BUILDER_H_
6 #define GIN_OBJECT_TEMPLATE_BUILDER_H_ 6 #define GIN_OBJECT_TEMPLATE_BUILDER_H_
7 7
8 #include <type_traits> 8 #include <type_traits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 }; 82 };
83 83
84 } // namespace 84 } // namespace
85 85
86 86
87 // ObjectTemplateBuilder provides a handy interface to creating 87 // ObjectTemplateBuilder provides a handy interface to creating
88 // v8::ObjectTemplate instances with various sorts of properties. 88 // v8::ObjectTemplate instances with various sorts of properties.
89 class GIN_EXPORT ObjectTemplateBuilder { 89 class GIN_EXPORT ObjectTemplateBuilder {
90 public: 90 public:
91 explicit ObjectTemplateBuilder(v8::Isolate* isolate); 91 explicit ObjectTemplateBuilder(v8::Isolate* isolate);
92 ObjectTemplateBuilder(const ObjectTemplateBuilder& other);
92 ~ObjectTemplateBuilder(); 93 ~ObjectTemplateBuilder();
93 94
94 // It's against Google C++ style to return a non-const ref, but we take some 95 // It's against Google C++ style to return a non-const ref, but we take some
95 // poetic license here in order that all calls to Set() can be via the '.' 96 // poetic license here in order that all calls to Set() can be via the '.'
96 // operator and line up nicely. 97 // operator and line up nicely.
97 template<typename T> 98 template<typename T>
98 ObjectTemplateBuilder& SetValue(const base::StringPiece& name, T val) { 99 ObjectTemplateBuilder& SetValue(const base::StringPiece& name, T val) {
99 return SetImpl(name, ConvertToV8(isolate_, val)); 100 return SetImpl(name, ConvertToV8(isolate_, val));
100 } 101 }
101 102
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 142
142 v8::Isolate* isolate_; 143 v8::Isolate* isolate_;
143 144
144 // ObjectTemplateBuilder should only be used on the stack. 145 // ObjectTemplateBuilder should only be used on the stack.
145 v8::Local<v8::ObjectTemplate> template_; 146 v8::Local<v8::ObjectTemplate> template_;
146 }; 147 };
147 148
148 } // namespace gin 149 } // namespace gin
149 150
150 #endif // GIN_OBJECT_TEMPLATE_BUILDER_H_ 151 #endif // GIN_OBJECT_TEMPLATE_BUILDER_H_
OLDNEW
« no previous file with comments | « gin/dictionary.cc ('k') | gin/object_template_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698