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

Unified Diff: chrome/renderer/extensions/object_backed_native_handler.h

Issue 16032015: Extensions: pass ChromeV8Context around instead of v8::Handle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 6 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
Index: chrome/renderer/extensions/object_backed_native_handler.h
diff --git a/chrome/renderer/extensions/object_backed_native_handler.h b/chrome/renderer/extensions/object_backed_native_handler.h
index 0439adfed5de30ad755b421b191af58014235c9b..78e893d197c1de59220286bb154dc858bf5472a3 100644
--- a/chrome/renderer/extensions/object_backed_native_handler.h
+++ b/chrome/renderer/extensions/object_backed_native_handler.h
@@ -15,13 +15,14 @@
#include "v8/include/v8.h"
namespace extensions {
+class ChromeV8Context;
// An ObjectBackedNativeHandler is a factory for JS objects with functions on
// them that map to native C++ functions. Subclasses should call RouteFunction()
// in their constructor to define functions on the created JS objects.
class ObjectBackedNativeHandler : public NativeHandler {
public:
- explicit ObjectBackedNativeHandler(v8::Handle<v8::Context> context);
+ explicit ObjectBackedNativeHandler(ChromeV8Context* context);
virtual ~ObjectBackedNativeHandler();
// Create an object with bindings to the native functions defined through
@@ -38,7 +39,7 @@ class ObjectBackedNativeHandler : public NativeHandler {
void RouteFunction(const std::string& name,
const HandlerFunction& handler_function);
- v8::Handle<v8::Context> v8_context() { return v8_context_.get(); }
+ ChromeV8Context* context() { return context_; }
virtual void Invalidate() OVERRIDE;
@@ -63,9 +64,7 @@ class ObjectBackedNativeHandler : public NativeHandler {
typedef std::vector<v8::Persistent<v8::Object> > RouterData;
RouterData router_data_;
- // TODO(kalman): Just pass around a ChromeV8Context. It already has a
- // persistent handle to this context.
- ScopedPersistent<v8::Context> v8_context_;
+ ChromeV8Context* context_;
ScopedPersistent<v8::ObjectTemplate> object_template_;
« no previous file with comments | « chrome/renderer/extensions/module_system_unittest.cc ('k') | chrome/renderer/extensions/object_backed_native_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698