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

Unified Diff: webkit/glue/devtools/bound_object.h

Issue 113836: DevTools: introduce bound object on the agent side. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months 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 | « webkit/glue/chrome_client_impl.cc ('k') | webkit/glue/devtools/bound_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/devtools/bound_object.h
===================================================================
--- webkit/glue/devtools/bound_object.h (revision 0)
+++ webkit/glue/devtools/bound_object.h (revision 0)
@@ -0,0 +1,31 @@
+// Copyright (c) 2009 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.
+
+#ifndef WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_
+#define WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_
+
+#include "v8.h"
+
+// BoundObject lets you map JavaScript method calls and property accesses
+// directly to C++ method calls and V8 variable access.
+class BoundObject {
+ public:
+ BoundObject(v8::Handle<v8::Context> context,
+ void* v8_this,
+ const char* object_name);
+ virtual ~BoundObject();
+
+ void AddProtoFunction(const char* name, v8::InvocationCallback callback);
+ void Build();
+
+ private:
+ const char* object_name_;
+ v8::Handle<v8::Context> context_;
+ v8::Persistent<v8::FunctionTemplate> host_template_;
+ v8::Persistent<v8::External> v8_this_;
+ v8::Persistent<v8::Object> bound_object_;
+ DISALLOW_COPY_AND_ASSIGN(BoundObject);
+};
+
+#endif // WEBKIT_GLUE_DEVTOOLS_BOUND_OBJECT_H_
« no previous file with comments | « webkit/glue/chrome_client_impl.cc ('k') | webkit/glue/devtools/bound_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698