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

Side by Side Diff: components/login/base_screen_handler_utils.h

Issue 1159553007: Move Tuple to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_ 5 #ifndef COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_
6 #define COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_ 6 #define COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_
7 7
8 #include <cstddef> 8 #include <cstddef>
9 #include <string> 9 #include <string>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 template <typename Arg, size_t index> 63 template <typename Arg, size_t index>
64 typename UnwrapConstRef<Arg>::Type ParseArg(const base::ListValue* args) { 64 typename UnwrapConstRef<Arg>::Type ParseArg(const base::ListValue* args) {
65 typename UnwrapConstRef<Arg>::Type parsed; 65 typename UnwrapConstRef<Arg>::Type parsed;
66 CHECK(GetArg(args, index, &parsed)); 66 CHECK(GetArg(args, index, &parsed));
67 return parsed; 67 return parsed;
68 } 68 }
69 69
70 template <typename... Args, size_t... Ns> 70 template <typename... Args, size_t... Ns>
71 inline void DispatchToCallback(const base::Callback<void(Args...)>& callback, 71 inline void DispatchToCallback(const base::Callback<void(Args...)>& callback,
72 const base::ListValue* args, 72 const base::ListValue* args,
73 IndexSequence<Ns...> indexes) { 73 base::IndexSequence<Ns...> indexes) {
74 DCHECK(args); 74 DCHECK(args);
75 DCHECK_EQ(sizeof...(Args), args->GetSize()); 75 DCHECK_EQ(sizeof...(Args), args->GetSize());
76 76
77 callback.Run(ParseArg<Args, Ns>(args)...); 77 callback.Run(ParseArg<Args, Ns>(args)...);
78 } 78 }
79 79
80 template <typename... Args> 80 template <typename... Args>
81 void CallbackWrapper(const base::Callback<void(Args...)>& callback, 81 void CallbackWrapper(const base::Callback<void(Args...)>& callback,
82 const base::ListValue* args) { 82 const base::ListValue* args) {
83 DispatchToCallback(callback, args, MakeIndexSequence<sizeof...(Args)>()); 83 DispatchToCallback(callback, args,
84 base::MakeIndexSequence<sizeof...(Args)>());
84 } 85 }
85 86
86 87
87 } // namespace login 88 } // namespace login
88 89
89 #endif // COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_ 90 #endif // COMPONENTS_LOGIN_BASE_SCREEN_HANDLER_UTILS_H_
OLDNEW
« no previous file with comments | « components/guest_view/renderer/guest_view_request.cc ('k') | components/nacl/loader/nacl_ipc_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698