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 24 matching lines...) Expand all Loading... |
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 // Checks if extension identified with |extension_id| is registered as | 41 // Checks if extension identified with |extension_id| is registered as |
42 // file handler. | 42 // file handler. |
43 virtual bool IsFileHandler(const std::string& extension_id) = 0; | 43 virtual bool IsFileHandler(const std::string& extension_id) = 0; |
44 | 44 |
| 45 // Some origins are only allowed to store session-only data which is deleted |
| 46 // when the session ends. |
| 47 virtual bool IsStorageSessionOnly(const GURL& origin) = 0; |
| 48 |
45 // Adds/removes an observer, the policy does not take | 49 // Adds/removes an observer, the policy does not take |
46 // ownership of the observer. Should only be called on the IO thread. | 50 // ownership of the observer. Should only be called on the IO thread. |
47 void AddObserver(Observer* observer); | 51 void AddObserver(Observer* observer); |
48 void RemoveObserver(Observer* observer); | 52 void RemoveObserver(Observer* observer); |
49 | 53 |
50 protected: | 54 protected: |
51 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; | 55 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; |
52 virtual ~SpecialStoragePolicy(); | 56 virtual ~SpecialStoragePolicy(); |
53 void NotifyObservers(); | 57 void NotifyObservers(); |
54 | 58 |
55 ObserverList<Observer> observers_; | 59 ObserverList<Observer> observers_; |
56 }; | 60 }; |
57 | 61 |
58 } // namespace quota | 62 } // namespace quota |
59 | 63 |
60 #endif // WEBKIT_QUOTA_SPECIAL_STORAGE_POLICY_H_ | 64 #endif // WEBKIT_QUOTA_SPECIAL_STORAGE_POLICY_H_ |
OLD | NEW |