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

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

Issue 8245018: Remove race condition when installing default apps into a new profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Addressing review comments 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
Index: chrome/browser/extensions/external_extension_provider_impl.h
===================================================================
--- chrome/browser/extensions/external_extension_provider_impl.h (revision 106274)
+++ chrome/browser/extensions/external_extension_provider_impl.h (working copy)
@@ -50,7 +50,7 @@
// Sets underlying prefs and notifies provider. Only to be called by the
// owned ExternalExtensionLoader instance.
- void SetPrefs(base::DictionaryValue* prefs);
+ virtual void SetPrefs(base::DictionaryValue* prefs);
// ExternalExtensionProvider implementation:
virtual void ServiceShutdown() OVERRIDE;
@@ -69,9 +69,16 @@
static const char kExternalUpdateUrl[];
static const char kSupportedLocales[];
+ // Used only for testing.
+ const std::set<std::string>& invalid_extensions() const {
+ return invalid_extensions_;
+ }
+
protected:
VisitorInterface* service() const { return service_; }
+ base::DictionaryValue* prefs() const { return prefs_.get(); }
+
private:
// Location for external extensions that are provided by this provider from
// local crx files.
@@ -96,6 +103,15 @@
// via |SetPrefs|.
scoped_refptr<ExternalExtensionLoader> loader_;
+ // Extensions that were found to be invalid while processing the prefs_
+ // dictionary. These are extensions that this provider did not even attempt
+ // to install because they failed one or more of the checks in SetPrefs().
+ //
+ // TODO(mihai): It would be nice to simply remove these extensions from
+ // prefs_, but for now, there is code that depends on these invalid extensions
Mihai Parparita -not on Chrome 2011/10/20 02:30:25 I didn't mean that there was code that relies on t
Roger Tawa OOO till Jul 10th 2011/10/20 14:31:15 OK. I think it would be better to have the commen
+ // still being available to HasExtension(). See how to fix this.
+ std::set<std::string> invalid_extensions_;
+
DISALLOW_COPY_AND_ASSIGN(ExternalExtensionProviderImpl);
};

Powered by Google App Engine
This is Rietveld 408576698