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

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

Issue 14757022: Add a non-blocking "OneShotEvent" class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a test for the behavior within a Post()ed callback Created 7 years, 7 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 | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/extension_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_system.h
diff --git a/chrome/browser/extensions/extension_system.h b/chrome/browser/extensions/extension_system.h
index f7da8b9782d42945e1e913d0f0c370d86db10445..124c22b0189fd3d108e050cd31729e19c7188499 100644
--- a/chrome/browser/extensions/extension_system.h
+++ b/chrome/browser/extensions/extension_system.h
@@ -15,6 +15,7 @@
#include "chrome/browser/extensions/api/usb/usb_device_resource.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/common/extensions/extension_constants.h"
+#include "extensions/common/one_shot_event.h"
class ExtensionInfoMap;
class ExtensionProcessManager;
@@ -132,6 +133,9 @@ class ExtensionSystem : public ProfileKeyedService {
virtual void UnregisterExtensionWithRequestContexts(
const std::string& extension_id,
const extension_misc::UnloadedExtensionReason reason) {}
+
+ // Signaled when the extension system has completed its startup tasks.
+ virtual const OneShotEvent& ready() const = 0;
};
// The ExtensionSystem for ProfileImpl and OffTheRecordProfileImpl.
@@ -179,6 +183,8 @@ class ExtensionSystemImpl : public ExtensionSystem {
const std::string& extension_id,
const extension_misc::UnloadedExtensionReason reason) OVERRIDE;
+ virtual const OneShotEvent& ready() const OVERRIDE;
+
private:
friend class ExtensionSystemSharedFactory;
@@ -209,6 +215,7 @@ class ExtensionSystemImpl : public ExtensionSystem {
LazyBackgroundTaskQueue* lazy_background_task_queue();
EventRouter* event_router();
ExtensionWarningService* warning_service();
+ const OneShotEvent& ready() const { return ready_; }
private:
Profile* profile_;
@@ -235,6 +242,8 @@ class ExtensionSystemImpl : public ExtensionSystem {
scoped_refptr<ExtensionInfoMap> extension_info_map_;
scoped_ptr<ExtensionWarningService> extension_warning_service_;
scoped_ptr<ExtensionWarningBadgeService> extension_warning_badge_service_;
+
+ OneShotEvent ready_;
};
Profile* profile_;
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/extension_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698