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_CACHED_AREA_H_ | 5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ |
6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ | 6 #define WEBKIT_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" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); |
59 void PrimeIfNeeded(int connection_id) { | 59 void PrimeIfNeeded(int connection_id) { |
60 if (!map_) | 60 if (!map_.get()) |
61 Prime(connection_id); | 61 Prime(connection_id); |
62 } | 62 } |
63 | 63 |
64 // Resets the object back to its newly constructed state. | 64 // Resets the object back to its newly constructed state. |
65 void Reset(); | 65 void Reset(); |
66 | 66 |
67 // Async completion callbacks for proxied operations. | 67 // Async completion callbacks for proxied operations. |
68 // These are used to maintain cache consistency by preventing | 68 // These are used to maintain cache consistency by preventing |
69 // mutation events from other processes from overwriting local | 69 // mutation events from other processes from overwriting local |
70 // changes made after the mutation. | 70 // changes made after the mutation. |
(...skipping 12 matching lines...) Expand all Loading... |
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_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ | 92 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ |
OLD | NEW |