Chromium Code Reviews| 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 |