| Index: chrome/renderer/extensions/bindings_utils.h
|
| diff --git a/chrome/renderer/extensions/bindings_utils.h b/chrome/renderer/extensions/bindings_utils.h
|
| index 7354c7282cab5cb060f634a91d94518b7af169c2..b0b3f086375ba5aebee6c7fe88d6d25f558288c3 100644
|
| --- a/chrome/renderer/extensions/bindings_utils.h
|
| +++ b/chrome/renderer/extensions/bindings_utils.h
|
| @@ -68,12 +68,17 @@ struct ContextInfo {
|
| // a valid pointer, and is used for comparisons only. Do not dereference.
|
| RenderView* render_view;
|
|
|
| + // 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;
|
| +
|
| ContextInfo(v8::Persistent<v8::Context> context,
|
| const std::string& extension_id,
|
| v8::Persistent<v8::Context> parent_context,
|
| RenderView* render_view)
|
| : context(context), extension_id(extension_id),
|
| - parent_context(parent_context), render_view(render_view) {}
|
| + parent_context(parent_context), render_view(render_view),
|
| + num_connected_events(0) {}
|
| };
|
| typedef std::list< linked_ptr<ContextInfo> > ContextList;
|
|
|
| @@ -86,6 +91,9 @@ ContextList GetContextsForExtension(const std::string& extension_id);
|
| // Returns the ContextInfo item that has the given context.
|
| ContextList::iterator FindContext(v8::Handle<v8::Context> context);
|
|
|
| +// Returns the ContextInfo for the current v8 context.
|
| +ContextInfo* GetInfoForCurrentContext();
|
| +
|
| // Contains info relevant to a pending API request.
|
| struct PendingRequest {
|
| public :
|
|
|