OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_STORAGE_MONITOR_H_ | 5 #ifndef STORAGE_BROWSER_QUOTA_STORAGE_MONITOR_H_ |
6 #define STORAGE_BROWSER_QUOTA_STORAGE_MONITOR_H_ | 6 #define STORAGE_BROWSER_QUOTA_STORAGE_MONITOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 base::TimeDelta rate; | 53 base::TimeDelta rate; |
54 bool requires_update; | 54 bool requires_update; |
55 | 55 |
56 ObserverState(); | 56 ObserverState(); |
57 }; | 57 }; |
58 typedef std::map<StorageObserver*, ObserverState> StorageObserverStateMap; | 58 typedef std::map<StorageObserver*, ObserverState> StorageObserverStateMap; |
59 | 59 |
60 void DispatchPendingEvent(); | 60 void DispatchPendingEvent(); |
61 | 61 |
62 StorageObserverStateMap observers_; | 62 StorageObserverStateMap observers_; |
63 base::OneShotTimer<StorageObserverList> notification_timer_; | 63 base::OneShotTimer notification_timer_; |
64 StorageObserver::Event pending_event_; | 64 StorageObserver::Event pending_event_; |
65 | 65 |
66 friend class content::StorageMonitorTestBase; | 66 friend class content::StorageMonitorTestBase; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(StorageObserverList); | 68 DISALLOW_COPY_AND_ASSIGN(StorageObserverList); |
69 }; | 69 }; |
70 | 70 |
71 | 71 |
72 // Manages the storage observers of a common host. Caches the usage and quota of | 72 // Manages the storage observers of a common host. Caches the usage and quota of |
73 // the host to avoid accumulating for every change. | 73 // the host to avoid accumulating for every change. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 QuotaManager* quota_manager_; | 172 QuotaManager* quota_manager_; |
173 StorageTypeObserversMap storage_type_observers_map_; | 173 StorageTypeObserversMap storage_type_observers_map_; |
174 | 174 |
175 DISALLOW_COPY_AND_ASSIGN(StorageMonitor); | 175 DISALLOW_COPY_AND_ASSIGN(StorageMonitor); |
176 }; | 176 }; |
177 | 177 |
178 } // namespace storage | 178 } // namespace storage |
179 | 179 |
180 #endif // STORAGE_BROWSER_QUOTA_STORAGE_MONITOR_H_ | 180 #endif // STORAGE_BROWSER_QUOTA_STORAGE_MONITOR_H_ |
OLD | NEW |