OLD | NEW |
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/object_template_builder.h" | 5 #include "gin/object_template_builder.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "gin/interceptor.h" | 9 #include "gin/interceptor.h" |
10 #include "gin/per_isolate_data.h" | 10 #include "gin/per_isolate_data.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 info.GetReturnValue().Set(v8::Local<v8::Array>::Cast(properties)); | 138 info.GetReturnValue().Set(v8::Local<v8::Array>::Cast(properties)); |
139 } | 139 } |
140 | 140 |
141 } // namespace | 141 } // namespace |
142 | 142 |
143 ObjectTemplateBuilder::ObjectTemplateBuilder(v8::Isolate* isolate) | 143 ObjectTemplateBuilder::ObjectTemplateBuilder(v8::Isolate* isolate) |
144 : isolate_(isolate), template_(v8::ObjectTemplate::New(isolate)) { | 144 : isolate_(isolate), template_(v8::ObjectTemplate::New(isolate)) { |
145 template_->SetInternalFieldCount(kNumberOfInternalFields); | 145 template_->SetInternalFieldCount(kNumberOfInternalFields); |
146 } | 146 } |
147 | 147 |
| 148 ObjectTemplateBuilder::ObjectTemplateBuilder( |
| 149 const ObjectTemplateBuilder& other) = default; |
| 150 |
148 ObjectTemplateBuilder::~ObjectTemplateBuilder() { | 151 ObjectTemplateBuilder::~ObjectTemplateBuilder() { |
149 } | 152 } |
150 | 153 |
151 ObjectTemplateBuilder& ObjectTemplateBuilder::AddNamedPropertyInterceptor() { | 154 ObjectTemplateBuilder& ObjectTemplateBuilder::AddNamedPropertyInterceptor() { |
152 template_->SetNamedPropertyHandler(&NamedPropertyGetter, | 155 template_->SetNamedPropertyHandler(&NamedPropertyGetter, |
153 &NamedPropertySetter, | 156 &NamedPropertySetter, |
154 &NamedPropertyQuery, | 157 &NamedPropertyQuery, |
155 NULL, | 158 NULL, |
156 &NamedPropertyEnumerator); | 159 &NamedPropertyEnumerator); |
157 return *this; | 160 return *this; |
(...skipping 22 matching lines...) Expand all Loading... |
180 return *this; | 183 return *this; |
181 } | 184 } |
182 | 185 |
183 v8::Local<v8::ObjectTemplate> ObjectTemplateBuilder::Build() { | 186 v8::Local<v8::ObjectTemplate> ObjectTemplateBuilder::Build() { |
184 v8::Local<v8::ObjectTemplate> result = template_; | 187 v8::Local<v8::ObjectTemplate> result = template_; |
185 template_.Clear(); | 188 template_.Clear(); |
186 return result; | 189 return result; |
187 } | 190 } |
188 | 191 |
189 } // namespace gin | 192 } // namespace gin |
OLD | NEW |