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