| 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 CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ | 5 #ifndef CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ |
| 6 #define CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ | 6 #define CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 const base::string16& value, | 45 const base::string16& value, |
| 46 const GURL& page_url); | 46 const GURL& page_url); |
| 47 void RemoveItem(int connection_id, | 47 void RemoveItem(int connection_id, |
| 48 const base::string16& key, | 48 const base::string16& key, |
| 49 const GURL& page_url); | 49 const GURL& page_url); |
| 50 void Clear(int connection_id, const GURL& page_url); | 50 void Clear(int connection_id, const GURL& page_url); |
| 51 | 51 |
| 52 void ApplyMutation(const base::NullableString16& key, | 52 void ApplyMutation(const base::NullableString16& key, |
| 53 const base::NullableString16& new_value); | 53 const base::NullableString16& new_value); |
| 54 | 54 |
| 55 size_t MemoryBytesUsedByCache() const; | |
| 56 | |
| 57 private: | 55 private: |
| 58 friend class DOMStorageCachedAreaTest; | 56 friend class DOMStorageCachedAreaTest; |
| 59 friend class base::RefCounted<DOMStorageCachedArea>; | 57 friend class base::RefCounted<DOMStorageCachedArea>; |
| 60 ~DOMStorageCachedArea(); | 58 ~DOMStorageCachedArea(); |
| 61 | 59 |
| 62 // Primes the cache, loading all values for the area. | 60 // Primes the cache, loading all values for the area. |
| 63 void Prime(int connection_id); | 61 void Prime(int connection_id); |
| 64 void PrimeIfNeeded(int connection_id) { | 62 void PrimeIfNeeded(int connection_id) { |
| 65 if (!map_.get()) | 63 if (!map_.get()) |
| 66 Prime(connection_id); | 64 Prime(connection_id); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 88 int64_t namespace_id_; | 86 int64_t namespace_id_; |
| 89 GURL origin_; | 87 GURL origin_; |
| 90 scoped_refptr<DOMStorageMap> map_; | 88 scoped_refptr<DOMStorageMap> map_; |
| 91 scoped_refptr<DOMStorageProxy> proxy_; | 89 scoped_refptr<DOMStorageProxy> proxy_; |
| 92 base::WeakPtrFactory<DOMStorageCachedArea> weak_factory_; | 90 base::WeakPtrFactory<DOMStorageCachedArea> weak_factory_; |
| 93 }; | 91 }; |
| 94 | 92 |
| 95 } // namespace content | 93 } // namespace content |
| 96 | 94 |
| 97 #endif // CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ | 95 #endif // CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ |
| OLD | NEW |