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

Side by Side Diff: chrome/browser/extensions/api/storage/local_storage_backend.h

Issue 165223003: Add a Restore() method to ValueStore and make StorageAPI use it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 6 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_LOCAL_STORAGE_BACKEND_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_LOCAL_STORAGE_BACKEND_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/memory/linked_ptr.h"
12 #include "base/memory/ref_counted.h"
13 #include "chrome/browser/extensions/api/storage/settings_backend.h"
14 #include "chrome/browser/extensions/api/storage/settings_storage_quota_enforcer. h"
15
16 namespace base {
17 class FilePath;
18 }
19
20 class ValueStore;
21
22 namespace extensions {
23 class SettingStorageFactory;
24
25 class LocalStorageBackend : public SettingsBackend {
26 public:
27 LocalStorageBackend(
28 const scoped_refptr<SettingsStorageFactory>& storage_factory,
29 const base::FilePath& base_path,
30 const SettingsStorageQuotaEnforcer::Limits& quota);
31 virtual ~LocalStorageBackend();
32
33 // SettingsBackend implementation.
34 virtual ValueStore* GetStorage(const std::string& extension_id) OVERRIDE;
35 virtual void DeleteStorage(const std::string& extension_id) OVERRIDE;
36
37 private:
38 typedef std::map<std::string, linked_ptr<ValueStore> > StorageMap;
39
40 StorageMap storage_map_;
41
42 DISALLOW_COPY_AND_ASSIGN(LocalStorageBackend);
43 };
44
45 } // namespace extensions
46
47 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_LOCAL_STORAGE_BACKEND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698