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_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_PROXY_H_ |
6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ | 6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_PROXY_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "content/public/browser/dom_storage_context.h" | 9 #include "content/public/browser/dom_storage_context.h" |
10 | 10 |
11 namespace base { | 11 namespace base { |
12 class FilePath; | 12 class FilePath; |
13 } | 13 } |
14 | 14 |
15 namespace dom_storage { | 15 namespace content { |
16 class DomStorageContext; | 16 class DOMStorageContextImpl; |
michaeln
2013/08/06 22:44:59
nit: this can go down into the namespace below
kinuko
2013/08/07 14:29:52
Done.
| |
17 } | 17 } |
18 | 18 |
19 namespace quota { | 19 namespace quota { |
20 class SpecialStoragePolicy; | 20 class SpecialStoragePolicy; |
21 } | 21 } |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 | 24 |
25 // This is owned by BrowserContext (aka Profile) and encapsulates all | 25 // This is owned by BrowserContext (aka Profile) and encapsulates all |
26 // per-profile dom storage state. | 26 // per-profile dom storage state. |
27 class CONTENT_EXPORT DOMStorageContextImpl : | 27 class CONTENT_EXPORT DOMStorageContextProxy : |
michaeln
2013/08/06 22:44:59
nit: I see why you're using the term 'proxy' here,
kinuko
2013/08/07 14:29:52
Done, renamed to Wrapper.
| |
28 NON_EXPORTED_BASE(public DOMStorageContext), | 28 NON_EXPORTED_BASE(public DOMStorageContext), |
29 public base::RefCountedThreadSafe<DOMStorageContextImpl> { | 29 public base::RefCountedThreadSafe<DOMStorageContextProxy> { |
30 public: | 30 public: |
31 // If |data_path| is empty, nothing will be saved to disk. | 31 // If |data_path| is empty, nothing will be saved to disk. |
32 DOMStorageContextImpl(const base::FilePath& data_path, | 32 DOMStorageContextProxy(const base::FilePath& data_path, |
33 quota::SpecialStoragePolicy* special_storage_policy); | 33 quota::SpecialStoragePolicy* special_storage_policy); |
34 | 34 |
35 // DOMStorageContext implementation. | 35 // DOMStorageContext implementation. |
36 virtual void GetLocalStorageUsage( | 36 virtual void GetLocalStorageUsage( |
37 const GetLocalStorageUsageCallback& callback) OVERRIDE; | 37 const GetLocalStorageUsageCallback& callback) OVERRIDE; |
38 virtual void GetSessionStorageUsage( | 38 virtual void GetSessionStorageUsage( |
39 const GetSessionStorageUsageCallback& callback) OVERRIDE; | 39 const GetSessionStorageUsageCallback& callback) OVERRIDE; |
40 virtual void DeleteLocalStorage(const GURL& origin) OVERRIDE; | 40 virtual void DeleteLocalStorage(const GURL& origin) OVERRIDE; |
41 virtual void DeleteSessionStorage( | 41 virtual void DeleteSessionStorage( |
42 const dom_storage::SessionStorageUsageInfo& usage_info) OVERRIDE; | 42 const SessionStorageUsageInfo& usage_info) OVERRIDE; |
43 virtual void SetSaveSessionStorageOnDisk() OVERRIDE; | 43 virtual void SetSaveSessionStorageOnDisk() OVERRIDE; |
44 virtual scoped_refptr<SessionStorageNamespace> | 44 virtual scoped_refptr<SessionStorageNamespace> |
45 RecreateSessionStorage(const std::string& persistent_id) OVERRIDE; | 45 RecreateSessionStorage(const std::string& persistent_id) OVERRIDE; |
46 virtual void StartScavengingUnusedSessionStorage() OVERRIDE; | 46 virtual void StartScavengingUnusedSessionStorage() OVERRIDE; |
47 | 47 |
48 // Called to free up memory that's not strictly needed. | 48 // Called to free up memory that's not strictly needed. |
49 void PurgeMemory(); | 49 void PurgeMemory(); |
50 | 50 |
51 // Used by content settings to alter the behavior around | 51 // Used by content settings to alter the behavior around |
52 // what data to keep and what data to discard at shutdown. | 52 // what data to keep and what data to discard at shutdown. |
53 // The policy is not so straight forward to describe, see | 53 // The policy is not so straight forward to describe, see |
54 // the implementation for details. | 54 // the implementation for details. |
55 void SetForceKeepSessionState(); | 55 void SetForceKeepSessionState(); |
56 | 56 |
57 // Called when the BrowserContext/Profile is going away. | 57 // Called when the BrowserContext/Profile is going away. |
58 void Shutdown(); | 58 void Shutdown(); |
59 | 59 |
60 private: | 60 private: |
61 friend class DOMStorageMessageFilter; // for access to context() | 61 friend class DOMStorageMessageFilter; // for access to context() |
62 friend class SessionStorageNamespaceImpl; // ditto | 62 friend class SessionStorageNamespaceImpl; // ditto |
63 friend class base::RefCountedThreadSafe<DOMStorageContextImpl>; | 63 friend class base::RefCountedThreadSafe<DOMStorageContextProxy>; |
64 | 64 |
65 virtual ~DOMStorageContextImpl(); | 65 virtual ~DOMStorageContextProxy(); |
66 dom_storage::DomStorageContext* context() const { return context_.get(); } | 66 DOMStorageContextImpl* context() const { return context_.get(); } |
67 | 67 |
68 scoped_refptr<dom_storage::DomStorageContext> context_; | 68 scoped_refptr<DOMStorageContextImpl> context_; |
69 | 69 |
70 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextImpl); | 70 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextProxy); |
71 }; | 71 }; |
72 | 72 |
73 } // namespace content | 73 } // namespace content |
74 | 74 |
75 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ | 75 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_PROXY_H_ |
OLD | NEW |