Chromium Code Reviews| Index: content/common/cc_messages.cc |
| diff --git a/content/common/cc_messages.cc b/content/common/cc_messages.cc |
| index fef8ebcd4603893f7c79c89086fec777df23afe2..042be645972370b01f338950ae142810067f6cc7 100644 |
| --- a/content/common/cc_messages.cc |
| +++ b/content/common/cc_messages.cc |
| @@ -753,4 +753,40 @@ void ParamTraits<cc::DelegatedFrameData>::Log(const param_type& p, |
| l->append("])"); |
| } |
| +void ParamTraits<cc::SoftwareFrameData>::Write(Message* m, |
| + const param_type& p) { |
| + m->Reserve(sizeof(cc::SoftwareFrameData)); |
| + WriteParam(m, p.id); |
| + WriteParam(m, p.size); |
|
piman
2014/03/19 18:57:17
Do you want to add a DCHECK here?
danakj
2014/03/19 18:58:32
I did at first, but then the unit test is a death
|
| + WriteParam(m, p.damage_rect); |
| + WriteParam(m, p.handle); |
| +} |
| + |
| +bool ParamTraits<cc::SoftwareFrameData>::Read(const Message* m, |
| + PickleIterator* iter, |
| + param_type* p) { |
| + if (!ReadParam(m, iter, &p->id)) |
| + return false; |
| + if (!ReadParam(m, iter, &p->size) || !p->CheckedSizeInBytes().IsValid()) |
| + return false; |
| + if (!ReadParam(m, iter, &p->damage_rect)) |
| + return false; |
| + if (!ReadParam(m, iter, &p->handle)) |
| + return false; |
| + return true; |
| +} |
| + |
| +void ParamTraits<cc::SoftwareFrameData>::Log(const param_type& p, |
| + std::string* l) { |
| + l->append("SoftwareFrameData("); |
| + LogParam(p.id, l); |
| + l->append(", "); |
| + LogParam(p.size, l); |
| + l->append(", "); |
| + LogParam(p.damage_rect, l); |
| + l->append(", "); |
| + LogParam(p.handle, l); |
| + l->append(")"); |
| +} |
| + |
| } // namespace IPC |