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 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 friend class base::RefCountedThreadSafe<DOMStorageContextWrapper>; | 83 friend class base::RefCountedThreadSafe<DOMStorageContextWrapper>; |
84 | 84 |
85 ~DOMStorageContextWrapper() override; | 85 ~DOMStorageContextWrapper() override; |
86 DOMStorageContextImpl* context() const { return context_.get(); } | 86 DOMStorageContextImpl* context() const { return context_.get(); } |
87 | 87 |
88 // Called on UI thread when the system is under memory pressure. | 88 // Called on UI thread when the system is under memory pressure. |
89 void OnMemoryPressure( | 89 void OnMemoryPressure( |
90 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); | 90 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
91 | 91 |
92 // base::MemoryCoordinatorClient implementation: | 92 // base::MemoryCoordinatorClient implementation: |
93 void OnMemoryStateChange(base::MemoryState state) override; | 93 void OnPurgeMemory() override; |
94 | 94 |
95 void PurgeMemory(DOMStorageContextImpl::PurgeOption purge_option); | 95 void PurgeMemory(DOMStorageContextImpl::PurgeOption purge_option); |
96 | 96 |
97 void GotMojoLocalStorageUsage(GetLocalStorageUsageCallback callback, | 97 void GotMojoLocalStorageUsage(GetLocalStorageUsageCallback callback, |
98 std::vector<LocalStorageUsageInfo> usage); | 98 std::vector<LocalStorageUsageInfo> usage); |
99 | 99 |
100 // Keep all mojo-ish details together and not bleed them through the public | 100 // Keep all mojo-ish details together and not bleed them through the public |
101 // interface. | 101 // interface. |
102 std::unique_ptr<LocalStorageContextMojo> mojo_state_; | 102 std::unique_ptr<LocalStorageContextMojo> mojo_state_; |
103 | 103 |
104 // To receive memory pressure signals. | 104 // To receive memory pressure signals. |
105 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 105 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
106 | 106 |
107 scoped_refptr<DOMStorageContextImpl> context_; | 107 scoped_refptr<DOMStorageContextImpl> context_; |
108 | 108 |
109 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); | 109 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); |
110 }; | 110 }; |
111 | 111 |
112 } // namespace content | 112 } // namespace content |
113 | 113 |
114 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ | 114 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ |
OLD | NEW |