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 CHROME_BROWSER_SYNC_UTIL_EXTENSIONS_ACTIVITY_MONITOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_UTIL_EXTENSIONS_ACTIVITY_MONITOR_H_ |
6 #define CHROME_BROWSER_SYNC_UTIL_EXTENSIONS_ACTIVITY_MONITOR_H_ | 6 #define CHROME_BROWSER_SYNC_UTIL_EXTENSIONS_ACTIVITY_MONITOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Fills |buffer| with snapshot of current records in constant time by | 51 // Fills |buffer| with snapshot of current records in constant time by |
52 // swapping. This is done mutually exclusively w.r.t methods of this class. | 52 // swapping. This is done mutually exclusively w.r.t methods of this class. |
53 void GetAndClearRecords(Records* buffer); | 53 void GetAndClearRecords(Records* buffer); |
54 | 54 |
55 // Add |records| piece-wise (by extension id) to the set of active records. | 55 // Add |records| piece-wise (by extension id) to the set of active records. |
56 // This is done mutually exclusively w.r.t the methods of this class. | 56 // This is done mutually exclusively w.r.t the methods of this class. |
57 void PutRecords(const Records& records); | 57 void PutRecords(const Records& records); |
58 | 58 |
59 // NotificationObserver implementation. Called on |ui_loop_|. | 59 // NotificationObserver implementation. Called on |ui_loop_|. |
60 virtual void Observe(NotificationType type, | 60 virtual void Observe(int type, |
61 const NotificationSource& source, | 61 const NotificationSource& source, |
62 const NotificationDetails& details); | 62 const NotificationDetails& details); |
63 private: | 63 private: |
64 Records records_; | 64 Records records_; |
65 mutable base::Lock records_lock_; | 65 mutable base::Lock records_lock_; |
66 | 66 |
67 // Used only from UI loop. | 67 // Used only from UI loop. |
68 NotificationRegistrar registrar_; | 68 NotificationRegistrar registrar_; |
69 }; | 69 }; |
70 | 70 |
71 } // namespace browser_sync | 71 } // namespace browser_sync |
72 | 72 |
73 #endif // CHROME_BROWSER_SYNC_UTIL_EXTENSIONS_ACTIVITY_MONITOR_H_ | 73 #endif // CHROME_BROWSER_SYNC_UTIL_EXTENSIONS_ACTIVITY_MONITOR_H_ |
OLD | NEW |