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

Side by Side Diff: signal_callback.h

Issue 6715014: Display off is done by a callback into backlight controller (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/power_manager.git
Patch Set: Deleted unused lines, 2010->2011 Created 9 years, 9 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
« mock_backlight.h ('K') | « powerd_unittest.cc ('k') | no next file » | 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 OS Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium OS 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 POWER_MANAGER_SIGNAL_CALLBACK_H_ 5 #ifndef POWER_MANAGER_SIGNAL_CALLBACK_H_
6 #define POWER_MANAGER_SIGNAL_CALLBACK_H_ 6 #define POWER_MANAGER_SIGNAL_CALLBACK_H_
7 7
8 // These macros provide a wrapper around class methods so they can be used as 8 // These macros provide a wrapper around class methods so they can be used as
9 // callbacks. 9 // callbacks.
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 static RETURN METHOD ## Thunk(void* data) { \ 101 static RETURN METHOD ## Thunk(void* data) { \
102 METHOD ## Args* args = reinterpret_cast<METHOD ## Args*>(data); \ 102 METHOD ## Args* args = reinterpret_cast<METHOD ## Args*>(data); \
103 CLASS* obj = args->obj; \ 103 CLASS* obj = args->obj; \
104 TYPE0 arg0 = args->arg0; \ 104 TYPE0 arg0 = args->arg0; \
105 TYPE0 arg1 = args->arg1; \ 105 TYPE0 arg1 = args->arg1; \
106 delete args; \ 106 delete args; \
107 return obj->METHOD(arg0, arg1); \ 107 return obj->METHOD(arg0, arg1); \
108 } \ 108 } \
109 RETURN METHOD(TYPE0, TYPE1); 109 RETURN METHOD(TYPE0, TYPE1);
110 110
111 // This macro defines a function pointer for the thunk functions defined by
112 // the above macros.
113 //
114 // Usage example:
115 // SIGNAL_CALLBACK_PTR(bool, callback_func);
116 // is equivalent to:
117 // bool (*callback_func)((void*)
118
119 #define SIGNAL_CALLBACK_PTR(RETURN, NAME) RETURN (*NAME)(void*)
120
111 #endif // POWER_MANAGER_SIGNAL_CALLBACK_H_ 121 #endif // POWER_MANAGER_SIGNAL_CALLBACK_H_
OLDNEW
« mock_backlight.h ('K') | « powerd_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698