| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Checks if the origin contains per-site isolated storage. | 55 // Checks if the origin contains per-site isolated storage. |
| 56 virtual bool HasIsolatedStorage(const GURL& origin) = 0; | 56 virtual bool HasIsolatedStorage(const GURL& origin) = 0; |
| 57 | 57 |
| 58 // 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 |
| 59 // when the session ends. | 59 // when the session ends. |
| 60 virtual bool IsStorageSessionOnly(const GURL& origin) = 0; | 60 virtual bool IsStorageSessionOnly(const GURL& origin) = 0; |
| 61 | 61 |
| 62 // Returns true if some origins are only allowed session-only storage. | 62 // Returns true if some origins are only allowed session-only storage. |
| 63 virtual bool HasSessionOnlyOrigins() = 0; | 63 virtual bool HasSessionOnlyOrigins() = 0; |
| 64 | 64 |
| 65 virtual bool IsStorageDurable(const GURL& origin) = 0; |
| 66 |
| 65 // Adds/removes an observer, the policy does not take | 67 // Adds/removes an observer, the policy does not take |
| 66 // ownership of the observer. Should only be called on the IO thread. | 68 // ownership of the observer. Should only be called on the IO thread. |
| 67 void AddObserver(Observer* observer); | 69 void AddObserver(Observer* observer); |
| 68 void RemoveObserver(Observer* observer); | 70 void RemoveObserver(Observer* observer); |
| 69 | 71 |
| 70 protected: | 72 protected: |
| 71 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; | 73 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; |
| 72 virtual ~SpecialStoragePolicy(); | 74 virtual ~SpecialStoragePolicy(); |
| 73 void NotifyGranted(const GURL& origin, int change_flags); | 75 void NotifyGranted(const GURL& origin, int change_flags); |
| 74 void NotifyRevoked(const GURL& origin, int change_flags); | 76 void NotifyRevoked(const GURL& origin, int change_flags); |
| 75 void NotifyCleared(); | 77 void NotifyCleared(); |
| 76 | 78 |
| 77 base::ObserverList<Observer> observers_; | 79 base::ObserverList<Observer> observers_; |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 } // namespace storage | 82 } // namespace storage |
| 81 | 83 |
| 82 #endif // STORAGE_BROWSER_QUOTA_SPECIAL_STORAGE_POLICY_H_ | 84 #endif // STORAGE_BROWSER_QUOTA_SPECIAL_STORAGE_POLICY_H_ |
| OLD | NEW |