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

Unified Diff: ipc/ipc_message_utils.cc

Issue 12943006: Fix libcxx build. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_utils.cc
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index f3e40faaec1450e1fe1310501e2883d8319b4007..a8ad2b09571dc6f837c007287b245c2d29655307 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -404,8 +404,11 @@ void ParamTraits<std::vector<unsigned char> >::Log(const param_type& p,
void ParamTraits<std::vector<bool> >::Write(Message* m, const param_type& p) {
WriteParam(m, static_cast<int>(p.size()));
+ // Cast to bool below is required because libc++'s
+ // vector<bool>::const_reference is different from bool, and we want to avoid
+ // writing an extra specialization of ParamTraits for it.
for (size_t i = 0; i < p.size(); i++)
- WriteParam(m, p[i]);
+ WriteParam(m, static_cast<bool>(p[i]));
}
bool ParamTraits<std::vector<bool> >::Read(const Message* m,
@@ -429,7 +432,7 @@ void ParamTraits<std::vector<bool> >::Log(const param_type& p, std::string* l) {
for (size_t i = 0; i < p.size(); ++i) {
if (i != 0)
l->push_back(' ');
- LogParam((p[i]), l);
+ LogParam(static_cast<bool>(p[i]), l);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698