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

Side by Side Diff: base/callback.h

Issue 2813012: Revert 49985 - doh (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 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 | « no previous file | chrome/browser/chrome_browser_application_mac.mm » ('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) 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 BASE_CALLBACK_H_ 5 #ifndef BASE_CALLBACK_H_
6 #define BASE_CALLBACK_H_ 6 #define BASE_CALLBACK_H_
7 7
8 #include "base/tuple.h" 8 #include "base/tuple.h"
9 #include "base/raw_scoped_refptr_mismatch_checker.h" 9 #include "base/raw_scoped_refptr_mismatch_checker.h"
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 DispatchToMethod(this->obj_, this->meth_, params); 118 DispatchToMethod(this->obj_, this->meth_, params);
119 } 119 }
120 }; 120 };
121 121
122 // 0-arg implementation 122 // 0-arg implementation
123 struct Callback0 { 123 struct Callback0 {
124 typedef CallbackRunner<Tuple0> Type; 124 typedef CallbackRunner<Tuple0> Type;
125 }; 125 };
126 126
127 template <class T> 127 template <class T>
128 Callback0::Type* NewCallback(T* object, void (T::*method)()) { 128 typename Callback0::Type* NewCallback(T* object, void (T::*method)()) {
129 return new CallbackImpl<T, void (T::*)(), Tuple0 >(object, method); 129 return new CallbackImpl<T, void (T::*)(), Tuple0 >(object, method);
130 } 130 }
131 131
132 // 1-arg implementation 132 // 1-arg implementation
133 template <typename Arg1> 133 template <typename Arg1>
134 struct Callback1 { 134 struct Callback1 {
135 typedef CallbackRunner<Tuple1<Arg1> > Type; 135 typedef CallbackRunner<Tuple1<Arg1> > Type;
136 }; 136 };
137 137
138 template <class T, typename Arg1> 138 template <class T, typename Arg1>
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 }; 243 };
244 244
245 template <class T, typename ReturnValue> 245 template <class T, typename ReturnValue>
246 typename CallbackWithReturnValue<ReturnValue>::Type* 246 typename CallbackWithReturnValue<ReturnValue>::Type*
247 NewCallbackWithReturnValue(T* object, ReturnValue (T::*method)()) { 247 NewCallbackWithReturnValue(T* object, ReturnValue (T::*method)()) {
248 return new CallbackWithReturnValueImpl<T, ReturnValue (T::*)(), ReturnValue>( 248 return new CallbackWithReturnValueImpl<T, ReturnValue (T::*)(), ReturnValue>(
249 object, method); 249 object, method);
250 } 250 }
251 251
252 #endif // BASE_CALLBACK_H 252 #endif // BASE_CALLBACK_H
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_application_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698