Chromium Code Reviews| Index: content/public/common/common_param_traits.cc |
| diff --git a/content/public/common/common_param_traits.cc b/content/public/common/common_param_traits.cc |
| index 95658659ca8f026ecd43fa9ed2d0ecfa92eba5ac..dde1015a0d4bf3dbb35783259dddb5909b0d0f30 100644 |
| --- a/content/public/common/common_param_traits.cc |
| +++ b/content/public/common/common_param_traits.cc |
| @@ -151,6 +151,26 @@ void ParamTraits<gfx::Size>::Log(const gfx::Size& p, std::string* l) { |
| l->append(base::StringPrintf("(%d, %d)", p.width(), p.height())); |
| } |
| +void ParamTraits<gfx::Vector2d>::Write(Message* m, const gfx::Vector2d& v) { |
| + m->WriteInt(v.x()); |
| + m->WriteInt(v.y()); |
| +} |
| + |
| +bool ParamTraits<gfx::Vector2d>::Read(const Message* m, PickleIterator* iter, |
| + gfx::Vector2d* r) { |
|
piman
2012/10/31 18:07:23
nit: indentation
Peter Kasting
2012/10/31 18:09:28
Also, one arg per line if they don't all fit on on
|
| + int x, y; |
| + if (!m->ReadInt(iter, &x) || |
| + !m->ReadInt(iter, &y)) |
| + return false; |
| + r->set_x(x); |
| + r->set_y(y); |
| + return true; |
| +} |
| + |
| +void ParamTraits<gfx::Vector2d>::Log(const gfx::Vector2d& v, std::string* l) { |
| + l->append(base::StringPrintf("(%d, %d)", v.x(), v.y())); |
| +} |
| + |
| void ParamTraits<gfx::Rect>::Write(Message* m, const gfx::Rect& p) { |
| m->WriteInt(p.x()); |
| m->WriteInt(p.y()); |