Index: gpu/ipc/gpu_command_buffer_traits.cc |
diff --git a/gpu/ipc/gpu_command_buffer_traits.cc b/gpu/ipc/gpu_command_buffer_traits.cc |
index b502b0fd1bb4c36660fbc2cd21d2a9fe38913b0b..d9fc17d166070026a45c915f5a68b5b6ff5227c2 100644 |
--- a/gpu/ipc/gpu_command_buffer_traits.cc |
+++ b/gpu/ipc/gpu_command_buffer_traits.cc |
@@ -3,6 +3,7 @@ |
// found in the LICENSE file. |
#include "gpu/ipc/gpu_command_buffer_traits.h" |
+#include "gpu/command_buffer/common/mailbox.h" |
namespace IPC { |
@@ -38,4 +39,25 @@ void ParamTraits<gpu::CommandBuffer::State> ::Log(const param_type& p, |
l->append("<CommandBuffer::State>"); |
} |
+void ParamTraits<gpu::Mailbox>::Write(Message* m, const param_type& p) { |
+ m->WriteBytes(p.name, sizeof(p.name)); |
+} |
+ |
+bool ParamTraits<gpu::Mailbox>::Read(const Message* m, |
+ PickleIterator* iter, |
+ param_type* p) { |
+ const char* bytes = NULL; |
+ if (!m->ReadBytes(iter, &bytes, sizeof(p->name))) |
+ return false; |
+ DCHECK(bytes); |
+ memcpy(p->name, bytes, sizeof(p->name)); |
+ return true; |
+} |
+ |
+void ParamTraits<gpu::Mailbox>::Log(const param_type& p, std::string* l) { |
+ for (size_t i = 0; i < sizeof(p.name); ++i) |
+ *l += base::StringPrintf("%02x", p.name[i]); |
+} |
+ |
+ |
} // namespace IPC |