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_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ |
6 #define CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace content { | 21 namespace content { |
22 | 22 |
23 class BrowserContext; | 23 class BrowserContext; |
24 | 24 |
25 // Represents the per-BrowserContext Local Storage data. | 25 // Represents the per-BrowserContext Local Storage data. |
26 // Call these methods only on the WebKit thread. | 26 // Call these methods only on the WebKit thread. |
27 class DOMStorageContext : public base::RefCountedThreadSafe<DOMStorageContext> { | 27 class DOMStorageContext : public base::RefCountedThreadSafe<DOMStorageContext> { |
28 public: | 28 public: |
29 virtual ~DOMStorageContext() {} | 29 virtual ~DOMStorageContext() {} |
30 | 30 |
31 CONTENT_EXPORT static DOMStorageContext* GetForBrowserContext( | |
32 BrowserContext* browser_context); | |
33 | |
34 // Returns all the file paths of local storage files. | 31 // Returns all the file paths of local storage files. |
35 virtual std::vector<FilePath> GetAllStorageFiles() = 0; | 32 virtual std::vector<FilePath> GetAllStorageFiles() = 0; |
36 | 33 |
37 // Get the file name of the local storage file for the given origin. | 34 // Get the file name of the local storage file for the given origin. |
38 virtual FilePath GetFilePath(const string16& origin_id) const = 0; | 35 virtual FilePath GetFilePath(const string16& origin_id) const = 0; |
39 | 36 |
40 // Deletes the local storage file for the given origin. | 37 // Deletes the local storage file for the given origin. |
41 virtual void DeleteForOrigin(const string16& origin_id) = 0; | 38 virtual void DeleteForOrigin(const string16& origin_id) = 0; |
42 | 39 |
43 // Deletes a single local storage file. | 40 // Deletes a single local storage file. |
44 virtual void DeleteLocalStorageFile(const FilePath& file_path) = 0; | 41 virtual void DeleteLocalStorageFile(const FilePath& file_path) = 0; |
45 | 42 |
46 // Delete any local storage files that have been touched since the cutoff | 43 // Delete any local storage files that have been touched since the cutoff |
47 // date that's supplied. Protected origins, per the SpecialStoragePolicy, | 44 // date that's supplied. Protected origins, per the SpecialStoragePolicy, |
48 // are not deleted by this method. | 45 // are not deleted by this method. |
49 virtual void DeleteDataModifiedSince(const base::Time& cutoff) = 0; | 46 virtual void DeleteDataModifiedSince(const base::Time& cutoff) = 0; |
50 }; | 47 }; |
51 | 48 |
52 } // namespace content | 49 } // namespace content |
53 | 50 |
54 #endif // CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ | 51 #endif // CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ |
OLD | NEW |