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_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 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "webkit/dom_storage/dom_storage_context.h" | 14 #include "webkit/dom_storage/dom_storage_context.h" |
15 | 15 |
16 class FilePath; | 16 class FilePath; |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class BrowserContext; | 20 class BrowserContext; |
| 21 class SessionStorageNamespace; |
21 | 22 |
22 // Represents the per-BrowserContext Local Storage data. | 23 // Represents the per-BrowserContext Local Storage data. |
23 class DOMStorageContext { | 24 class DOMStorageContext { |
24 public: | 25 public: |
25 typedef base::Callback< | 26 typedef base::Callback< |
26 void(const std::vector<dom_storage::DomStorageContext::UsageInfo>&)> | 27 void(const std::vector<dom_storage::DomStorageContext::UsageInfo>&)> |
27 GetUsageInfoCallback; | 28 GetUsageInfoCallback; |
28 | 29 |
29 // Returns a collection of origins using local storage to the given callback. | 30 // Returns a collection of origins using local storage to the given callback. |
30 virtual void GetUsageInfo(const GetUsageInfoCallback& callback) = 0; | 31 virtual void GetUsageInfo(const GetUsageInfoCallback& callback) = 0; |
31 | 32 |
32 // Deletes the local storage data for the given origin. | 33 // Deletes the local storage data for the given origin. |
33 virtual void DeleteOrigin(const GURL& origin) = 0; | 34 virtual void DeleteOrigin(const GURL& origin) = 0; |
34 | 35 |
35 // The stuff below is DEPRECATED. | 36 // The stuff below is DEPRECATED. |
36 typedef base::Callback<void(const std::vector<FilePath>&)> | 37 typedef base::Callback<void(const std::vector<FilePath>&)> |
37 GetAllStorageFilesCallback; | 38 GetAllStorageFilesCallback; |
38 virtual void GetAllStorageFiles( | 39 virtual void GetAllStorageFiles( |
39 const GetAllStorageFilesCallback& callback) = 0; | 40 const GetAllStorageFilesCallback& callback) = 0; |
40 virtual FilePath GetFilePath(const string16& origin_id) const = 0; | 41 virtual FilePath GetFilePath(const string16& origin_id) const = 0; |
41 virtual void DeleteForOrigin(const string16& origin_id) = 0; | 42 virtual void DeleteForOrigin(const string16& origin_id) = 0; |
42 virtual void DeleteLocalStorageFile(const FilePath& file_path) = 0; | 43 virtual void DeleteLocalStorageFile(const FilePath& file_path) = 0; |
43 | 44 |
| 45 // Called when the sessionStorage for |persistent_namespace_id| can safely be |
| 46 // deleted (it won't be used by session restore). |
| 47 virtual void DoomSessionStorage( |
| 48 const std::string& persistent_namespace_id) = 0; |
| 49 |
| 50 virtual scoped_refptr<SessionStorageNamespace> RecreateSessionStorage( |
| 51 const std::string& persistent_id) = 0; |
| 52 |
44 protected: | 53 protected: |
45 virtual ~DOMStorageContext() {} | 54 virtual ~DOMStorageContext() {} |
46 }; | 55 }; |
47 | 56 |
48 } // namespace content | 57 } // namespace content |
49 | 58 |
50 #endif // CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ | 59 #endif // CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ |
OLD | NEW |