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" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "webkit/storage/webkit_storage_export.h" |
12 | 13 |
13 class GURL; | 14 class GURL; |
14 | 15 |
15 namespace quota { | 16 namespace quota { |
16 | 17 |
17 // Special rights are granted to 'extensions' and 'applications'. The | 18 // Special rights are granted to 'extensions' and 'applications'. The |
18 // storage subsystems query this interface to determine which origins | 19 // storage subsystems query this interface to determine which origins |
19 // have these rights. Chrome provides an impl that is cognizant of what | 20 // have these rights. Chrome provides an impl that is cognizant of what |
20 // is currently installed in the extensions system. | 21 // is currently installed in the extensions system. |
21 // The IsSomething() methods must be thread-safe, however Observers should | 22 // The IsSomething() methods must be thread-safe, however Observers should |
22 // only be notified, added, and removed on the IO thead. | 23 // only be notified, added, and removed on the IO thead. |
23 class SpecialStoragePolicy | 24 class WEBKIT_STORAGE_EXPORT SpecialStoragePolicy |
24 : public base::RefCountedThreadSafe<SpecialStoragePolicy> { | 25 : public base::RefCountedThreadSafe<SpecialStoragePolicy> { |
25 public: | 26 public: |
26 class Observer { | 27 class Observer { |
27 public: | 28 public: |
28 virtual void OnSpecialStoragePolicyChanged() = 0; | 29 virtual void OnSpecialStoragePolicyChanged() = 0; |
29 protected: | 30 protected: |
30 virtual ~Observer(); | 31 virtual ~Observer(); |
31 }; | 32 }; |
32 | 33 |
33 SpecialStoragePolicy(); | 34 SpecialStoragePolicy(); |
(...skipping 27 matching lines...) Expand all Loading... |
61 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; | 62 friend class base::RefCountedThreadSafe<SpecialStoragePolicy>; |
62 virtual ~SpecialStoragePolicy(); | 63 virtual ~SpecialStoragePolicy(); |
63 void NotifyObservers(); | 64 void NotifyObservers(); |
64 | 65 |
65 ObserverList<Observer> observers_; | 66 ObserverList<Observer> observers_; |
66 }; | 67 }; |
67 | 68 |
68 } // namespace quota | 69 } // namespace quota |
69 | 70 |
70 #endif // WEBKIT_QUOTA_SPECIAL_STORAGE_POLICY_H_ | 71 #endif // WEBKIT_QUOTA_SPECIAL_STORAGE_POLICY_H_ |
OLD | NEW |