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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/public/browser/dom_storage_context.h" | 10 #include "content/public/browser/dom_storage_context.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 class CONTENT_EXPORT DOMStorageContextWrapper : | 26 class CONTENT_EXPORT DOMStorageContextWrapper : |
27 NON_EXPORTED_BASE(public DOMStorageContext), | 27 NON_EXPORTED_BASE(public DOMStorageContext), |
28 public base::RefCountedThreadSafe<DOMStorageContextWrapper> { | 28 public base::RefCountedThreadSafe<DOMStorageContextWrapper> { |
29 public: | 29 public: |
30 // If |data_path| is empty, nothing will be saved to disk. | 30 // If |data_path| is empty, nothing will be saved to disk. |
31 DOMStorageContextWrapper( | 31 DOMStorageContextWrapper( |
32 const base::FilePath& data_path, | 32 const base::FilePath& data_path, |
33 storage::SpecialStoragePolicy* special_storage_policy); | 33 storage::SpecialStoragePolicy* special_storage_policy); |
34 | 34 |
35 // DOMStorageContext implementation. | 35 // DOMStorageContext implementation. |
36 virtual void GetLocalStorageUsage( | 36 void GetLocalStorageUsage( |
37 const GetLocalStorageUsageCallback& callback) override; | 37 const GetLocalStorageUsageCallback& callback) override; |
38 virtual void GetSessionStorageUsage( | 38 void GetSessionStorageUsage( |
39 const GetSessionStorageUsageCallback& callback) override; | 39 const GetSessionStorageUsageCallback& callback) override; |
40 virtual void DeleteLocalStorage(const GURL& origin) override; | 40 void DeleteLocalStorage(const GURL& origin) override; |
41 virtual void DeleteSessionStorage( | 41 void DeleteSessionStorage(const SessionStorageUsageInfo& usage_info) override; |
42 const SessionStorageUsageInfo& usage_info) override; | 42 void SetSaveSessionStorageOnDisk() override; |
43 virtual void SetSaveSessionStorageOnDisk() override; | 43 scoped_refptr<SessionStorageNamespace> RecreateSessionStorage( |
44 virtual scoped_refptr<SessionStorageNamespace> | 44 const std::string& persistent_id) override; |
45 RecreateSessionStorage(const std::string& persistent_id) override; | 45 void StartScavengingUnusedSessionStorage() override; |
46 virtual void StartScavengingUnusedSessionStorage() override; | |
47 | 46 |
48 // Used by content settings to alter the behavior around | 47 // Used by content settings to alter the behavior around |
49 // what data to keep and what data to discard at shutdown. | 48 // what data to keep and what data to discard at shutdown. |
50 // The policy is not so straight forward to describe, see | 49 // The policy is not so straight forward to describe, see |
51 // the implementation for details. | 50 // the implementation for details. |
52 void SetForceKeepSessionState(); | 51 void SetForceKeepSessionState(); |
53 | 52 |
54 // Called when the BrowserContext/Profile is going away. | 53 // Called when the BrowserContext/Profile is going away. |
55 void Shutdown(); | 54 void Shutdown(); |
56 | 55 |
57 private: | 56 private: |
58 friend class DOMStorageMessageFilter; // for access to context() | 57 friend class DOMStorageMessageFilter; // for access to context() |
59 friend class SessionStorageNamespaceImpl; // ditto | 58 friend class SessionStorageNamespaceImpl; // ditto |
60 friend class base::RefCountedThreadSafe<DOMStorageContextWrapper>; | 59 friend class base::RefCountedThreadSafe<DOMStorageContextWrapper>; |
61 | 60 |
62 virtual ~DOMStorageContextWrapper(); | 61 ~DOMStorageContextWrapper() override; |
63 DOMStorageContextImpl* context() const { return context_.get(); } | 62 DOMStorageContextImpl* context() const { return context_.get(); } |
64 | 63 |
65 scoped_refptr<DOMStorageContextImpl> context_; | 64 scoped_refptr<DOMStorageContextImpl> context_; |
66 | 65 |
67 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); | 66 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextWrapper); |
68 }; | 67 }; |
69 | 68 |
70 } // namespace content | 69 } // namespace content |
71 | 70 |
72 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ | 71 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_WRAPPER_H_ |
OLD | NEW |