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

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

Issue 10114015: Fix bug where transient pages would miss events dispatched while it was (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: yoyo Created 8 years, 8 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/browser/extensions/lazy_background_task_queue.h
diff --git a/chrome/browser/extensions/lazy_background_task_queue.h b/chrome/browser/extensions/lazy_background_task_queue.h
index 12b85ba73049d51f84c15d84801464815d0c8deb..abe71b21865a2647572f8747e787e0018e064289 100644
--- a/chrome/browser/extensions/lazy_background_task_queue.h
+++ b/chrome/browser/extensions/lazy_background_task_queue.h
@@ -7,11 +7,13 @@
#pragma once
#include <map>
+#include <set>
#include <string>
#include "base/compiler_specific.h"
#include "base/callback_forward.h"
#include "base/memory/linked_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -27,7 +29,9 @@ namespace extensions {
//
// It is the consumer's responsibility to use this class when appropriate, i.e.
// only with extensions that have not-yet-loaded lazy background pages.
-class LazyBackgroundTaskQueue : public content::NotificationObserver {
+class LazyBackgroundTaskQueue
+ : public content::NotificationObserver,
+ public base::SupportsWeakPtr<LazyBackgroundTaskQueue> {
public:
typedef base::Callback<void(ExtensionHost*)> PendingTask;
@@ -56,6 +60,10 @@ class LazyBackgroundTaskQueue : public content::NotificationObserver {
typedef std::vector<PendingTask> PendingTasksList;
typedef std::map<PendingTasksKey,
linked_ptr<PendingTasksList> > PendingTasksMap;
+ typedef std::set<PendingTasksKey> PendingPageLoadList;
+
+ void StartLazyBackgroundPage(Profile* profile,
+ const std::string& extension_id);
// content::NotificationObserver interface.
virtual void Observe(int type,
@@ -72,6 +80,7 @@ class LazyBackgroundTaskQueue : public content::NotificationObserver {
Profile* profile_;
content::NotificationRegistrar registrar_;
PendingTasksMap pending_tasks_;
+ PendingPageLoadList pending_page_loads_;
};
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/extension_process_manager.cc ('k') | chrome/browser/extensions/lazy_background_task_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698