OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | |
8 | 7 |
9 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
10 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
11 #include "chrome/browser/value_store/value_store.h" | 10 #include "chrome/browser/value_store/value_store.h" |
12 | 11 |
13 namespace extensions { | 12 namespace extensions { |
14 | 13 |
15 // Enforces total quota and a per-setting quota in bytes, and a maximum number | 14 // Enforces total quota and a per-setting quota in bytes, and a maximum number |
16 // of setting keys, for a delegate storage area. | 15 // of setting keys, for a delegate storage area. |
17 class SettingsStorageQuotaEnforcer : public ValueStore { | 16 class SettingsStorageQuotaEnforcer : public ValueStore { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 60 |
62 // Map of item key to its size, including the key itself. | 61 // Map of item key to its size, including the key itself. |
63 std::map<std::string, size_t> used_per_setting_; | 62 std::map<std::string, size_t> used_per_setting_; |
64 | 63 |
65 DISALLOW_COPY_AND_ASSIGN(SettingsStorageQuotaEnforcer); | 64 DISALLOW_COPY_AND_ASSIGN(SettingsStorageQuotaEnforcer); |
66 }; | 65 }; |
67 | 66 |
68 } // namespace extensions | 67 } // namespace extensions |
69 | 68 |
70 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ | 69 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ |
OLD | NEW |