summaryrefslogtreecommitdiffstats
path: root/extensions/shell
diff options
context:
space:
mode:
authorcmumford <cmumford@chromium.org>2016-03-24 13:35:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-24 20:36:29 +0000
commit6ae8d465f961bb3c6fa9ed285d877710fb69ae12 (patch)
tree2ef3a31a1254b3d2bc9fa84f942f5a4be023ab4a /extensions/shell
parent7fad54c907e98f5c574cbf12420ab072eecf81ad (diff)
downloadchromium_src-6ae8d465f961bb3c6fa9ed285d877710fb69ae12.zip
chromium_src-6ae8d465f961bb3c6fa9ed285d877710fb69ae12.tar.gz
chromium_src-6ae8d465f961bb3c6fa9ed285d877710fb69ae12.tar.bz2
Extensions: Using common ValueStoreFactory for all value stores.
1. Introduce new ValueStoreFactory interface used for the creation of ValueStore's in all namespaces (local, sync, and managed), and for all types (extension and application). 2. Delete SettingsStorageFactory/LeveldbSettingsStorageFactory, and switched to ValueStoreFactory. 3. Created a new TestValueStoreFactory (for testing). This combines settings_sync_unittest.cc:TestingValueStoreFactory and ScopedSettingsStorageFactory. 4. ValueStoreFrontend::Backend always lazilily initializes using the ValueStoreFactory. This makes unnecessary StateStore's deferred initialization mechanism - which will be removed in an upcoming CL. 5. A new ValueStoreFactoryImpl to mint new ValueStore's for Chrome. This currently delegates to a new LegacyValueStoreFactory which creates new LeveldbValueStore. An upcoming CL will add a second delegated factory (currently called ProfileValueStoreFactory) to support a unified (per-profile) extensions database. 6. Removed memcheck suppression for SettingsStorageFactory as this class is now deleted (crbug.com/163922). BUG=453946,163922 Review URL: https://codereview.chromium.org/1803193002 Cr-Commit-Position: refs/heads/master@{#383137}
Diffstat (limited to 'extensions/shell')
-rw-r--r--extensions/shell/browser/shell_extension_system.cc9
-rw-r--r--extensions/shell/browser/shell_extension_system.h5
2 files changed, 13 insertions, 1 deletions
diff --git a/extensions/shell/browser/shell_extension_system.cc b/extensions/shell/browser/shell_extension_system.cc
index 2ed9d7b..3fbbf14 100644
--- a/extensions/shell/browser/shell_extension_system.cc
+++ b/extensions/shell/browser/shell_extension_system.cc
@@ -22,6 +22,7 @@
#include "extensions/browser/quota_service.h"
#include "extensions/browser/runtime_data.h"
#include "extensions/browser/service_worker_manager.h"
+#include "extensions/browser/value_store/value_store_factory_impl.h"
#include "extensions/common/constants.h"
#include "extensions/common/file_util.h"
@@ -31,7 +32,9 @@ using content::BrowserThread;
namespace extensions {
ShellExtensionSystem::ShellExtensionSystem(BrowserContext* browser_context)
- : browser_context_(browser_context), weak_factory_(this) {}
+ : browser_context_(browser_context),
+ store_factory_(new ValueStoreFactoryImpl(browser_context->GetPath())),
+ weak_factory_(this) {}
ShellExtensionSystem::~ShellExtensionSystem() {
}
@@ -134,6 +137,10 @@ StateStore* ShellExtensionSystem::rules_store() {
return nullptr;
}
+scoped_refptr<ValueStoreFactory> ShellExtensionSystem::store_factory() {
+ return store_factory_;
+}
+
InfoMap* ShellExtensionSystem::info_map() {
if (!info_map_.get())
info_map_ = new InfoMap;
diff --git a/extensions/shell/browser/shell_extension_system.h b/extensions/shell/browser/shell_extension_system.h
index b84c3fd..4448fb9 100644
--- a/extensions/shell/browser/shell_extension_system.h
+++ b/extensions/shell/browser/shell_extension_system.h
@@ -23,6 +23,8 @@ class BrowserContext;
namespace extensions {
+class ValueStoreFactory;
+
// A simplified version of ExtensionSystem for app_shell. Allows
// app_shell to skip initialization of services it doesn't need.
class ShellExtensionSystem : public ExtensionSystem {
@@ -52,6 +54,7 @@ class ShellExtensionSystem : public ExtensionSystem {
SharedUserScriptMaster* shared_user_script_master() override;
StateStore* state_store() override;
StateStore* rules_store() override;
+ scoped_refptr<ValueStoreFactory> store_factory() override;
InfoMap* info_map() override;
QuotaService* quota_service() override;
AppSorting* app_sorting() override;
@@ -81,6 +84,8 @@ class ShellExtensionSystem : public ExtensionSystem {
scoped_ptr<QuotaService> quota_service_;
scoped_ptr<AppSorting> app_sorting_;
+ scoped_refptr<ValueStoreFactory> store_factory_;
+
// Signaled when the extension system has completed its startup tasks.
OneShotEvent ready_;