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 WEBKIT_DOM_STORAGE_DOM_STORAGE_TYPES_H_ | 5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_TYPES_H_ |
6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_TYPES_H_ | 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_TYPES_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/nullable_string16.h" | 12 #include "base/nullable_string16.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 | 14 |
15 namespace dom_storage { | 15 namespace dom_storage { |
16 | 16 |
17 // The quota for each storage area. Suggested by the spec. | 17 // The quota for each storage area. Suggested by the spec. |
| 18 // This value is enforced in renderer processes. |
18 const size_t kPerAreaQuota = 5 * 1024 * 1024; | 19 const size_t kPerAreaQuota = 5 * 1024 * 1024; |
19 | 20 |
| 21 // In the browser process we allow some overage to |
| 22 // accomodate concurrent writes from different renderers |
| 23 // that were allowed because the limit imposed in the renderer |
| 24 // wasn't exceeded. |
| 25 const size_t kPerAreaOverQuotaAllowance = 100 * 1024; |
| 26 |
20 // Value to indicate the localstorage namespace vs non-zero | 27 // Value to indicate the localstorage namespace vs non-zero |
21 // values for sessionstorage namespaces. | 28 // values for sessionstorage namespaces. |
22 const int64 kLocalStorageNamespaceId = 0; | 29 const int64 kLocalStorageNamespaceId = 0; |
23 | 30 |
24 const int64 kInvalidSessionStorageNamespaceId = kLocalStorageNamespaceId; | 31 const int64 kInvalidSessionStorageNamespaceId = kLocalStorageNamespaceId; |
25 | 32 |
26 // Value to indicate an area that not be opened. | 33 // Value to indicate an area that not be opened. |
27 const int kInvalidAreaId = -1; | 34 const int kInvalidAreaId = -1; |
28 | 35 |
29 typedef std::map<string16, NullableString16> ValuesMap; | 36 typedef std::map<string16, NullableString16> ValuesMap; |
30 | 37 |
31 } // namespace dom_storage | 38 } // namespace dom_storage |
32 | 39 |
33 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_TYPES_H_ | 40 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_TYPES_H_ |
OLD | NEW |