summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message_utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/ipc_message_utils.cc')
-rw-r--r--ipc/ipc_message_utils.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc
index 9664810..cc10cc2 100644
--- a/ipc/ipc_message_utils.cc
+++ b/ipc/ipc_message_utils.cc
@@ -250,6 +250,25 @@ void ParamTraits<base::Time>::Log(const param_type& p, std::string* l) {
ParamTraits<int64>::Log(p.ToInternalValue(), l);
}
+void ParamTraits<base::TimeDelta> ::Write(Message* m, const param_type& p) {
+ ParamTraits<int64> ::Write(m, p.InMicroseconds());
+}
+
+bool ParamTraits<base::TimeDelta> ::Read(const Message* m,
+ void** iter,
+ param_type* r) {
+ int64 value;
+ bool ret = ParamTraits<int64> ::Read(m, iter, &value);
+ if (ret)
+ *r = base::TimeDelta::FromMicroseconds(value);
+
+ return ret;
+}
+
+void ParamTraits<base::TimeDelta> ::Log(const param_type& p, std::string* l) {
+ ParamTraits<int64> ::Log(p.InMicroseconds(), l);
+}
+
void ParamTraits<DictionaryValue>::Write(Message* m, const param_type& p) {
WriteValue(m, &p, 0);
}