OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_IN_PROCESS_WEBKIT_DOM_STORAGE_CONTEXT_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_CONTEXT_IMPL_H_ |
6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_CONTEXT_IMPL_H_ | 6 #define CONTENT_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_CONTEXT_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/time.h" | 15 #include "base/time.h" |
16 #include "content/public/browser/dom_storage_context.h" | 16 #include "content/public/browser/dom_storage_context.h" |
17 | 17 |
18 class DOMStorageArea; | 18 class DOMStorageArea; |
19 class DOMStorageMessageFilter; | 19 class DOMStorageMessageFilter; |
20 class DOMStorageNamespace; | 20 class DOMStorageNamespace; |
21 class WebKitContext; | |
22 | 21 |
23 namespace quota { | 22 namespace quota { |
24 class SpecialStoragePolicy; | 23 class SpecialStoragePolicy; |
25 } | 24 } |
26 | 25 |
27 // This is owned by WebKitContext and is all the dom storage information that's | 26 // This is owned by BrowserContext and is all the dom storage information that's |
28 // shared by all the DOMStorageMessageFilters that share the same browser | 27 // shared by all the DOMStorageMessageFilters that share the same browser |
29 // context. The specifics of responsibilities are fairly well documented here | 28 // context. The specifics of responsibilities are fairly well documented here |
30 // and in StorageNamespace and StorageArea. Everything is only to be accessed | 29 // and in StorageNamespace and StorageArea. Everything is only to be accessed |
31 // on the WebKit thread unless noted otherwise. | 30 // on the WebKit thread unless noted otherwise. |
32 class CONTENT_EXPORT DOMStorageContextImpl : | 31 class CONTENT_EXPORT DOMStorageContextImpl : |
33 NON_EXPORTED_BASE(public content::DOMStorageContext) { | 32 NON_EXPORTED_BASE(public content::DOMStorageContext) { |
34 public: | 33 public: |
35 DOMStorageContextImpl(WebKitContext* webkit_context, | 34 // If |data_path| is empty, nothing will be saved to disk. |
| 35 DOMStorageContextImpl(const FilePath& data_path, |
36 quota::SpecialStoragePolicy* special_storage_policy); | 36 quota::SpecialStoragePolicy* special_storage_policy); |
37 virtual ~DOMStorageContextImpl(); | 37 virtual ~DOMStorageContextImpl(); |
38 | 38 |
39 // DOMStorageContext implementation: | 39 // DOMStorageContext implementation: |
40 virtual std::vector<FilePath> GetAllStorageFiles() OVERRIDE; | 40 virtual std::vector<FilePath> GetAllStorageFiles() OVERRIDE; |
41 virtual FilePath GetFilePath(const string16& origin_id) const OVERRIDE; | 41 virtual FilePath GetFilePath(const string16& origin_id) const OVERRIDE; |
42 virtual void DeleteForOrigin(const string16& origin_id) OVERRIDE; | 42 virtual void DeleteForOrigin(const string16& origin_id) OVERRIDE; |
43 virtual void DeleteLocalStorageFile(const FilePath& file_path) OVERRIDE; | 43 virtual void DeleteLocalStorageFile(const FilePath& file_path) OVERRIDE; |
44 virtual void DeleteDataModifiedSince(const base::Time& cutoff) OVERRIDE; | 44 virtual void DeleteDataModifiedSince(const base::Time& cutoff) OVERRIDE; |
45 | 45 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // Maps ids to StorageNamespaces. We own these objects. | 154 // Maps ids to StorageNamespaces. We own these objects. |
155 typedef std::map<int64, DOMStorageNamespace*> StorageNamespaceMap; | 155 typedef std::map<int64, DOMStorageNamespace*> StorageNamespaceMap; |
156 StorageNamespaceMap storage_namespace_map_; | 156 StorageNamespaceMap storage_namespace_map_; |
157 | 157 |
158 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 158 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
159 | 159 |
160 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextImpl); | 160 DISALLOW_IMPLICIT_CONSTRUCTORS(DOMStorageContextImpl); |
161 }; | 161 }; |
162 | 162 |
163 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_CONTEXT_IMPL_H_ | 163 #endif // CONTENT_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_CONTEXT_IMPL_H_ |
OLD | NEW |