OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MOJO_PUBLIC_BINDINGS_JS_V8_PER_ISOLATE_DATA_H_ |
| 6 #define MOJO_PUBLIC_BINDINGS_JS_V8_PER_ISOLATE_DATA_H_ |
| 7 |
| 8 #include "mojo/public/system/macros.h" |
| 9 #include "v8/include/v8.h" |
| 10 |
| 11 namespace mojo { |
| 12 namespace js { |
| 13 |
| 14 class V8PerIsolateData { |
| 15 public: |
| 16 explicit V8PerIsolateData(v8::Isolate* isolate); |
| 17 ~V8PerIsolateData(); |
| 18 |
| 19 static V8PerIsolateData* From(v8::Isolate* isolate); |
| 20 |
| 21 v8::Local<v8::ObjectTemplate> handle_template() { |
| 22 return handle_template_.Get(isolate_); |
| 23 } |
| 24 |
| 25 v8::Local<v8::ObjectTemplate> mojo_template() { |
| 26 return mojo_template_.Get(isolate_); |
| 27 } |
| 28 |
| 29 private: |
| 30 v8::Isolate* isolate_; |
| 31 v8::Eternal<v8::ObjectTemplate> handle_template_; |
| 32 v8::Eternal<v8::ObjectTemplate> mojo_template_; |
| 33 |
| 34 MOJO_DISALLOW_COPY_AND_ASSIGN(V8PerIsolateData); |
| 35 }; |
| 36 |
| 37 } // namespace js |
| 38 } // namespace mojo |
| 39 |
| 40 #endif // MOJO_PUBLIC_BINDINGS_JS_V8_PER_ISOLATE_DATA_H_ |
OLD | NEW |