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

Unified Diff: chrome/browser/extensions/extension_event_router.h

Issue 8343079: Don't close background pages if there is a pending response (callback). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 years, 2 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 | « no previous file | chrome/browser/extensions/extension_event_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_event_router.h
diff --git a/chrome/browser/extensions/extension_event_router.h b/chrome/browser/extensions/extension_event_router.h
index 55831ed7a1d35effb1aff643903fe0c1ec8d20e8..ade675ea58cdf7c80c84fd4545ac68185c9f6069 100644
--- a/chrome/browser/extensions/extension_event_router.h
+++ b/chrome/browser/extensions/extension_event_router.h
@@ -88,6 +88,13 @@ class ExtensionEventRouter : public content::NotificationObserver {
const std::string& cross_incognito_args,
const GURL& event_url);
+ // Record the Event Ack from the renderer. (One less event in-flight.)
+ void OnExtensionEventAck(const std::string& extension_id);
+
+ // Check if there are any Extension Events that have not yet been acked by
+ // the renderer.
+ bool HasInFlightEvents(const std::string& extension_id);
+
protected:
// The details of an event to be dispatched.
struct ExtensionEvent;
@@ -132,6 +139,11 @@ class ExtensionEventRouter : public content::NotificationObserver {
linked_ptr<PendingEventsList> > PendingEventsPerExtMap;
PendingEventsPerExtMap pending_events_;
+ // Track of the number of dispatched events that have not yet sent an
+ // ACK from the renderer.
+ void IncrementInFlightEvents(const std::string& extension_id);
+ std::map<std::string, int> in_flight_events_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionEventRouter);
};
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698