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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 size_t MemoryBytesUsedByCache() const; | 48 size_t MemoryBytesUsedByCache() const; |
49 | 49 |
50 private: | 50 private: |
51 friend class DomStorageCachedAreaTest; | 51 friend class DomStorageCachedAreaTest; |
52 friend class base::RefCounted<DomStorageCachedArea>; | 52 friend class base::RefCounted<DomStorageCachedArea>; |
53 ~DomStorageCachedArea(); | 53 ~DomStorageCachedArea(); |
54 | 54 |
55 // Primes the cache, loading all values for the area. | 55 // Primes the cache, loading all values for the area. |
56 void Prime(int connection_id); | 56 void Prime(int connection_id); |
57 void PrimeIfNeeded(int connection_id) { | 57 void PrimeIfNeeded(int connection_id) { |
58 if (!map_) | 58 if (!map_.get()) |
59 Prime(connection_id); | 59 Prime(connection_id); |
60 } | 60 } |
61 | 61 |
62 // Resets the object back to its newly constructed state. | 62 // Resets the object back to its newly constructed state. |
63 void Reset(); | 63 void Reset(); |
64 | 64 |
65 // Async completion callbacks for proxied operations. | 65 // Async completion callbacks for proxied operations. |
66 // These are used to maintain cache consistency by preventing | 66 // These are used to maintain cache consistency by preventing |
67 // mutation events from other processes from overwriting local | 67 // mutation events from other processes from overwriting local |
68 // changes made after the mutation. | 68 // changes made after the mutation. |
(...skipping 12 matching lines...) Expand all Loading... |
81 int64 namespace_id_; | 81 int64 namespace_id_; |
82 GURL origin_; | 82 GURL origin_; |
83 scoped_refptr<DomStorageMap> map_; | 83 scoped_refptr<DomStorageMap> map_; |
84 scoped_refptr<DomStorageProxy> proxy_; | 84 scoped_refptr<DomStorageProxy> proxy_; |
85 base::WeakPtrFactory<DomStorageCachedArea> weak_factory_; | 85 base::WeakPtrFactory<DomStorageCachedArea> weak_factory_; |
86 }; | 86 }; |
87 | 87 |
88 } // namespace dom_storage | 88 } // namespace dom_storage |
89 | 89 |
90 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ | 90 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ |
OLD | NEW |