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

Side by Side Diff: mojo/util/capture_util.h

Issue 1410053006: Move third_party/mojo/src/mojo/public to mojo/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 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 | « mojo/shell/static_application_loader.cc ('k') | net/BUILD.gn » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 MOJO_UTIL_CAPTURE_UTIL_H_ 5 #ifndef MOJO_UTIL_CAPTURE_UTIL_H_
6 #define MOJO_UTIL_CAPTURE_UTIL_H_ 6 #define MOJO_UTIL_CAPTURE_UTIL_H_
7 7
8 #include "third_party/mojo/src/mojo/public/cpp/bindings/lib/template_util.h" 8 #include "mojo/public/cpp/bindings/lib/template_util.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 11
12 template <typename T1> 12 template <typename T1>
13 mojo::Callback<void(T1)> Capture(T1* t1) { 13 mojo::Callback<void(T1)> Capture(T1* t1) {
14 return [t1](T1 got_t1) { *t1 = mojo::internal::Forward(got_t1); }; 14 return [t1](T1 got_t1) { *t1 = mojo::internal::Forward(got_t1); };
15 } 15 }
16 16
17 template <typename T1, typename T2> 17 template <typename T1, typename T2>
18 mojo::Callback<void(T1, T2)> Capture(T1* t1, T2* t2) { 18 mojo::Callback<void(T1, T2)> Capture(T1* t1, T2* t2) {
19 return [t1, t2](T1 got_t1, T2 got_t2) { 19 return [t1, t2](T1 got_t1, T2 got_t2) {
20 *t1 = mojo::internal::Forward(got_t1); 20 *t1 = mojo::internal::Forward(got_t1);
21 *t2 = mojo::internal::Forward(got_t2); 21 *t2 = mojo::internal::Forward(got_t2);
22 }; 22 };
23 } 23 }
24 24
25 template <typename T1, typename T2, typename T3> 25 template <typename T1, typename T2, typename T3>
26 mojo::Callback<void(T1, T2, T3)> Capture(T1* t1, T2* t2, T3* t3) { 26 mojo::Callback<void(T1, T2, T3)> Capture(T1* t1, T2* t2, T3* t3) {
27 return [t1, t2, t3](T1 got_t1, T2 got_t2, T3 got_t3) { 27 return [t1, t2, t3](T1 got_t1, T2 got_t2, T3 got_t3) {
28 *t1 = mojo::internal::Forward(got_t1); 28 *t1 = mojo::internal::Forward(got_t1);
29 *t2 = mojo::internal::Forward(got_t2); 29 *t2 = mojo::internal::Forward(got_t2);
30 *t3 = mojo::internal::Forward(got_t3); 30 *t3 = mojo::internal::Forward(got_t3);
31 }; 31 };
32 } 32 }
33 33
34 } // namespace mojo 34 } // namespace mojo
35 35
36 #endif // MOJO_UTIL_CAPTURE_UTIL_H_ 36 #endif // MOJO_UTIL_CAPTURE_UTIL_H_
OLDNEW
« no previous file with comments | « mojo/shell/static_application_loader.cc ('k') | net/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698