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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 7775008: Enable sync for the settings from the Extension Settings API. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Review #3 Created 9 years, 3 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.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index dc4d403fdcc1b66339a973c7eeefc9a547942a91..3fcd6f1196ac0c4b427fc30a11dbd69a9dea677f 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -579,14 +579,12 @@ ExtensionService::ExtensionService(Profile* profile,
const CommandLine* command_line,
const FilePath& install_directory,
ExtensionPrefs* extension_prefs,
- ExtensionSettings* extension_settings,
bool autoupdate_enabled,
bool extensions_enabled)
: weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
profile_(profile),
extension_prefs_(extension_prefs),
- extension_settings_(extension_settings),
pending_extension_manager_(*ALLOW_THIS_IN_INITIALIZER_LIST(this)),
install_directory_(install_directory),
extensions_enabled_(extensions_enabled),
@@ -634,6 +632,12 @@ ExtensionService::ExtensionService(Profile* profile,
new ExtensionServiceBackend(weak_ptr_factory_.GetWeakPtr(),
install_directory_);
+ // Construct the settings on the UI thread, but all further interaction
+ // (including destruction) must be done on the FILE thread.
+ extension_settings_ =
+ new ExtensionSettings(
+ profile_->GetPath().AppendASCII(kSettingsDirectoryName));
+
if (extensions_enabled_) {
ExternalExtensionProviderImpl::CreateExternalProviders(
this, profile_, &external_extension_providers_);
@@ -688,6 +692,9 @@ ExtensionService::~ExtensionService() {
ExternalExtensionProviderInterface* provider = i->get();
provider->ServiceShutdown();
}
+
+ BrowserThread::DeleteSoon(
+ BrowserThread::FILE, FROM_HERE, extension_settings_);
}
void ExtensionService::InitEventRoutersAfterImport() {

Powered by Google App Engine
This is Rietveld 408576698