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

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

Issue 7888064: Only deliver extension messages to contexts that care. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nail down a bit further. Only poke relevant RenderView in the case of chrome.tabs.connect(). Created 9 years, 3 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
Index: chrome/renderer/extensions/bindings_utils.h
diff --git a/chrome/renderer/extensions/bindings_utils.h b/chrome/renderer/extensions/bindings_utils.h
index 5318da95b88f930e57c0ec485e68ac6d4cb50f80..9f92184b1e24c923a8ea3fa11ab88ba0a5c84f05 100644
--- a/chrome/renderer/extensions/bindings_utils.h
+++ b/chrome/renderer/extensions/bindings_utils.h
@@ -30,14 +30,22 @@ struct ContextInfo {
WebKit::WebFrame* frame);
~ContextInfo();
+ // Returns the web frame associated with this context. Can also return NULL if
+ // the context has been disassociated with the frame, and not GC'd yet.
+ WebKit::WebFrame* GetWebFrame() const;
+
+ // Returns the RenderView associated wit hthis context. Can also return NULL.
+ RenderView* GetRenderView() const;
+
v8::Persistent<v8::Context> context;
// The extension ID this context is associated with.
std::string extension_id;
// The frame the context is associated with. ContextInfo can outlive its
- // frame, so this should not be dereferenced. It is stored only for use for
- // comparison.
+ // frame, so this should not be dereferenced. Use GetWebFrame() instead for
+ // most cases. This is used for comparisons during unload when GetWebFrame()
+ // doesn't work.
void* unsafe_frame;
// A count of the number of events that are listening in this context. When

Powered by Google App Engine
This is Rietveld 408576698