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 WEBKIT_QUOTA_SPECIAL_STORAGE_POLICY_H_ | 5 #ifndef WEBKIT_QUOTA_SPECIAL_STORAGE_POLICY_H_ |
6 #define WEBKIT_QUOTA_SPECIAL_STORAGE_POLICY_H_ | 6 #define WEBKIT_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 21 matching lines...) Expand all Loading... |
32 }; | 32 }; |
33 | 33 |
34 SpecialStoragePolicy(); | 34 SpecialStoragePolicy(); |
35 | 35 |
36 // Protected storage is not subject to removal by the browsing data remover. | 36 // Protected storage is not subject to removal by the browsing data remover. |
37 virtual bool IsStorageProtected(const GURL& origin) = 0; | 37 virtual bool IsStorageProtected(const GURL& origin) = 0; |
38 | 38 |
39 // Unlimited storage is not subject to 'quotas'. | 39 // Unlimited storage is not subject to 'quotas'. |
40 virtual bool IsStorageUnlimited(const GURL& origin) = 0; | 40 virtual bool IsStorageUnlimited(const GURL& origin) = 0; |
41 | 41 |
42 // Installed apps have access to the size of the remaining disk capacity. | 42 // Some origins (e.g. installed apps) have access to the size of the remaining |
43 virtual bool IsInstalledApp(const GURL& origin) = 0; | 43 // disk capacity. |
| 44 virtual bool CanQueryDiskSize(const GURL& origin) = 0; |
44 | 45 |
45 // Checks if extension identified with |extension_id| is registered as | 46 // Checks if extension identified with |extension_id| is registered as |
46 // file handler. | 47 // file handler. |
47 virtual bool IsFileHandler(const std::string& extension_id) = 0; | 48 virtual bool IsFileHandler(const std::string& extension_id) = 0; |
48 | 49 |
49 // Some origins are only allowed to store session-only data which is deleted | 50 // Some origins are only allowed to store session-only data which is deleted |
50 // when the session ends. | 51 // when the session ends. |
51 virtual bool IsStorageSessionOnly(const GURL& origin) = 0; | 52 virtual bool IsStorageSessionOnly(const GURL& origin) = 0; |
52 | 53 |
53 // Returns true if some origins are only allowed session-only storage. | 54 // Returns true if some origins are only allowed session-only storage. |
54 virtual bool HasSessionOnlyOrigins() = 0; | 55 virtual bool HasSessionOnlyOrigins() = 0; |
55 | 56 |
56 // Adds/removes an observer, the policy does not take | 57 // Adds/removes an observer, the policy does not take |
57 // ownership of the observer. Should only be called on the IO thread. | 58 // ownership of the observer. Should only be called on the IO thread. |
58 void AddObserver(Observer* observer); | 59 void AddObserver(Observer* observer); |
59 void RemoveObserver(Observer* observer); | 60 void RemoveObserver(Observer* observer); |
60 | 61 |
61 protected: | 62 protected: |
62 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; | 63 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; |
63 virtual ~SpecialStoragePolicy(); | 64 virtual ~SpecialStoragePolicy(); |
64 void NotifyObservers(); | 65 void NotifyObservers(); |
65 | 66 |
66 ObserverList<Observer> observers_; | 67 ObserverList<Observer> observers_; |
67 }; | 68 }; |
68 | 69 |
69 } // namespace quota | 70 } // namespace quota |
70 | 71 |
71 #endif // WEBKIT_QUOTA_SPECIAL_STORAGE_POLICY_H_ | 72 #endif // WEBKIT_QUOTA_SPECIAL_STORAGE_POLICY_H_ |
OLD | NEW |