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

Unified Diff: mojo/public/bindings/js/v8_per_isolate_data.cc

Issue 59153005: Begin implementing V8 bindings for Mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix style nits 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
« no previous file with comments | « mojo/public/bindings/js/v8_per_isolate_data.h ('k') | mojo/public/bindings/js/v8_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/js/v8_per_isolate_data.cc
diff --git a/mojo/public/bindings/js/v8_per_isolate_data.cc b/mojo/public/bindings/js/v8_per_isolate_data.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2b15171810f526bae62105269278dfe1f3e1ef34
--- /dev/null
+++ b/mojo/public/bindings/js/v8_per_isolate_data.cc
@@ -0,0 +1,28 @@
+// 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 "mojo/public/bindings/js/v8_per_isolate_data.h"
+
+#include "mojo/public/bindings/js/v8_core.h"
+#include "mojo/public/bindings/js/v8_mojo.h"
+
+namespace mojo {
+namespace js {
+
+V8PerIsolateData::V8PerIsolateData(v8::Isolate* isolate)
+ : isolate_(isolate),
+ handle_template_(isolate, Wrapper<mojo::Handle>::CreateTemplate()),
+ mojo_template_(isolate, CreateMojoTemplate()) {
Aaron Boodman 2013/11/09 08:26:02 I think it is possible to reduce the duplication a
abarth-chromium 2013/11/09 08:52:38 Will do. That will make it easier to separate the
+ isolate_->SetData(this);
+}
+
+V8PerIsolateData::~V8PerIsolateData() {
+}
+
+V8PerIsolateData* V8PerIsolateData::From(v8::Isolate* isolate) {
+ return static_cast<V8PerIsolateData*>(isolate->GetData());
+}
+
+} // namespace js
+} // namespace mojo
« no previous file with comments | « mojo/public/bindings/js/v8_per_isolate_data.h ('k') | mojo/public/bindings/js/v8_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698