OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CHANNEL_H_ | 5 #ifndef CHROME_BROWSER_SYNC_UTIL_CHANNEL_H_ |
6 #define CHROME_BROWSER_SYNC_UTIL_CHANNEL_H_ | 6 #define CHROME_BROWSER_SYNC_UTIL_CHANNEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 /////////////////////////////////////////////////////////////////////////////// | 9 /////////////////////////////////////////////////////////////////////////////// |
10 // | 10 // |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // | 45 // |
46 // private: | 46 // private: |
47 // Channel<FooEvent> channel_; | 47 // Channel<FooEvent> channel_; |
48 // }; | 48 // }; |
49 // | 49 // |
50 // | 50 // |
51 /////////////////////////////////////////////////////////////////////////////// | 51 /////////////////////////////////////////////////////////////////////////////// |
52 | 52 |
53 #include "base/lock.h" | 53 #include "base/lock.h" |
54 #include "base/observer_list.h" | 54 #include "base/observer_list.h" |
| 55 #include "base/platform_thread.h" |
55 | 56 |
56 namespace browser_sync { | 57 namespace browser_sync { |
57 | 58 |
58 template <typename EventType> | 59 template <typename EventType> |
59 class Channel; | 60 class Channel; |
60 | 61 |
61 class EventHandler { | 62 class EventHandler { |
62 }; | 63 }; |
63 | 64 |
64 template <typename EventType> | 65 template <typename EventType> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 136 |
136 private: | 137 private: |
137 Lock event_handlers_mutex_; | 138 Lock event_handlers_mutex_; |
138 PlatformThreadId locking_thread_; | 139 PlatformThreadId locking_thread_; |
139 ObserverList<EventHandler> event_handlers_; | 140 ObserverList<EventHandler> event_handlers_; |
140 }; | 141 }; |
141 | 142 |
142 } // namespace browser_sync | 143 } // namespace browser_sync |
143 | 144 |
144 #endif // CHROME_BROWSER_SYNC_UTIL_CHANNEL_H_ | 145 #endif // CHROME_BROWSER_SYNC_UTIL_CHANNEL_H_ |
OLD | NEW |