| 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_IMPL_H_ |
| 6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ | 6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "content/public/browser/dom_storage_context.h" | 10 #include "content/public/browser/dom_storage_context.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 NON_EXPORTED_BASE(public content::DOMStorageContext), | 21 NON_EXPORTED_BASE(public content::DOMStorageContext), |
| 22 public base::RefCountedThreadSafe<DOMStorageContextImpl> { | 22 public base::RefCountedThreadSafe<DOMStorageContextImpl> { |
| 23 public: | 23 public: |
| 24 // If |data_path| is empty, nothing will be saved to disk. | 24 // If |data_path| is empty, nothing will be saved to disk. |
| 25 DOMStorageContextImpl(const FilePath& data_path, | 25 DOMStorageContextImpl(const FilePath& data_path, |
| 26 quota::SpecialStoragePolicy* special_storage_policy); | 26 quota::SpecialStoragePolicy* special_storage_policy); |
| 27 | 27 |
| 28 // DOMStorageContext implementation. | 28 // DOMStorageContext implementation. |
| 29 virtual void GetUsageInfo(const GetUsageInfoCallback& callback) OVERRIDE; | 29 virtual void GetUsageInfo(const GetUsageInfoCallback& callback) OVERRIDE; |
| 30 virtual void DeleteOrigin(const GURL& origin) OVERRIDE; | 30 virtual void DeleteOrigin(const GURL& origin) OVERRIDE; |
| 31 virtual scoped_refptr<content::SessionStorageNamespace> |
| 32 RecreateSessionStorage(const std::string& persistent_id) OVERRIDE; |
| 31 | 33 |
| 32 // Called to free up memory that's not strictly needed. | 34 // Called to free up memory that's not strictly needed. |
| 33 void PurgeMemory(); | 35 void PurgeMemory(); |
| 34 | 36 |
| 35 // Used by content settings to alter the behavior around | 37 // Used by content settings to alter the behavior around |
| 36 // what data to keep and what data to discard at shutdown. | 38 // what data to keep and what data to discard at shutdown. |
| 37 // The policy is not so straight forward to describe, see | 39 // The policy is not so straight forward to describe, see |
| 38 // the implementation for details. | 40 // the implementation for details. |
| 39 void SetForceKeepSessionState(); | 41 void SetForceKeepSessionState(); |
| 40 | 42 |
| 41 // Called when the BrowserContext/Profile is going away. | 43 // Called when the BrowserContext/Profile is going away. |
| 42 void Shutdown(); | 44 void Shutdown(); |
| 43 | 45 |
| 44 private: | 46 private: |
| 45 friend class DOMStorageMessageFilter; // for access to context() | 47 friend class DOMStorageMessageFilter; // for access to context() |
| 46 friend class SessionStorageNamespaceImpl; // ditto | 48 friend class SessionStorageNamespaceImpl; // ditto |
| 47 friend class base::RefCountedThreadSafe<DOMStorageContextImpl>; | 49 friend class base::RefCountedThreadSafe<DOMStorageContextImpl>; |
| 48 | 50 |
| 49 virtual ~DOMStorageContextImpl(); | 51 virtual ~DOMStorageContextImpl(); |
| 50 dom_storage::DomStorageContext* context() const { return context_.get(); } | 52 dom_storage::DomStorageContext* context() const { return context_.get(); } |
| 51 | 53 |
| 52 scoped_refptr<dom_storage::DomStorageContext> context_; | 54 scoped_refptr<dom_storage::DomStorageContext> context_; |
| 53 | 55 |
| 54 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextImpl); | 56 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextImpl); |
| 55 }; | 57 }; |
| 56 | 58 |
| 57 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ | 59 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ |
| OLD | NEW |