Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: webkit/dom_storage/dom_storage_types.h

Issue 12398008: Purge in-memory localStorage areas if the # of areas exceeds the limit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 12 matching lines...) Expand all
23 // In the browser process we allow some overage to 23 // In the browser process we allow some overage to
24 // accomodate concurrent writes from different renderers 24 // accomodate concurrent writes from different renderers
25 // that were allowed because the limit imposed in the renderer 25 // that were allowed because the limit imposed in the renderer
26 // wasn't exceeded. 26 // wasn't exceeded.
27 const size_t kPerAreaOverQuotaAllowance = 100 * 1024; 27 const size_t kPerAreaOverQuotaAllowance = 100 * 1024;
28 28
29 // Value to indicate the localstorage namespace vs non-zero 29 // Value to indicate the localstorage namespace vs non-zero
30 // values for sessionstorage namespaces. 30 // values for sessionstorage namespaces.
31 const int64 kLocalStorageNamespaceId = 0; 31 const int64 kLocalStorageNamespaceId = 0;
32 32
33 // Max in-memory storage size. One profile (i.e. one DomStorageContext)
34 // should not hold in-memory data more than this.
35 // TODO(kinuko,michaeln): Consider calling DomStorageArea::PurgeMemory
36 // at a reasonable timing to keep the in-memory cache size rather than
37 // rejecting incoming requests.
38 const size_t kMaxInMemoryAreaSize = 512 * 1024 * 1024;
39
33 const int64 kInvalidSessionStorageNamespaceId = kLocalStorageNamespaceId; 40 const int64 kInvalidSessionStorageNamespaceId = kLocalStorageNamespaceId;
34 41
35 // Value to indicate an area that not be opened. 42 // Value to indicate an area that not be opened.
36 const int kInvalidAreaId = -1; 43 const int kInvalidAreaId = -1;
37 44
38 typedef std::map<string16, NullableString16> ValuesMap; 45 typedef std::map<string16, NullableString16> ValuesMap;
39 46
40 struct WEBKIT_STORAGE_EXPORT LocalStorageUsageInfo { 47 struct WEBKIT_STORAGE_EXPORT LocalStorageUsageInfo {
41 GURL origin; 48 GURL origin;
42 size_t data_size; 49 size_t data_size;
43 base::Time last_modified; 50 base::Time last_modified;
44 51
45 LocalStorageUsageInfo(); 52 LocalStorageUsageInfo();
46 ~LocalStorageUsageInfo(); 53 ~LocalStorageUsageInfo();
47 }; 54 };
48 55
49 struct WEBKIT_STORAGE_EXPORT SessionStorageUsageInfo { 56 struct WEBKIT_STORAGE_EXPORT SessionStorageUsageInfo {
50 GURL origin; 57 GURL origin;
51 std::string persistent_namespace_id; 58 std::string persistent_namespace_id;
52 59
53 SessionStorageUsageInfo(); 60 SessionStorageUsageInfo();
54 ~SessionStorageUsageInfo(); 61 ~SessionStorageUsageInfo();
55 }; 62 };
56 63
57 } // namespace dom_storage 64 } // namespace dom_storage
58 65
59 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_TYPES_H_ 66 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_TYPES_H_
OLDNEW
« webkit/dom_storage/dom_storage_context.cc ('K') | « webkit/dom_storage/dom_storage_namespace.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698