OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 size_t max_keys, | 22 size_t max_keys, |
23 // Ownership taken. | 23 // Ownership taken. |
24 SettingsStorage* delegate); | 24 SettingsStorage* delegate); |
25 | 25 |
26 virtual ~SettingsStorageQuotaEnforcer(); | 26 virtual ~SettingsStorageQuotaEnforcer(); |
27 | 27 |
28 // SettingsStorage implementation. | 28 // SettingsStorage implementation. |
29 virtual ReadResult Get(const std::string& key) OVERRIDE; | 29 virtual ReadResult Get(const std::string& key) OVERRIDE; |
30 virtual ReadResult Get(const std::vector<std::string>& keys) OVERRIDE; | 30 virtual ReadResult Get(const std::vector<std::string>& keys) OVERRIDE; |
31 virtual ReadResult Get() OVERRIDE; | 31 virtual ReadResult Get() OVERRIDE; |
32 virtual WriteResult Set(const std::string& key, const Value& value) OVERRIDE; | 32 virtual WriteResult Set( |
33 virtual WriteResult Set(const DictionaryValue& settings) OVERRIDE; | 33 WriteOptions options, |
| 34 const std::string& key, |
| 35 const Value& value) OVERRIDE; |
| 36 virtual WriteResult Set( |
| 37 WriteOptions options, const DictionaryValue& values) OVERRIDE; |
34 virtual WriteResult Remove(const std::string& key) OVERRIDE; | 38 virtual WriteResult Remove(const std::string& key) OVERRIDE; |
35 virtual WriteResult Remove(const std::vector<std::string>& keys) OVERRIDE; | 39 virtual WriteResult Remove(const std::vector<std::string>& keys) OVERRIDE; |
36 virtual WriteResult Clear() OVERRIDE; | 40 virtual WriteResult Clear() OVERRIDE; |
37 | 41 |
38 private: | 42 private: |
39 // The storage quota in bytes. | 43 // The storage quota in bytes. |
40 size_t const quota_bytes_; | 44 size_t const quota_bytes_; |
41 | 45 |
42 // The quota per individual setting in bytes. | 46 // The quota per individual setting in bytes. |
43 size_t const quota_bytes_per_setting_; | 47 size_t const quota_bytes_per_setting_; |
(...skipping 10 matching lines...) Expand all Loading... |
54 | 58 |
55 // Map of key to size of that key, including the key itself. | 59 // Map of key to size of that key, including the key itself. |
56 std::map<std::string, size_t> used_per_setting_; | 60 std::map<std::string, size_t> used_per_setting_; |
57 | 61 |
58 DISALLOW_COPY_AND_ASSIGN(SettingsStorageQuotaEnforcer); | 62 DISALLOW_COPY_AND_ASSIGN(SettingsStorageQuotaEnforcer); |
59 }; | 63 }; |
60 | 64 |
61 } // namespace extensions | 65 } // namespace extensions |
62 | 66 |
63 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ | 67 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ |
OLD | NEW |