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_WEBSTORAGEAREA_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_DOM_STORAGE_WEBSTORAGEAREA_IMPL_H_ |
6 #define CONTENT_RENDERER_DOM_STORAGE_WEBSTORAGEAREA_IMPL_H_ | 6 #define CONTENT_RENDERER_DOM_STORAGE_WEBSTORAGEAREA_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "third_party/WebKit/public/platform/WebStorageArea.h" | 12 #include "third_party/WebKit/public/platform/WebStorageArea.h" |
11 #include "third_party/WebKit/public/platform/WebString.h" | 13 #include "third_party/WebKit/public/platform/WebString.h" |
12 | 14 |
13 class GURL; | 15 class GURL; |
14 | 16 |
15 namespace content { | 17 namespace content { |
16 | 18 |
17 class DOMStorageCachedArea; | 19 class DOMStorageCachedArea; |
18 | 20 |
19 class WebStorageAreaImpl : public blink::WebStorageArea { | 21 class WebStorageAreaImpl : public blink::WebStorageArea { |
20 public: | 22 public: |
21 static WebStorageAreaImpl* FromConnectionId(int id); | 23 static WebStorageAreaImpl* FromConnectionId(int id); |
22 | 24 |
23 WebStorageAreaImpl(int64 namespace_id, const GURL& origin); | 25 WebStorageAreaImpl(int64_t namespace_id, const GURL& origin); |
24 ~WebStorageAreaImpl() override; | 26 ~WebStorageAreaImpl() override; |
25 | 27 |
26 // See WebStorageArea.h for documentation on these functions. | 28 // See WebStorageArea.h for documentation on these functions. |
27 unsigned length() override; | 29 unsigned length() override; |
28 blink::WebString key(unsigned index) override; | 30 blink::WebString key(unsigned index) override; |
29 blink::WebString getItem(const blink::WebString& key) override; | 31 blink::WebString getItem(const blink::WebString& key) override; |
30 void setItem(const blink::WebString& key, | 32 void setItem(const blink::WebString& key, |
31 const blink::WebString& value, | 33 const blink::WebString& value, |
32 const blink::WebURL& page_url, | 34 const blink::WebURL& page_url, |
33 WebStorageArea::Result& result) override; | 35 WebStorageArea::Result& result) override; |
34 void removeItem(const blink::WebString& key, | 36 void removeItem(const blink::WebString& key, |
35 const blink::WebURL& page_url) override; | 37 const blink::WebURL& page_url) override; |
36 void clear(const blink::WebURL& url) override; | 38 void clear(const blink::WebURL& url) override; |
37 size_t memoryBytesUsedByCache() const override; | 39 size_t memoryBytesUsedByCache() const override; |
38 | 40 |
39 private: | 41 private: |
40 int connection_id_; | 42 int connection_id_; |
41 scoped_refptr<DOMStorageCachedArea> cached_area_; | 43 scoped_refptr<DOMStorageCachedArea> cached_area_; |
42 }; | 44 }; |
43 | 45 |
44 } // namespace content | 46 } // namespace content |
45 | 47 |
46 #endif // CONTENT_RENDERER_DOM_STORAGE_WEBSTORAGEAREA_IMPL_H_ | 48 #endif // CONTENT_RENDERER_DOM_STORAGE_WEBSTORAGEAREA_IMPL_H_ |
OLD | NEW |