Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: chrome/browser/sync/util/event_sys.h

Issue 251080: Sync: Remove pthreads from event_sys code. Remove asynch version of GaiaAuthe... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/syncable/syncable.h ('k') | chrome/browser/sync/util/event_sys-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_EVENT_SYS_H_ 5 #ifndef CHROME_BROWSER_SYNC_UTIL_EVENT_SYS_H_
6 #define CHROME_BROWSER_SYNC_UTIL_EVENT_SYS_H_ 6 #define CHROME_BROWSER_SYNC_UTIL_EVENT_SYS_H_
7 7
8 #include "chrome/browser/sync/util/pthread_helpers_fwd.h" 8 class AutoLock;
9 class Lock;
9 10
10 // An abstract base class for listening to events. 11 // An abstract base class for listening to events.
11 // 12 //
12 // Don't inherit from this class yourself. Using NewEventListenerHookup() is 13 // Don't inherit from this class yourself. Using NewEventListenerHookup() is
13 // much easier. 14 // much easier.
14 template <typename EventType> 15 template <typename EventType>
15 class EventListener { 16 class EventListener {
16 public: 17 public:
17 virtual void HandleEvent(const EventType& event) = 0; 18 virtual void HandleEvent(const EventType& event) = 0;
18 }; 19 };
19 20
20 // See the -inl.h for details about the following. 21 // See the -inl.h for details about the following.
21 22
22 template <typename EventTraits, typename NotifyLock = PThreadNoLock, 23 template <typename EventTraits, typename NotifyLock = Lock,
23 typename ScopedNotifyLocker = PThreadScopedLock<NotifyLock> > 24 typename ScopedNotifyLocker = AutoLock>
24 class EventChannel; 25 class EventChannel;
25 26
26 class EventListenerHookup; 27 class EventListenerHookup;
27 28
28 template <typename EventChannel, typename CallbackObject, 29 template <typename EventChannel, typename CallbackObject,
29 typename CallbackMethod> 30 typename CallbackMethod>
30 EventListenerHookup* NewEventListenerHookup(EventChannel* channel, 31 EventListenerHookup* NewEventListenerHookup(EventChannel* channel,
31 CallbackObject* cbobject, 32 CallbackObject* cbobject,
32 CallbackMethod cbmethod); 33 CallbackMethod cbmethod);
33 34
34 template <typename EventChannel, typename CallbackObject, 35 template <typename EventChannel, typename CallbackObject,
35 typename CallbackMethod, typename CallbackArg0> 36 typename CallbackMethod, typename CallbackArg0>
36 EventListenerHookup* NewEventListenerHookup(EventChannel* channel, 37 EventListenerHookup* NewEventListenerHookup(EventChannel* channel,
37 CallbackObject* cbobject, 38 CallbackObject* cbobject,
38 CallbackMethod cbmethod, 39 CallbackMethod cbmethod,
39 CallbackArg0 arg0); 40 CallbackArg0 arg0);
40 41
41 #endif // CHROME_BROWSER_SYNC_UTIL_EVENT_SYS_H_ 42 #endif // CHROME_BROWSER_SYNC_UTIL_EVENT_SYS_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/syncable/syncable.h ('k') | chrome/browser/sync/util/event_sys-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698