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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 public: | 28 public: |
29 DomStorageCachedArea(int64 namespace_id, const GURL& origin, | 29 DomStorageCachedArea(int64 namespace_id, const GURL& origin, |
30 DomStorageProxy* proxy); | 30 DomStorageProxy* proxy); |
31 | 31 |
32 int64 namespace_id() const { return namespace_id_; } | 32 int64 namespace_id() const { return namespace_id_; } |
33 const GURL& origin() const { return origin_; } | 33 const GURL& origin() const { return origin_; } |
34 | 34 |
35 unsigned GetLength(int connection_id); | 35 unsigned GetLength(int connection_id); |
36 NullableString16 GetKey(int connection_id, unsigned index); | 36 NullableString16 GetKey(int connection_id, unsigned index); |
37 NullableString16 GetItem(int connection_id, const string16& key); | 37 NullableString16 GetItem(int connection_id, const string16& key); |
| 38 bool ContainsItem(int connection_id, const string16& key); |
38 bool SetItem(int connection_id, const string16& key, const string16& value, | 39 bool SetItem(int connection_id, const string16& key, const string16& value, |
39 const GURL& page_url); | 40 const GURL& page_url); |
40 void RemoveItem(int connection_id, const string16& key, | 41 void RemoveItem(int connection_id, const string16& key, |
41 const GURL& page_url); | 42 const GURL& page_url); |
42 void Clear(int connection_id, const GURL& page_url); | 43 void Clear(int connection_id, const GURL& page_url); |
43 | 44 |
44 void ApplyMutation(const NullableString16& key, | 45 void ApplyMutation(const NullableString16& key, |
45 const NullableString16& new_value); | 46 const NullableString16& new_value); |
46 | 47 |
47 private: | 48 private: |
(...skipping 30 matching lines...) Expand all Loading... |
78 int64 namespace_id_; | 79 int64 namespace_id_; |
79 GURL origin_; | 80 GURL origin_; |
80 scoped_refptr<DomStorageMap> map_; | 81 scoped_refptr<DomStorageMap> map_; |
81 scoped_refptr<DomStorageProxy> proxy_; | 82 scoped_refptr<DomStorageProxy> proxy_; |
82 base::WeakPtrFactory<DomStorageCachedArea> weak_factory_; | 83 base::WeakPtrFactory<DomStorageCachedArea> weak_factory_; |
83 }; | 84 }; |
84 | 85 |
85 } // namespace dom_storage | 86 } // namespace dom_storage |
86 | 87 |
87 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ | 88 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CACHED_AREA_H_ |
OLD | NEW |