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

Unified Diff: ipc/ipc_message_utils.cc

Issue 1418743006: ipc: Add ParamTraits<signed char> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Change ordering Created 5 years, 2 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_utils.h ('k') | 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 0180d743a26a3d90010c758f3c2debb567c6a82f..26edc126313a2dbe5d8efa3855cfc2f33056765f 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -274,6 +274,24 @@ void ParamTraits<bool>::Log(const param_type& p, std::string* l) {
l->append(p ? "true" : "false");
}
+void ParamTraits<signed char>::Write(Message* m, const param_type& p) {
+ m->WriteBytes(&p, sizeof(param_type));
+}
+
+bool ParamTraits<signed char>::Read(const Message* m,
+ base::PickleIterator* iter,
+ param_type* r) {
+ const char* data;
+ if (!iter->ReadBytes(&data, sizeof(param_type)))
+ return false;
+ memcpy(r, data, sizeof(param_type));
+ return true;
+}
+
+void ParamTraits<signed char>::Log(const param_type& p, std::string* l) {
+ l->append(base::IntToString(p));
+}
+
void ParamTraits<unsigned char>::Write(Message* m, const param_type& p) {
m->WriteBytes(&p, sizeof(param_type));
}
« no previous file with comments | « ipc/ipc_message_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698