Index: extensions/renderer/script_context.h |
diff --git a/extensions/renderer/script_context.h b/extensions/renderer/script_context.h |
index 10901e3efab3f1e874524b889e08d4e20b8c860d..b6c90f2c46f765723452a0450291768c6fc3ba6f 100644 |
--- a/extensions/renderer/script_context.h |
+++ b/extensions/renderer/script_context.h |
@@ -6,10 +6,8 @@ |
#define EXTENSIONS_RENDERER_SCRIPT_CONTEXT_H_ |
#include <string> |
-#include <vector> |
#include "base/basictypes.h" |
-#include "base/callback.h" |
#include "base/compiler_specific.h" |
#include "extensions/common/features/feature.h" |
#include "extensions/common/permissions/api_permission_set.h" |
@@ -47,13 +45,9 @@ |
// ModuleSystem. |
void Invalidate(); |
- // Registers |observer| to be run when this context is invalidated. Closures |
- // are run immediately when Invalidate() is called, not in a message loop. |
- void AddInvalidationObserver(const base::Closure& observer); |
- |
// Returns true if this context is still valid, false if it isn't. |
// A context becomes invalid via Invalidate(). |
- bool is_valid() const { return is_valid_; } |
+ bool is_valid() const { return !v8_context_.IsEmpty(); } |
v8::Handle<v8::Context> v8_context() const { |
return v8::Local<v8::Context>::New(isolate_, v8_context_); |
@@ -156,14 +150,12 @@ |
// extension. |
bool HasAPIPermission(APIPermission::ID permission) const; |
+ protected: |
+ // The v8 context the bindings are accessible to. |
+ v8::Global<v8::Context> v8_context_; |
+ |
private: |
class Runner; |
- |
- // Whether this context is valid. |
- bool is_valid_; |
- |
- // The v8 context the bindings are accessible to. |
- v8::Global<v8::Context> v8_context_; |
// The WebFrame associated with this context. This can be NULL because this |
// object can outlive is destroyed asynchronously. |
@@ -193,10 +185,6 @@ |
// The set of capabilities granted to this context by extensions. |
APIPermissionSet content_capabilities_; |
- // A list of base::Closure instances as an observer interface for |
- // invalidation. |
- std::vector<base::Closure> invalidate_observers_; |
- |
v8::Isolate* isolate_; |
GURL url_; |