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 STORAGE_BROWSER_QUOTA_SPECIAL_STORAGE_POLICY_H_ | 5 #ifndef STORAGE_BROWSER_QUOTA_SPECIAL_STORAGE_POLICY_H_ |
6 #define STORAGE_BROWSER_QUOTA_SPECIAL_STORAGE_POLICY_H_ | 6 #define STORAGE_BROWSER_QUOTA_SPECIAL_STORAGE_POLICY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 // Protected storage is not subject to removal by the browsing data remover. | 45 // Protected storage is not subject to removal by the browsing data remover. |
46 virtual bool IsStorageProtected(const GURL& origin) = 0; | 46 virtual bool IsStorageProtected(const GURL& origin) = 0; |
47 | 47 |
48 // Unlimited storage is not subject to quota or storage pressure eviction. | 48 // Unlimited storage is not subject to quota or storage pressure eviction. |
49 virtual bool IsStorageUnlimited(const GURL& origin) = 0; | 49 virtual bool IsStorageUnlimited(const GURL& origin) = 0; |
50 | 50 |
51 // Durable storage is not subject to storage pressure eviction. | 51 // Durable storage is not subject to storage pressure eviction. |
52 virtual bool IsStorageDurable(const GURL& origin) = 0; | 52 virtual bool IsStorageDurable(const GURL& origin) = 0; |
53 | 53 |
| 54 // Some origins (e.g. installed apps) have access to the size of the remaining |
| 55 // disk capacity. |
| 56 virtual bool CanQueryDiskSize(const GURL& origin) = 0; |
| 57 |
54 // Checks if the origin contains per-site isolated storage. | 58 // Checks if the origin contains per-site isolated storage. |
55 virtual bool HasIsolatedStorage(const GURL& origin) = 0; | 59 virtual bool HasIsolatedStorage(const GURL& origin) = 0; |
56 | 60 |
57 // Some origins are only allowed to store session-only data which is deleted | 61 // Some origins are only allowed to store session-only data which is deleted |
58 // when the session ends. | 62 // when the session ends. |
59 virtual bool IsStorageSessionOnly(const GURL& origin) = 0; | 63 virtual bool IsStorageSessionOnly(const GURL& origin) = 0; |
60 | 64 |
61 // Returns true if some origins are only allowed session-only storage. | 65 // Returns true if some origins are only allowed session-only storage. |
62 virtual bool HasSessionOnlyOrigins() = 0; | 66 virtual bool HasSessionOnlyOrigins() = 0; |
63 | 67 |
64 // Adds/removes an observer, the policy does not take | 68 // Adds/removes an observer, the policy does not take |
65 // ownership of the observer. Should only be called on the IO thread. | 69 // ownership of the observer. Should only be called on the IO thread. |
66 void AddObserver(Observer* observer); | 70 void AddObserver(Observer* observer); |
67 void RemoveObserver(Observer* observer); | 71 void RemoveObserver(Observer* observer); |
68 | 72 |
69 protected: | 73 protected: |
70 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; | 74 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; |
71 virtual ~SpecialStoragePolicy(); | 75 virtual ~SpecialStoragePolicy(); |
72 void NotifyGranted(const GURL& origin, int change_flags); | 76 void NotifyGranted(const GURL& origin, int change_flags); |
73 void NotifyRevoked(const GURL& origin, int change_flags); | 77 void NotifyRevoked(const GURL& origin, int change_flags); |
74 void NotifyCleared(); | 78 void NotifyCleared(); |
75 | 79 |
76 base::ObserverList<Observer> observers_; | 80 base::ObserverList<Observer> observers_; |
77 }; | 81 }; |
78 | 82 |
79 } // namespace storage | 83 } // namespace storage |
80 | 84 |
81 #endif // STORAGE_BROWSER_QUOTA_SPECIAL_STORAGE_POLICY_H_ | 85 #endif // STORAGE_BROWSER_QUOTA_SPECIAL_STORAGE_POLICY_H_ |
OLD | NEW |