Chromium Code Reviews| 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..c4ac7075571bcac7f04269020959ac9eadb52d9f 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,10 +39,13 @@ class ObjectBackedNativeHandler : public NativeHandler { |
| void RouteFunction(const std::string& name, |
| const HandlerFunction& handler_function); |
| - v8::Handle<v8::Context> v8_context() { return v8_context_.get(); } |
| + v8::Handle<v8::Context> v8_context(); |
|
not at google - send to devlin
2013/05/29 15:55:13
can this be made to return a ChromeV8Context* (and
marja
2013/05/29 16:56:33
Done.
|
| virtual void Invalidate() OVERRIDE; |
| + protected: |
| + ChromeV8Context* context_; |
|
not at google - send to devlin
2013/05/29 15:55:13
then this can be private
marja
2013/05/29 16:56:33
Done.
|
| + |
| private: |
| // Callback for RouteFunction which routes the V8 call to the correct |
| // base::Bound callback. |
| @@ -63,10 +67,6 @@ 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_; |
| - |
| ScopedPersistent<v8::ObjectTemplate> object_template_; |
| DISALLOW_COPY_AND_ASSIGN(ObjectBackedNativeHandler); |