| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 'quotas'. | 48 // Unlimited storage is not subject to 'quotas'. |
| 49 virtual bool IsStorageUnlimited(const GURL& origin) = 0; | 49 virtual bool IsStorageUnlimited(const GURL& origin) = 0; |
| 50 | 50 |
| 51 // Some origins (e.g. installed apps) have access to the size of the remaining | 51 // Some origins (e.g. installed apps) have access to the size of the remaining |
| 52 // disk capacity. | 52 // disk capacity. |
| 53 virtual bool CanQueryDiskSize(const GURL& origin) = 0; | 53 virtual bool CanQueryDiskSize(const GURL& origin) = 0; |
| 54 | 54 |
| 55 // Checks if extension identified with |extension_id| is registered as | |
| 56 // file handler. | |
| 57 virtual bool IsFileHandler(const std::string& extension_id) = 0; | |
| 58 | |
| 59 // Checks if the origin contains per-site isolated storage. | 55 // Checks if the origin contains per-site isolated storage. |
| 60 virtual bool HasIsolatedStorage(const GURL& origin) = 0; | 56 virtual bool HasIsolatedStorage(const GURL& origin) = 0; |
| 61 | 57 |
| 62 // Some origins are only allowed to store session-only data which is deleted | 58 // Some origins are only allowed to store session-only data which is deleted |
| 63 // when the session ends. | 59 // when the session ends. |
| 64 virtual bool IsStorageSessionOnly(const GURL& origin) = 0; | 60 virtual bool IsStorageSessionOnly(const GURL& origin) = 0; |
| 65 | 61 |
| 66 // Returns true if some origins are only allowed session-only storage. | 62 // Returns true if some origins are only allowed session-only storage. |
| 67 virtual bool HasSessionOnlyOrigins() = 0; | 63 virtual bool HasSessionOnlyOrigins() = 0; |
| 68 | 64 |
| 69 // Adds/removes an observer, the policy does not take | 65 // Adds/removes an observer, the policy does not take |
| 70 // ownership of the observer. Should only be called on the IO thread. | 66 // ownership of the observer. Should only be called on the IO thread. |
| 71 void AddObserver(Observer* observer); | 67 void AddObserver(Observer* observer); |
| 72 void RemoveObserver(Observer* observer); | 68 void RemoveObserver(Observer* observer); |
| 73 | 69 |
| 74 protected: | 70 protected: |
| 75 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; | 71 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; |
| 76 virtual ~SpecialStoragePolicy(); | 72 virtual ~SpecialStoragePolicy(); |
| 77 void NotifyGranted(const GURL& origin, int change_flags); | 73 void NotifyGranted(const GURL& origin, int change_flags); |
| 78 void NotifyRevoked(const GURL& origin, int change_flags); | 74 void NotifyRevoked(const GURL& origin, int change_flags); |
| 79 void NotifyCleared(); | 75 void NotifyCleared(); |
| 80 | 76 |
| 81 ObserverList<Observer> observers_; | 77 ObserverList<Observer> observers_; |
| 82 }; | 78 }; |
| 83 | 79 |
| 84 } // namespace storage | 80 } // namespace storage |
| 85 | 81 |
| 86 #endif // STORAGE_BROWSER_QUOTA_SPECIAL_STORAGE_POLICY_H_ | 82 #endif // STORAGE_BROWSER_QUOTA_SPECIAL_STORAGE_POLICY_H_ |
| OLD | NEW |