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

Unified Diff: chrome/browser/extensions/settings/settings_storage_factory.h

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_storage_factory.h
diff --git a/chrome/browser/extensions/settings/settings_storage_factory.h b/chrome/browser/extensions/settings/settings_storage_factory.h
index b39f45f6a1e9a04fe0daf6c7d23e70ce0a0d3780..411d96efa815c32dd55c11d6c4c429717e92ae32 100644
--- a/chrome/browser/extensions/settings/settings_storage_factory.h
+++ b/chrome/browser/extensions/settings/settings_storage_factory.h
@@ -6,21 +6,30 @@
#define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_FACTORY_H_
#pragma once
-class FilePath;
+#include <string>
+
+#include "base/file_path.h"
+#include "base/memory/ref_counted.h"
namespace extensions {
class SettingsStorage;
// Factory for creating SettingStorage instances.
-class SettingsStorageFactory {
+//
+// Refcouted because it's just too messy to distribute these objects between
+// SettingsBackend instances any other way.
+class SettingsStorageFactory
+ : public base::RefCountedThreadSafe<SettingsStorageFactory> {
public:
- virtual ~SettingsStorageFactory() {}
-
- // Create a new SettingsLeveldbStorage area. Return NULL to indicate
- // failure. Must be called on the FILE thread.
+ // Creates a new SettingsStorage area for an extension under |base_path|.
+ // Return NULL to indicate failure. Must be called on the FILE thread.
virtual SettingsStorage* Create(
const FilePath& base_path, const std::string& extension_id) = 0;
+
+ protected:
+ friend class base::RefCountedThreadSafe<SettingsStorageFactory>;
+ virtual ~SettingsStorageFactory() {}
};
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698