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

Side by Side Diff: base/win/object_watcher.h

Issue 7461141: Rename BASE_API to BASE_EXPORT. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | « base/win/iat_patch_function.h ('k') | base/win/registry.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) 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 BASE_WIN_OBJECT_WATCHER_H_ 5 #ifndef BASE_WIN_OBJECT_WATCHER_H_
6 #define BASE_WIN_OBJECT_WATCHER_H_ 6 #define BASE_WIN_OBJECT_WATCHER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <windows.h> 9 #include <windows.h>
10 10
11 #include "base/base_api.h" 11 #include "base/base_export.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 13
14 namespace base { 14 namespace base {
15 namespace win { 15 namespace win {
16 16
17 // A class that provides a means to asynchronously wait for a Windows object to 17 // A class that provides a means to asynchronously wait for a Windows object to
18 // become signaled. It is an abstraction around RegisterWaitForSingleObject 18 // become signaled. It is an abstraction around RegisterWaitForSingleObject
19 // that provides a notification callback, OnObjectSignaled, that runs back on 19 // that provides a notification callback, OnObjectSignaled, that runs back on
20 // the origin thread (i.e., the thread that called StartWatching). 20 // the origin thread (i.e., the thread that called StartWatching).
21 // 21 //
(...skipping 13 matching lines...) Expand all
35 // } 35 // }
36 // private: 36 // private:
37 // base::ObjectWatcher watcher_; 37 // base::ObjectWatcher watcher_;
38 // }; 38 // };
39 // 39 //
40 // In the above example, MyClass wants to "do stuff" when object becomes 40 // In the above example, MyClass wants to "do stuff" when object becomes
41 // signaled. ObjectWatcher makes this task easy. When MyClass goes out of 41 // signaled. ObjectWatcher makes this task easy. When MyClass goes out of
42 // scope, the watcher_ will be destroyed, and there is no need to worry about 42 // scope, the watcher_ will be destroyed, and there is no need to worry about
43 // OnObjectSignaled being called on a deleted MyClass pointer. Easy! 43 // OnObjectSignaled being called on a deleted MyClass pointer. Easy!
44 // 44 //
45 class BASE_API ObjectWatcher : public MessageLoop::DestructionObserver { 45 class BASE_EXPORT ObjectWatcher : public MessageLoop::DestructionObserver {
46 public: 46 public:
47 class BASE_API Delegate { 47 class BASE_EXPORT Delegate {
48 public: 48 public:
49 virtual ~Delegate() {} 49 virtual ~Delegate() {}
50 // Called from the MessageLoop when a signaled object is detected. To 50 // Called from the MessageLoop when a signaled object is detected. To
51 // continue watching the object, StartWatching must be called again. 51 // continue watching the object, StartWatching must be called again.
52 virtual void OnObjectSignaled(HANDLE object) = 0; 52 virtual void OnObjectSignaled(HANDLE object) = 0;
53 }; 53 };
54 54
55 ObjectWatcher(); 55 ObjectWatcher();
56 ~ObjectWatcher(); 56 ~ObjectWatcher();
57 57
(...skipping 28 matching lines...) Expand all
86 struct Watch; 86 struct Watch;
87 Watch* watch_; 87 Watch* watch_;
88 88
89 DISALLOW_COPY_AND_ASSIGN(ObjectWatcher); 89 DISALLOW_COPY_AND_ASSIGN(ObjectWatcher);
90 }; 90 };
91 91
92 } // namespace win 92 } // namespace win
93 } // namespace base 93 } // namespace base
94 94
95 #endif // BASE_OBJECT_WATCHER_H_ 95 #endif // BASE_OBJECT_WATCHER_H_
OLDNEW
« no previous file with comments | « base/win/iat_patch_function.h ('k') | base/win/registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698