Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: content/browser/dom_storage/dom_storage_context_wrapper.h

Issue 1953703004: Purge browser cache for dom storage in a smarter way (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dom_storage
Patch Set: Fix limit and description for UMA. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/memory_pressure_listener.h"
12 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
13 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
14 #include "content/common/storage_partition_service.mojom.h" 15 #include "content/common/storage_partition_service.mojom.h"
15 #include "content/public/browser/dom_storage_context.h" 16 #include "content/public/browser/dom_storage_context.h"
16 #include "url/origin.h" 17 #include "url/origin.h"
17 18
18 namespace base { 19 namespace base {
19 class FilePath; 20 class FilePath;
20 } 21 }
21 22
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // Called when the BrowserContext/Profile is going away. 67 // Called when the BrowserContext/Profile is going away.
67 void Shutdown(); 68 void Shutdown();
68 69
69 void Flush(); 70 void Flush();
70 71
71 // See mojom::StoragePartitionService interface. 72 // See mojom::StoragePartitionService interface.
72 void OpenLocalStorage(const url::Origin& origin, 73 void OpenLocalStorage(const url::Origin& origin,
73 mojom::LevelDBObserverPtr observer, 74 mojom::LevelDBObserverPtr observer,
74 mojom::LevelDBWrapperRequest request); 75 mojom::LevelDBWrapperRequest request);
75 76
77 // Called on UI thread when the system is under memory pressure.
78 void OnMemoryPressure(
79 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
80
76 private: 81 private:
77 friend class DOMStorageMessageFilter; // for access to context() 82 friend class DOMStorageMessageFilter; // for access to context()
78 friend class SessionStorageNamespaceImpl; // ditto 83 friend class SessionStorageNamespaceImpl; // ditto
79 friend class base::RefCountedThreadSafe<DOMStorageContextWrapper>; 84 friend class base::RefCountedThreadSafe<DOMStorageContextWrapper>;
80 85
81 ~DOMStorageContextWrapper() override; 86 ~DOMStorageContextWrapper() override;
82 DOMStorageContextImpl* context() const { return context_.get(); } 87 DOMStorageContextImpl* context() const { return context_.get(); }
83 88
84 // An inner class to keep all mojo-ish details together and not bleed them 89 // An inner class to keep all mojo-ish details together and not bleed them
85 // through the public interface. 90 // through the public interface.
86 class MojoState; 91 class MojoState;
87 std::unique_ptr<MojoState> mojo_state_; 92 std::unique_ptr<MojoState> mojo_state_;
88 93
94 // To receive memory pressure signals.
95 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
96
89 scoped_refptr<DOMStorageContextImpl> context_; 97 scoped_refptr<DOMStorageContextImpl> context_;
90 98
91 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); 99 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper);
92 }; 100 };
93 101
94 } // namespace content 102 } // namespace content
95 103
96 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ 104 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698