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

Unified Diff: gin/object_template_builder.cc

Issue 93813002: Implement gin::ObjectTemplateBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698