Chromium Code Reviews| 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..092308edd4ce386a9ef8ca576b2055dd13033bad 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, |
|
no sievers
2013/03/04 18:27:41
nit: alignment
piman
2013/03/04 18:52:05
Thanks, fixed.
|
| + 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 |