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

Unified Diff: gin/data_object_builder.cc

Issue 2845463002: gin: Create a DataObjectBuilder class to help create simple data objects. (Closed)
Patch Set: data_object_builder.cc Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: gin/data_object_builder.cc
diff --git a/gin/data_object_builder.cc b/gin/data_object_builder.cc
new file mode 100644
index 0000000000000000000000000000000000000000..243c7efc5ff60fde3d2eb2899fa99be70e02189a
--- /dev/null
+++ b/gin/data_object_builder.cc
@@ -0,0 +1,14 @@
+// Copyright 2017 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/data_object_builder.h"
+
+namespace gin {
+
+DataObjectBuilder::DataObjectBuilder(v8::Isolate* isolate)
+ : isolate_(isolate),
+ context_(isolate->GetCurrentContext()),
Devlin 2017/04/26 15:50:31 Would it be better to pass in the context and get
jbroman 2017/04/26 17:47:31 It's a bit of a lie because v8::Object::New alread
Devlin 2017/04/26 18:30:23 Ah, good point. This is fine. On that note, naiv
+ object_(v8::Object::New(isolate)) {}
+
+} // namespace gin

Powered by Google App Engine
This is Rietveld 408576698