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

Side by Side Diff: webkit/renderer/dom_storage/dom_storage_cached_area.h

Issue 16415016: Move nullable_string16.h to the string subdirectory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar Created 7 years, 6 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/common/webdropdata.cc ('k') | webkit/renderer/dom_storage/dom_storage_cached_area.cc » ('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_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ 5 #ifndef WEBKIT_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_
6 #define WEBKIT_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ 6 #define WEBKIT_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_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/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/nullable_string16.h" 12 #include "base/strings/nullable_string16.h"
13 #include "googleurl/src/gurl.h" 13 #include "googleurl/src/gurl.h"
14 #include "webkit/storage/webkit_storage_export.h" 14 #include "webkit/storage/webkit_storage_export.h"
15 15
16 namespace dom_storage { 16 namespace dom_storage {
17 17
18 class DomStorageMap; 18 class DomStorageMap;
19 class DomStorageProxy; 19 class DomStorageProxy;
20 20
21 // Unlike the other classes in the dom_storage library, this one is intended 21 // Unlike the other classes in the dom_storage library, this one is intended
22 // for use in renderer processes. It maintains a complete cache of the 22 // for use in renderer processes. It maintains a complete cache of the
23 // origin's Map of key/value pairs for fast access. The cache is primed on 23 // origin's Map of key/value pairs for fast access. The cache is primed on
24 // first access and changes are written to the backend thru the |proxy|. 24 // first access and changes are written to the backend thru the |proxy|.
25 // Mutations originating in other processes are applied to the cache via 25 // Mutations originating in other processes are applied to the cache via
26 // the ApplyMutation method. 26 // the ApplyMutation method.
27 class WEBKIT_STORAGE_EXPORT DomStorageCachedArea : 27 class WEBKIT_STORAGE_EXPORT DomStorageCachedArea :
28 public base::RefCounted<DomStorageCachedArea> { 28 public base::RefCounted<DomStorageCachedArea> {
29 public: 29 public:
30 DomStorageCachedArea(int64 namespace_id, const GURL& origin, 30 DomStorageCachedArea(int64 namespace_id, const GURL& origin,
31 DomStorageProxy* proxy); 31 DomStorageProxy* proxy);
32 32
33 int64 namespace_id() const { return namespace_id_; } 33 int64 namespace_id() const { return namespace_id_; }
34 const GURL& origin() const { return origin_; } 34 const GURL& origin() const { return origin_; }
35 35
36 unsigned GetLength(int connection_id); 36 unsigned GetLength(int connection_id);
37 NullableString16 GetKey(int connection_id, unsigned index); 37 base::NullableString16 GetKey(int connection_id, unsigned index);
38 NullableString16 GetItem(int connection_id, const base::string16& key); 38 base::NullableString16 GetItem(int connection_id, const base::string16& key);
39 bool SetItem(int connection_id, 39 bool SetItem(int connection_id,
40 const base::string16& key, 40 const base::string16& key,
41 const base::string16& value, 41 const base::string16& value,
42 const GURL& page_url); 42 const GURL& page_url);
43 void RemoveItem(int connection_id, const base::string16& key, 43 void RemoveItem(int connection_id, const base::string16& key,
44 const GURL& page_url); 44 const GURL& page_url);
45 void Clear(int connection_id, const GURL& page_url); 45 void Clear(int connection_id, const GURL& page_url);
46 46
47 void ApplyMutation(const NullableString16& key, 47 void ApplyMutation(const base::NullableString16& key,
48 const NullableString16& new_value); 48 const base::NullableString16& new_value);
49 49
50 size_t MemoryBytesUsedByCache() const; 50 size_t MemoryBytesUsedByCache() const;
51 51
52 private: 52 private:
53 friend class DomStorageCachedAreaTest; 53 friend class DomStorageCachedAreaTest;
54 friend class base::RefCounted<DomStorageCachedArea>; 54 friend class base::RefCounted<DomStorageCachedArea>;
55 ~DomStorageCachedArea(); 55 ~DomStorageCachedArea();
56 56
57 // Primes the cache, loading all values for the area. 57 // Primes the cache, loading all values for the area.
58 void Prime(int connection_id); 58 void Prime(int connection_id);
(...skipping 24 matching lines...) Expand all
83 int64 namespace_id_; 83 int64 namespace_id_;
84 GURL origin_; 84 GURL origin_;
85 scoped_refptr<DomStorageMap> map_; 85 scoped_refptr<DomStorageMap> map_;
86 scoped_refptr<DomStorageProxy> proxy_; 86 scoped_refptr<DomStorageProxy> proxy_;
87 base::WeakPtrFactory<DomStorageCachedArea> weak_factory_; 87 base::WeakPtrFactory<DomStorageCachedArea> weak_factory_;
88 }; 88 };
89 89
90 } // namespace dom_storage 90 } // namespace dom_storage
91 91
92 #endif // WEBKIT_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ 92 #endif // WEBKIT_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_
OLDNEW
« no previous file with comments | « webkit/common/webdropdata.cc ('k') | webkit/renderer/dom_storage/dom_storage_cached_area.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698