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

Unified Diff: ipc/ipc_message_templates_impl.h

Issue 1770013002: Replace base::Tuple in //ipc with std::tuple (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ipc/ipc_message_templates_impl.h
diff --git a/ipc/ipc_message_templates_impl.h b/ipc/ipc_message_templates_impl.h
index bfcdad016fabaff7e751ce03025aba2551631e20..ca6ca9cc187b1d03feac71a644da317a60b20da7 100644
--- a/ipc/ipc_message_templates_impl.h
+++ b/ipc/ipc_message_templates_impl.h
@@ -10,32 +10,32 @@ namespace IPC {
template <typename... Ts>
class ParamDeserializer : public MessageReplyDeserializer {
public:
- explicit ParamDeserializer(const base::Tuple<Ts&...>& out) : out_(out) {}
+ explicit ParamDeserializer(const std::tuple<Ts&...>& out) : out_(out) {}
bool SerializeOutputParameters(const IPC::Message& msg,
base::PickleIterator iter) override {
return ReadParam(&msg, &iter, &out_);
}
- base::Tuple<Ts&...> out_;
+ std::tuple<Ts&...> out_;
};
template <typename Meta, typename... Ins>
-MessageT<Meta, base::Tuple<Ins...>, void>::MessageT(Routing routing,
+MessageT<Meta, std::tuple<Ins...>, void>::MessageT(Routing routing,
const Ins&... ins)
: Message(routing.id, ID, PRIORITY_NORMAL) {
- WriteParam(this, base::MakeRefTuple(ins...));
+ WriteParam(this, std::tie(ins...));
}
template <typename Meta, typename... Ins>
-bool MessageT<Meta, base::Tuple<Ins...>, void>::Read(const Message* msg,
+bool MessageT<Meta, std::tuple<Ins...>, void>::Read(const Message* msg,
Param* p) {
base::PickleIterator iter(*msg);
return ReadParam(msg, &iter, p);
}
template <typename Meta, typename... Ins>
-void MessageT<Meta, base::Tuple<Ins...>, void>::Log(std::string* name,
+void MessageT<Meta, std::tuple<Ins...>, void>::Log(std::string* name,
const Message* msg,
std::string* l) {
if (name)
@@ -48,7 +48,7 @@ void MessageT<Meta, base::Tuple<Ins...>, void>::Log(std::string* name,
}
template <typename Meta, typename... Ins, typename... Outs>
-MessageT<Meta, base::Tuple<Ins...>, base::Tuple<Outs...>>::MessageT(
+MessageT<Meta, std::tuple<Ins...>, std::tuple<Outs...>>::MessageT(
Routing routing,
const Ins&... ins,
Outs*... outs)
@@ -56,12 +56,12 @@ MessageT<Meta, base::Tuple<Ins...>, base::Tuple<Outs...>>::MessageT(
routing.id,
ID,
PRIORITY_NORMAL,
- new ParamDeserializer<Outs...>(base::MakeRefTuple(*outs...))) {
- WriteParam(this, base::MakeRefTuple(ins...));
+ new ParamDeserializer<Outs...>(std::tie(*outs...))) {
+ WriteParam(this, std::tie(ins...));
}
template <typename Meta, typename... Ins, typename... Outs>
-bool MessageT<Meta, base::Tuple<Ins...>, base::Tuple<Outs...>>::ReadSendParam(
+bool MessageT<Meta, std::tuple<Ins...>, std::tuple<Outs...>>::ReadSendParam(
const Message* msg,
SendParam* p) {
base::PickleIterator iter = SyncMessage::GetDataIterator(msg);
@@ -69,7 +69,7 @@ bool MessageT<Meta, base::Tuple<Ins...>, base::Tuple<Outs...>>::ReadSendParam(
}
template <typename Meta, typename... Ins, typename... Outs>
-bool MessageT<Meta, base::Tuple<Ins...>, base::Tuple<Outs...>>::ReadReplyParam(
+bool MessageT<Meta, std::tuple<Ins...>, std::tuple<Outs...>>::ReadReplyParam(
const Message* msg,
ReplyParam* p) {
base::PickleIterator iter = SyncMessage::GetDataIterator(msg);
@@ -78,14 +78,14 @@ bool MessageT<Meta, base::Tuple<Ins...>, base::Tuple<Outs...>>::ReadReplyParam(
template <typename Meta, typename... Ins, typename... Outs>
void MessageT<Meta,
- base::Tuple<Ins...>,
- base::Tuple<Outs...>>::WriteReplyParams(Message* reply,
+ std::tuple<Ins...>,
+ std::tuple<Outs...>>::WriteReplyParams(Message* reply,
const Outs&... outs) {
- WriteParam(reply, base::MakeRefTuple(outs...));
+ WriteParam(reply, std::tie(outs...));
}
template <typename Meta, typename... Ins, typename... Outs>
-void MessageT<Meta, base::Tuple<Ins...>, base::Tuple<Outs...>>::Log(
+void MessageT<Meta, std::tuple<Ins...>, std::tuple<Outs...>>::Log(
std::string* name,
const Message* msg,
std::string* l) {

Powered by Google App Engine
This is Rietveld 408576698