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 { | 22 namespace shell { |
23 class Connector; | 23 class Connector; |
24 } | 24 } |
25 | 25 |
26 namespace storage { | 26 namespace storage { |
27 class SpecialStoragePolicy; | 27 class SpecialStoragePolicy; |
28 } | 28 } |
29 | 29 |
30 namespace content { | 30 namespace content { |
31 | 31 |
32 class DOMStorageContextImpl; | 32 class DOMStorageContextImpl; |
33 class LevelDBWrapperImpl; | 33 class LevelDBWrapperImpl; |
34 | 34 |
35 // 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 |
36 // state. | 36 // state. |
37 class CONTENT_EXPORT DOMStorageContextWrapper : | 37 class CONTENT_EXPORT DOMStorageContextWrapper : |
38 NON_EXPORTED_BASE(public DOMStorageContext), | 38 NON_EXPORTED_BASE(public DOMStorageContext), |
39 public base::RefCountedThreadSafe<DOMStorageContextWrapper> { | 39 public base::RefCountedThreadSafe<DOMStorageContextWrapper> { |
40 public: | 40 public: |
41 // If |data_path| is empty, nothing will be saved to disk. | 41 // If |data_path| is empty, nothing will be saved to disk. |
42 DOMStorageContextWrapper( | 42 DOMStorageContextWrapper( |
43 mojo::Connector* connector, | 43 shell::Connector* connector, |
44 const base::FilePath& data_path, | 44 const base::FilePath& data_path, |
45 const base::FilePath& local_partition_path, | 45 const base::FilePath& local_partition_path, |
46 storage::SpecialStoragePolicy* special_storage_policy); | 46 storage::SpecialStoragePolicy* special_storage_policy); |
47 | 47 |
48 // DOMStorageContext implementation. | 48 // DOMStorageContext implementation. |
49 void GetLocalStorageUsage( | 49 void GetLocalStorageUsage( |
50 const GetLocalStorageUsageCallback& callback) override; | 50 const GetLocalStorageUsageCallback& callback) override; |
51 void GetSessionStorageUsage( | 51 void GetSessionStorageUsage( |
52 const GetSessionStorageUsageCallback& callback) override; | 52 const GetSessionStorageUsageCallback& callback) override; |
53 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... |
87 std::unique_ptr<MojoState> mojo_state_; | 87 std::unique_ptr<MojoState> mojo_state_; |
88 | 88 |
89 scoped_refptr<DOMStorageContextImpl> context_; | 89 scoped_refptr<DOMStorageContextImpl> context_; |
90 | 90 |
91 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); | 91 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); |
92 }; | 92 }; |
93 | 93 |
94 } // namespace content | 94 } // namespace content |
95 | 95 |
96 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ | 96 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ |
OLD | NEW |