Index: chrome/renderer/extensions/bindings_utils.h |
diff --git a/chrome/renderer/extensions/bindings_utils.h b/chrome/renderer/extensions/bindings_utils.h |
index 1246a1afc2b0aca4dc454217d2d949480dae1c13..958727ebcce95adf515310febb02fc958c5d9a62 100644 |
--- a/chrome/renderer/extensions/bindings_utils.h |
+++ b/chrome/renderer/extensions/bindings_utils.h |
@@ -82,20 +82,23 @@ const char* GetStringResource(int resource_id); |
// bindings. |
struct ContextInfo { |
ContextInfo(v8::Persistent<v8::Context> context, |
- const std::string& extension_id, |
- WebKit::WebFrame* frame); |
+ v8::Persistent<v8::Context> main_world_context, |
+ const std::string& extension_id); |
~ContextInfo(); |
+ // The context hosting the bindings. If this is a content script, the handle |
+ // will be weak. |
v8::Persistent<v8::Context> context; |
+ // If the context is a content script, this contains a reference to the |
+ // corresponding main world's context. It is weak, but it should always be |
+ // valid because we delete ContextInfo for content scripts when the |
+ // corresponding main world context is destroyed. |
+ v8::Persistent<v8::Context> main_world_context; |
+ |
// The extension ID this context is associated with. |
std::string extension_id; |
- // The frame the context is associated with. We can't always get this from |
- // WebFrame::frameForContext() (in particular as the the frame is navigating |
- // or being destroyed). |
- WebKit::WebFrame* frame; |
- |
// A count of the number of events that are listening in this context. When |
// this is zero, |context| will be a weak handle. |
int num_connected_events; |