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

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: dcronin's comments; ExtensionSystem::ready; and WeakPtr support 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 70b1a5fd094598b098f793d915f266e226ea444b..11ea30890b01f581cea991a040844d7a440f2a92 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/async_event.h"
#include "sync/api/string_ordinal.h"
#include "sync/api/sync_change.h"
#include "sync/api/syncable_service.h"
@@ -131,10 +132,17 @@ class ExtensionServiceInterface : public syncer::SyncableService {
virtual void SyncExtensionChangeIfNeeded(
const extensions::Extension& extension) = 0;
- virtual bool is_ready() = 0;
+ // Whether the extension service is ready.
+ bool is_ready() const { return ready_.has_happened(); }
Yoyo Zhou 2013/05/15 22:38:41 Arguably, the point of AsyncEvent is to not have t
Matt Perry 2013/05/15 22:41:54 I was actually leaning the other way - that maybe
Jeffrey Yasskin 2013/05/15 22:46:50 We need is_ready for backward-compatibility with e
+ const extensions::AsyncEvent& ready() { return ready_; }
Matt Perry 2013/05/15 21:08:54 I can see why you did this, but as an interface, t
Jeffrey Yasskin 2013/05/15 22:46:50 Done.
// Returns task runner for crx installation file I/O operations.
virtual base::SequencedTaskRunner* GetFileTaskRunner() = 0;
+
+ protected:
+ // Record that Init() has been called, and chrome::EXTENSIONS_READY
+ // has fired.
+ extensions::AsyncEvent ready_;
};
// Manages installed and running Chromium extensions.
@@ -521,9 +529,6 @@ class ExtensionService
extensions::ContentSettingsStore* GetContentSettingsStore();
- // Whether the extension service is ready.
- virtual bool is_ready() OVERRIDE;
-
virtual base::SequencedTaskRunner* GetFileTaskRunner() OVERRIDE;
extensions::ComponentLoader* component_loader() {
@@ -903,10 +908,6 @@ 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_;
-
// Our extension updater, if updates are turned on.
scoped_ptr<extensions::ExtensionUpdater> updater_;

Powered by Google App Engine
This is Rietveld 408576698