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

Unified Diff: chrome/browser/extensions/settings/settings_test_util.cc

Issue 8670012: Extension Settings API: move the API functions into an object SettingsNamepace, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/settings/settings_test_util.cc
diff --git a/chrome/browser/extensions/settings/settings_test_util.cc b/chrome/browser/extensions/settings/settings_test_util.cc
index c834c87bddb749d22e1fb4013c83b25dc26f8f45..73793f3823a5f0f2efc6a28f0dfc5b13b6f8017f 100644
--- a/chrome/browser/extensions/settings/settings_test_util.cc
+++ b/chrome/browser/extensions/settings/settings_test_util.cc
@@ -7,6 +7,7 @@
#include "base/file_path.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/browser/extensions/settings/settings_frontend.h"
+#include "chrome/browser/extensions/settings/settings_namespace.h"
namespace extensions {
@@ -22,6 +23,7 @@ SettingsStorage* GetStorage(
SettingsStorage* storage = NULL;
frontend->RunWithStorage(
extension_id,
+ settings_namespace::SYNC,
base::Bind(&AssignStorage, &storage));
MessageLoop::current()->RunAllPending();
return storage;
@@ -100,20 +102,22 @@ ExtensionEventRouter* MockProfile::GetExtensionEventRouter() {
// ScopedSettingsFactory
+ScopedSettingsStorageFactory::ScopedSettingsStorageFactory() {}
+
ScopedSettingsStorageFactory::ScopedSettingsStorageFactory(
- SettingsStorageFactory* delegate) : delegate_(delegate) {
- DCHECK(delegate);
-}
+ const scoped_refptr<SettingsStorageFactory>& delegate)
+ : delegate_(delegate) {}
ScopedSettingsStorageFactory::~ScopedSettingsStorageFactory() {}
-void ScopedSettingsStorageFactory::Reset(SettingsStorageFactory* delegate) {
- DCHECK(delegate);
- delegate_.reset(delegate);
+void ScopedSettingsStorageFactory::Reset(
+ const scoped_refptr<SettingsStorageFactory>& delegate) {
+ delegate_ = delegate;
}
SettingsStorage* ScopedSettingsStorageFactory::Create(
const FilePath& base_path, const std::string& extension_id) {
+ DCHECK(delegate_.get());
return delegate_->Create(base_path, extension_id);
}

Powered by Google App Engine
This is Rietveld 408576698