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

Unified Diff: gin/dictionary.cc

Issue 59153005: Begin implementing V8 bindings for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix skipped comment 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
« gin/arguments.cc ('K') | « gin/dictionary.h ('k') | gin/gin.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/dictionary.cc
diff --git a/gin/dictionary.cc b/gin/dictionary.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0da85af79347dd1c3f08e11c5b30549ddedc5d1e
--- /dev/null
+++ b/gin/dictionary.cc
@@ -0,0 +1,40 @@
+// 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/dictionary.h"
+
+namespace gin {
+
+Dictionary::Dictionary(v8::Isolate* isolate)
+ : isolate_(isolate) {
+}
+
+Dictionary::Dictionary(v8::Isolate* isolate,
+ v8::Handle<v8::Object> object)
+ : isolate_(isolate),
+ object_(object) {
+}
+
+Dictionary::~Dictionary() {
+}
+
+Dictionary Dictionary::CreateEmpty(v8::Isolate* isolate) {
+ Dictionary dictionary(isolate);
+ dictionary.object_ = v8::Object::New();
+ return dictionary;
+}
+
+v8::Handle<v8::Value> Converter<Dictionary>::ToV8(v8::Isolate* isolate,
+ Dictionary val) {
+ return val.object_;
+}
+
+bool FromV8(v8::Handle<v8::Value> val, Dictionary* out) {
+ if (!val->IsObject())
+ return false;
+ *out = Dictionary(out->isolate(), v8::Handle<v8::Object>::Cast(val));
+ return true;
+}
+
+} // namespace gin
« gin/arguments.cc ('K') | « gin/dictionary.h ('k') | gin/gin.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698