| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ | 5 #ifndef CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ |
| 6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ | 6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/common/storage_partition_service.mojom.h" | 14 #include "content/common/storage_partition_service.mojom.h" |
| 15 #include "content/public/browser/dom_storage_context.h" | 15 #include "content/public/browser/dom_storage_context.h" |
| 16 #include "url/origin.h" | 16 #include "url/origin.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class FilePath; | 19 class FilePath; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace mojo { |
| 23 class Connector; |
| 24 } |
| 25 |
| 22 namespace storage { | 26 namespace storage { |
| 23 class SpecialStoragePolicy; | 27 class SpecialStoragePolicy; |
| 24 } | 28 } |
| 25 | 29 |
| 26 namespace content { | 30 namespace content { |
| 27 | 31 |
| 28 class DOMStorageContextImpl; | 32 class DOMStorageContextImpl; |
| 29 class LevelDBWrapperImpl; | 33 class LevelDBWrapperImpl; |
| 30 | 34 |
| 31 // This is owned by Storage Partition and encapsulates all its dom storage | 35 // This is owned by Storage Partition and encapsulates all its dom storage |
| 32 // state. | 36 // state. |
| 33 class CONTENT_EXPORT DOMStorageContextWrapper : | 37 class CONTENT_EXPORT DOMStorageContextWrapper : |
| 34 NON_EXPORTED_BASE(public DOMStorageContext), | 38 NON_EXPORTED_BASE(public DOMStorageContext), |
| 35 public base::RefCountedThreadSafe<DOMStorageContextWrapper> { | 39 public base::RefCountedThreadSafe<DOMStorageContextWrapper> { |
| 36 public: | 40 public: |
| 37 // If |data_path| is empty, nothing will be saved to disk. | 41 // If |data_path| is empty, nothing will be saved to disk. |
| 38 DOMStorageContextWrapper( | 42 DOMStorageContextWrapper( |
| 39 const std::string& mojo_user_id, | 43 mojo::Connector* connector, |
| 40 const base::FilePath& data_path, | 44 const base::FilePath& data_path, |
| 41 const base::FilePath& local_partition_path, | 45 const base::FilePath& local_partition_path, |
| 42 storage::SpecialStoragePolicy* special_storage_policy); | 46 storage::SpecialStoragePolicy* special_storage_policy); |
| 43 | 47 |
| 44 // DOMStorageContext implementation. | 48 // DOMStorageContext implementation. |
| 45 void GetLocalStorageUsage( | 49 void GetLocalStorageUsage( |
| 46 const GetLocalStorageUsageCallback& callback) override; | 50 const GetLocalStorageUsageCallback& callback) override; |
| 47 void GetSessionStorageUsage( | 51 void GetSessionStorageUsage( |
| 48 const GetSessionStorageUsageCallback& callback) override; | 52 const GetSessionStorageUsageCallback& callback) override; |
| 49 void DeleteLocalStorage(const GURL& origin) override; | 53 void DeleteLocalStorage(const GURL& origin) override; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 std::unique_ptr<MojoState> mojo_state_; | 87 std::unique_ptr<MojoState> mojo_state_; |
| 84 | 88 |
| 85 scoped_refptr<DOMStorageContextImpl> context_; | 89 scoped_refptr<DOMStorageContextImpl> context_; |
| 86 | 90 |
| 87 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); | 91 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); |
| 88 }; | 92 }; |
| 89 | 93 |
| 90 } // namespace content | 94 } // namespace content |
| 91 | 95 |
| 92 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ | 96 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ |
| OLD | NEW |