| 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_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_PROXY_H_ |
| 6 #define CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_PROXY_H_ | 6 #define CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/strings/nullable_string16.h" | 10 #include "base/strings/nullable_string16.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "content/common/dom_storage/dom_storage_types.h" | 12 #include "content/common/dom_storage/dom_storage_types.h" |
| 13 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 // Abstract interface for cached area, renderer to browser communications. | 17 // Abstract interface for cached area, renderer to browser communications. |
| 18 class DOMStorageProxy : public base::RefCounted<DOMStorageProxy> { | 18 class DOMStorageProxy : public base::RefCounted<DOMStorageProxy> { |
| 19 public: | 19 public: |
| 20 typedef base::Callback<void(bool)> CompletionCallback; | 20 typedef base::Callback<void(bool)> CompletionCallback; |
| 21 | 21 |
| 22 virtual void LoadArea(int connection_id, | 22 virtual void LoadArea(int connection_id, |
| 23 DOMStorageValuesMap* values, | 23 DOMStorageValuesMap* values, |
| 24 bool* send_log_get_messages, | |
| 25 const CompletionCallback& callback) = 0; | 24 const CompletionCallback& callback) = 0; |
| 26 | 25 |
| 27 virtual void SetItem(int connection_id, | 26 virtual void SetItem(int connection_id, |
| 28 const base::string16& key, | 27 const base::string16& key, |
| 29 const base::string16& value, | 28 const base::string16& value, |
| 30 const GURL& page_url, | 29 const GURL& page_url, |
| 31 const CompletionCallback& callback) = 0; | 30 const CompletionCallback& callback) = 0; |
| 32 | 31 |
| 33 virtual void LogGetItem(int connection_id, | |
| 34 const base::string16& key, | |
| 35 const base::NullableString16& value) = 0; | |
| 36 | |
| 37 virtual void RemoveItem(int connection_id, | 32 virtual void RemoveItem(int connection_id, |
| 38 const base::string16& key, | 33 const base::string16& key, |
| 39 const GURL& page_url, | 34 const GURL& page_url, |
| 40 const CompletionCallback& callback) = 0; | 35 const CompletionCallback& callback) = 0; |
| 41 | 36 |
| 42 virtual void ClearArea(int connection_id, | 37 virtual void ClearArea(int connection_id, |
| 43 const GURL& page_url, | 38 const GURL& page_url, |
| 44 const CompletionCallback& callback) = 0; | 39 const CompletionCallback& callback) = 0; |
| 45 | 40 |
| 46 protected: | 41 protected: |
| 47 friend class base::RefCounted<DOMStorageProxy>; | 42 friend class base::RefCounted<DOMStorageProxy>; |
| 48 virtual ~DOMStorageProxy() {} | 43 virtual ~DOMStorageProxy() {} |
| 49 }; | 44 }; |
| 50 | 45 |
| 51 } // namespace content | 46 } // namespace content |
| 52 | 47 |
| 53 #endif // CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_PROXY_H_ | 48 #endif // CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_PROXY_H_ |
| OLD | NEW |