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

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

Issue 12378077: Attempting to fix problems in 11571014. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 7 years, 10 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 | « chrome/renderer/extensions/module_system.cc ('k') | chrome/renderer/extensions/native_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/renderer/extensions/module_system.cc ('k') | chrome/renderer/extensions/native_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698