OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 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 WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_ |
| 6 #define WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_ |
| 7 |
| 8 #include "v8.h" |
| 9 |
| 10 // BoundObject lets you map JavaScript method calls and property accesses |
| 11 // directly to C++ method calls and V8 variable access. |
| 12 class BoundObject { |
| 13 public: |
| 14 BoundObject(v8::Handle<v8::Context> context, |
| 15 void* v8_this, |
| 16 const char* object_name); |
| 17 virtual ~BoundObject(); |
| 18 |
| 19 void AddProtoFunction(const char* name, v8::InvocationCallback callback); |
| 20 void Build(); |
| 21 |
| 22 private: |
| 23 const char* object_name_; |
| 24 v8::Handle<v8::Context> context_; |
| 25 v8::Persistent<v8::FunctionTemplate> host_template_; |
| 26 v8::Persistent<v8::External> v8_this_; |
| 27 v8::Persistent<v8::Object> bound_object_; |
| 28 DISALLOW_COPY_AND_ASSIGN(BoundObject); |
| 29 }; |
| 30 |
| 31 #endif // WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_ |
OLD | NEW |