OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ |
6 #define EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ | 6 #define EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ |
7 | 7 |
| 8 #include <stddef.h> |
| 9 |
8 #include <map> | 10 #include <map> |
9 #include <string> | 11 #include <string> |
10 #include <vector> | 12 #include <vector> |
11 | 13 |
12 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/macros.h" |
13 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
14 #include "extensions/browser/value_store/value_store.h" | 17 #include "extensions/browser/value_store/value_store.h" |
15 | 18 |
16 namespace extensions { | 19 namespace extensions { |
17 | 20 |
18 // Enforces total quota and a per-setting quota in bytes, and a maximum number | 21 // Enforces total quota and a per-setting quota in bytes, and a maximum number |
19 // of setting keys, for a delegate storage area. | 22 // of setting keys, for a delegate storage area. |
20 class SettingsStorageQuotaEnforcer : public ValueStore { | 23 class SettingsStorageQuotaEnforcer : public ValueStore { |
21 public: | 24 public: |
22 struct Limits { | 25 struct Limits { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 81 |
79 // Map of item key to its size, including the key itself. | 82 // Map of item key to its size, including the key itself. |
80 std::map<std::string, size_t> used_per_setting_; | 83 std::map<std::string, size_t> used_per_setting_; |
81 | 84 |
82 DISALLOW_COPY_AND_ASSIGN(SettingsStorageQuotaEnforcer); | 85 DISALLOW_COPY_AND_ASSIGN(SettingsStorageQuotaEnforcer); |
83 }; | 86 }; |
84 | 87 |
85 } // namespace extensions | 88 } // namespace extensions |
86 | 89 |
87 #endif // EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ | 90 #endif // EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ |
OLD | NEW |