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

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

Issue 11088005: Automate more Better Session Restore tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: export inner Created 8 years, 2 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
« no previous file with comments | « webkit/dom_storage/dom_storage_host.h ('k') | webkit/dom_storage/dom_storage_namespace.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_MAP_H_ 5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_MAP_H_
6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_MAP_H_ 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_MAP_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/nullable_string16.h" 11 #include "base/nullable_string16.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 #include "webkit/dom_storage/dom_storage_export.h"
13 #include "webkit/dom_storage/dom_storage_types.h" 14 #include "webkit/dom_storage/dom_storage_types.h"
14 15
15 namespace dom_storage { 16 namespace dom_storage {
16 17
17 // A wrapper around a std::map that adds refcounting and 18 // A wrapper around a std::map that adds refcounting and
18 // tracks the size in bytes of the keys/values, enforcing a quota. 19 // tracks the size in bytes of the keys/values, enforcing a quota.
19 // See class comments for DomStorageContext for a larger overview. 20 // See class comments for DomStorageContext for a larger overview.
20 class DomStorageMap 21 class DOM_STORAGE_EXPORT DomStorageMap
21 : public base::RefCountedThreadSafe<DomStorageMap> { 22 : public base::RefCountedThreadSafe<DomStorageMap> {
22 public: 23 public:
23 explicit DomStorageMap(size_t quota); 24 explicit DomStorageMap(size_t quota);
24 25
25 unsigned Length() const; 26 unsigned Length() const;
26 NullableString16 Key(unsigned index); 27 NullableString16 Key(unsigned index);
27 NullableString16 GetItem(const string16& key) const; 28 NullableString16 GetItem(const string16& key) const;
28 bool SetItem(const string16& key, const string16& value, 29 bool SetItem(const string16& key, const string16& value,
29 NullableString16* old_value); 30 NullableString16* old_value);
30 bool RemoveItem(const string16& key, string16* old_value); 31 bool RemoveItem(const string16& key, string16* old_value);
(...skipping 23 matching lines...) Expand all
54 ValuesMap values_; 55 ValuesMap values_;
55 ValuesMap::const_iterator key_iterator_; 56 ValuesMap::const_iterator key_iterator_;
56 unsigned last_key_index_; 57 unsigned last_key_index_;
57 size_t bytes_used_; 58 size_t bytes_used_;
58 size_t quota_; 59 size_t quota_;
59 }; 60 };
60 61
61 } // namespace dom_storage 62 } // namespace dom_storage
62 63
63 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_MAP_H_ 64 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_MAP_H_
OLDNEW
« no previous file with comments | « webkit/dom_storage/dom_storage_host.h ('k') | webkit/dom_storage/dom_storage_namespace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698