- add sources.
[platform/framework/web/crosswalk.git] / src / content / common / dom_storage / dom_storage_types.h
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_DOM_STORAGE_DOM_STORAGE_TYPES_H_
6 #define CONTENT_COMMON_DOM_STORAGE_DOM_STORAGE_TYPES_H_
7
8 #include <map>
9
10 #include "base/basictypes.h"
11 #include "base/strings/nullable_string16.h"
12 #include "base/strings/string16.h"
13 #include "base/time/time.h"
14 #include "url/gurl.h"
15
16 namespace content {
17
18 typedef std::map<base::string16, base::NullableString16> DOMStorageValuesMap;
19
20 // The quota for each storage area.
21 // This value is enforced in renderer processes and the browser process.
22 const size_t kPerStorageAreaQuota = 10 * 1024 * 1024;
23
24 // In the browser process we allow some overage to
25 // accomodate concurrent writes from different renderers
26 // that were allowed because the limit imposed in the renderer
27 // wasn't exceeded.
28 const size_t kPerStorageAreaOverQuotaAllowance = 100 * 1024;
29
30 // Value to indicate the localstorage namespace vs non-zero
31 // values for sessionstorage namespaces.
32 const int64 kLocalStorageNamespaceId = 0;
33
34 const int64 kInvalidSessionStorageNamespaceId = kLocalStorageNamespaceId;
35
36 // Start purging memory if the number of in-memory areas exceeds this.
37 const int64 kMaxInMemoryStorageAreas = 100;
38
39 }  // namespace content
40
41 #endif  // CONTENT_COMMON_DOM_STORAGE_DOM_STORAGE_TYPES_H_