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

Side by Side Diff: base/callback.h

Issue 7015064: Support binding WeakPtr<> to methods with void return types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a few comments. Created 9 years, 7 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/bind_unittest.cc ('k') | base/callback.h.pump » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // This file was GENERATED by command: 1 // This file was GENERATED by command:
2 // pump.py callback.h.pump 2 // pump.py callback.h.pump
3 // DO NOT EDIT BY HAND!!! 3 // DO NOT EDIT BY HAND!!!
4 4
5 5
6 6
7 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 7 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
8 // Use of this source code is governed by a BSD-style license that can be 8 // Use of this source code is governed by a BSD-style license that can be
9 // found in the LICENSE file. 9 // found in the LICENSE file.
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // 42 //
43 // EXAMPLE USAGE: 43 // EXAMPLE USAGE:
44 // 44 //
45 // /* Binding a normal function. */ 45 // /* Binding a normal function. */
46 // int Return5() { return 5; } 46 // int Return5() { return 5; }
47 // base::Callback<int(void)> func_cb = base::Bind(&Return5); 47 // base::Callback<int(void)> func_cb = base::Bind(&Return5);
48 // LOG(INFO) << func_cb.Run(); // Prints 5. 48 // LOG(INFO) << func_cb.Run(); // Prints 5.
49 // 49 //
50 // void PrintHi() { LOG(INFO) << "hi."; } 50 // void PrintHi() { LOG(INFO) << "hi."; }
51 // base::Closure void_func_cb = base::Bind(&PrintHi); 51 // base::Closure void_func_cb = base::Bind(&PrintHi);
52 // LOG(INFO) << void_func_cb.Run(); // Prints: hi. 52 // void_func_cb.Run(); // Prints: hi.
53 // 53 //
54 // /* Binding a class method. */ 54 // /* Binding a class method. */
55 // class Ref : public RefCountedThreadSafe<Ref> { 55 // class Ref : public RefCountedThreadSafe<Ref> {
56 // public: 56 // public:
57 // int Foo() { return 3; } 57 // int Foo() { return 3; }
58 // void PrintBye() { LOG(INFO) << "bye."; } 58 // void PrintBye() { LOG(INFO) << "bye."; }
59 // }; 59 // };
60 // scoped_refptr<Ref> ref = new Ref(); 60 // scoped_refptr<Ref> ref = new Ref();
61 // base::Callback<int(void)> ref_cb = base::Bind(&Ref::Foo, ref.get()); 61 // base::Callback<int(void)> ref_cb = base::Bind(&Ref::Foo, ref.get());
62 // LOG(INFO) << ref_cb.Run(); // Prints out 3. 62 // LOG(INFO) << ref_cb.Run(); // Prints out 3.
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 }; 486 };
487 487
488 488
489 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it 489 // Syntactic sugar to make Callbacks<void(void)> easier to declare since it
490 // will be used in a lot of APIs with delayed execution. 490 // will be used in a lot of APIs with delayed execution.
491 typedef Callback<void(void)> Closure; 491 typedef Callback<void(void)> Closure;
492 492
493 } // namespace base 493 } // namespace base
494 494
495 #endif // BASE_CALLBACK_H 495 #endif // BASE_CALLBACK_H
OLDNEW
« no previous file with comments | « base/bind_unittest.cc ('k') | base/callback.h.pump » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698