| 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_EXTENSION_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_QUOTA_ENFORCER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_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 22 matching lines...) Expand all Loading... |
| 33 virtual Result Clear() OVERRIDE; | 33 virtual Result Clear() OVERRIDE; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 // The storage quota in bytes. | 36 // The storage quota in bytes. |
| 37 size_t const quota_bytes_; | 37 size_t const quota_bytes_; |
| 38 | 38 |
| 39 // The maximum number of settings keys allowed. | 39 // The maximum number of settings keys allowed. |
| 40 size_t const max_keys_; | 40 size_t const max_keys_; |
| 41 | 41 |
| 42 // The delegate storage area. | 42 // The delegate storage area. |
| 43 ExtensionSettingsStorage* const delegate_; | 43 scoped_ptr<ExtensionSettingsStorage> const delegate_; |
| 44 | 44 |
| 45 // Total size of the settings currently being used. Includes both settings | 45 // Total size of the settings currently being used. Includes both settings |
| 46 // keys and their JSON-encoded values. | 46 // keys and their JSON-encoded values. |
| 47 size_t used_total_; | 47 size_t used_total_; |
| 48 | 48 |
| 49 // Map of key to size of that key, including the key itself. | 49 // Map of key to size of that key, including the key itself. |
| 50 std::map<std::string, size_t> used_per_setting_; | 50 std::map<std::string, size_t> used_per_setting_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsStorageQuotaEnforcer); | 52 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsStorageQuotaEnforcer); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_QUOTA_ENFORCER_H
_ | 55 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_QUOTA_ENFORCER_H
_ |
| OLD | NEW |