Index: chrome/renderer/extensions/native_handler.h |
diff --git a/chrome/renderer/extensions/native_handler.h b/chrome/renderer/extensions/native_handler.h |
index 36ef991806958932b5ff0d8952a73a08f016db46..82c86318ef89736de977d3565f53f352a5f6eb0f 100644 |
--- a/chrome/renderer/extensions/native_handler.h |
+++ b/chrome/renderer/extensions/native_handler.h |
@@ -16,10 +16,26 @@ namespace extensions { |
// TODO(koz): Rename this to NativeJavaScriptModule. |
class NativeHandler { |
public: |
- virtual ~NativeHandler() {} |
+ NativeHandler(); |
+ virtual ~NativeHandler(); |
// Create a new instance of the object this handler specifies. |
virtual v8::Handle<v8::Object> NewInstance() = 0; |
+ |
+ // Invalidate this object so it cannot be used any more. This is needed |
+ // because it's possible for this to outlive its owner context. Invalidate |
+ // must be called before this happens. |
+ // |
+ // Subclasses should override to invalidate their own V8 state. If they do |
+ // they must call their superclass' Invalidate(). |
+ virtual void Invalidate(); |
+ |
+ protected: |
+ // Allow subclasses to query valid state. |
+ bool is_valid() { return is_valid_; } |
+ |
+ private: |
+ bool is_valid_; |
}; |
} // extensions |