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

Unified Diff: chrome/browser/extensions/extension_service.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
Index: chrome/browser/extensions/extension_service.h
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
index 3f0408a21cabc20cbb086514858ea626ba2e9da5..e11e6cc76c8fc3d9ed03d4dd7b0882da7955001f 100644
--- a/chrome/browser/extensions/extension_service.h
+++ b/chrome/browser/extensions/extension_service.h
@@ -38,6 +38,7 @@
#include "chrome/common/extensions/manifest.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "extensions/common/one_shot_event.h"
#include "sync/api/string_ordinal.h"
#include "sync/api/sync_change.h"
#include "sync/api/syncable_service.h"
@@ -199,7 +200,8 @@ class ExtensionService
extensions::ExtensionPrefs* extension_prefs,
extensions::Blacklist* blacklist,
bool autoupdate_enabled,
- bool extensions_enabled);
+ bool extensions_enabled,
+ extensions::OneShotEvent* ready);
virtual ~ExtensionService();
@@ -704,7 +706,7 @@ class ExtensionService
};
typedef std::list<NaClModuleInfo> NaClModuleInfoList;
- // Sets the ready_ flag and sends a notification to the listeners.
+ // Signals *ready_ and sends a notification to the listeners.
void SetReadyAndNotifyListeners();
// Return true if the sync type of |extension| matches |type|.
@@ -899,9 +901,8 @@ class ExtensionService
// Used by dispatchers to limit API quota for individual extensions.
ExtensionsQuotaService quota_service_;
- // Record that Init() has been called, and chrome::EXTENSIONS_READY
- // has fired.
- bool ready_;
+ // Signaled when all extensions are loaded.
+ extensions::OneShotEvent* const ready_;
// Our extension updater, if updates are turned on.
scoped_ptr<extensions::ExtensionUpdater> updater_;

Powered by Google App Engine
This is Rietveld 408576698