Chromium Code Reviews| Index: gin/object_template_builder.cc |
| diff --git a/gin/object_template_builder.cc b/gin/object_template_builder.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..73d3f31df4f2569ea34c94c31b35b62216d48552 |
| --- /dev/null |
| +++ b/gin/object_template_builder.cc |
| @@ -0,0 +1,27 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "gin/object_template_builder.h" |
| + |
| +namespace gin { |
| + |
| +ObjectTemplateBuilder::ObjectTemplateBuilder(v8::Isolate* isolate) |
| + : isolate_(isolate), template_(v8::ObjectTemplate::New(isolate)) { |
| +} |
| + |
| +ObjectTemplateBuilder::~ObjectTemplateBuilder() { |
| +} |
| + |
| +ObjectTemplateBuilder& ObjectTemplateBuilder::SetImpl( |
| + const base::StringPiece& name, v8::Handle<v8::Data> val) { |
| + template_->Set(StringToSymbol(isolate_, name), val); |
| + return *this; |
| +} |
| + |
| +v8::Local<v8::ObjectTemplate> ObjectTemplateBuilder::Build() { |
| + // Not hard to build! |
| + return template_; |
|
abarth-chromium
2013/11/28 06:27:09
Should we clear out template_ at this point?
Aaron Boodman
2013/11/28 18:25:22
Done.
|
| +} |
| + |
| +} // namespace gin |