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

Side by Side Diff: base/callback_forward.h

Issue 2513363003: repro for crbug.com/663886
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « base/BUILD.gn ('k') | base/callback_helpers.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_CALLBACK_FORWARD_H_ 5 #ifndef BASE_CALLBACK_FORWARD_H_
6 #define BASE_CALLBACK_FORWARD_H_ 6 #define BASE_CALLBACK_FORWARD_H_
7 7
8 namespace base { 8 namespace base {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 27 matching lines...) Expand all
38 internal::RepeatMode::Once>; 38 internal::RepeatMode::Once>;
39 template <typename Signature> 39 template <typename Signature>
40 using RepeatingCallback = Callback<Signature, 40 using RepeatingCallback = Callback<Signature,
41 internal::CopyMode::Copyable, 41 internal::CopyMode::Copyable,
42 internal::RepeatMode::Repeating>; 42 internal::RepeatMode::Repeating>;
43 using OnceClosure = OnceCallback<void()>; 43 using OnceClosure = OnceCallback<void()>;
44 using RepeatingClosure = RepeatingCallback<void()>; 44 using RepeatingClosure = RepeatingCallback<void()>;
45 45
46 } // namespace base 46 } // namespace base
47 47
48 namespace base {
49 namespace dupe {
50 namespace internal {
51
52 // CopyMode is used to control the copyablity of a Callback.
53 // MoveOnly indicates the Callback is not copyable but movable, and Copyable
54 // indicates it is copyable and movable.
55 enum class CopyMode {
56 MoveOnly,
57 Copyable,
58 };
59
60 enum class RepeatMode {
61 Once,
62 Repeating,
63 };
64
65 } // namespace internal
66
67 template <typename Signature,
68 internal::CopyMode copy_mode = internal::CopyMode::Copyable,
69 internal::RepeatMode repeat_mode = internal::RepeatMode::Repeating>
70 class Callback;
71
72 // Syntactic sugar to make Callback<void()> easier to declare since it
73 // will be used in a lot of APIs with delayed execution.
74 using Closure = Callback<void()>;
75
76 template <typename Signature>
77 using OnceCallback = Callback<Signature,
78 internal::CopyMode::MoveOnly,
79 internal::RepeatMode::Once>;
80 template <typename Signature>
81 using RepeatingCallback = Callback<Signature,
82 internal::CopyMode::Copyable,
83 internal::RepeatMode::Repeating>;
84 using OnceClosure = OnceCallback<void()>;
85 using RepeatingClosure = RepeatingCallback<void()>;
86
87 }
88 } // namespace base
48 #endif // BASE_CALLBACK_FORWARD_H_ 89 #endif // BASE_CALLBACK_FORWARD_H_
OLDNEW
« no previous file with comments | « base/BUILD.gn ('k') | base/callback_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698