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

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: +#include 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
« no previous file with comments | « ipc/ipc_message_templates.h ('k') | ipc/ipc_message_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..192d2efb93e75c2e1598b9f8c1e1ab97868e77a8 100644
--- a/ipc/ipc_message_templates_impl.h
+++ b/ipc/ipc_message_templates_impl.h
@@ -5,37 +5,39 @@
#ifndef IPC_IPC_MESSAGE_TEMPLATES_IMPL_H_
#define IPC_IPC_MESSAGE_TEMPLATES_IMPL_H_
+#include <tuple>
+
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 +50,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 +58,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 +71,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 +80,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) {
« no previous file with comments | « ipc/ipc_message_templates.h ('k') | ipc/ipc_message_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698