OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/proxy/ppapi_param_traits.h" | 5 #include "ppapi/proxy/ppapi_param_traits.h" |
6 | 6 |
7 #include <string.h> // For memcpy | 7 #include <string.h> // For memcpy |
8 | 8 |
9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 // No default so the compiler will warn on new types. | 626 // No default so the compiler will warn on new types. |
627 } | 627 } |
628 return false; | 628 return false; |
629 } | 629 } |
630 | 630 |
631 // static | 631 // static |
632 void ParamTraits<ppapi::SocketOptionData>::Log(const param_type& p, | 632 void ParamTraits<ppapi::SocketOptionData>::Log(const param_type& p, |
633 std::string* l) { | 633 std::string* l) { |
634 } | 634 } |
635 | 635 |
| 636 // ppapi::MediaStreamVideoTrack::Attributes ------------------------------------ |
| 637 |
| 638 // static |
| 639 void ParamTraits<ppapi::MediaStreamVideoTrackShared::Attributes>::Write( |
| 640 Message* m, |
| 641 const param_type& p) { |
| 642 ParamTraits<uint32_t>::Write(m, p.mask); |
| 643 ParamTraits<int32_t>::Write(m, p.buffers); |
| 644 ParamTraits<int32_t>::Write(m, p.width); |
| 645 ParamTraits<int32_t>::Write(m, p.height); |
| 646 ParamTraits<int32_t>::Write(m, static_cast<int32_t>(p.format)); |
| 647 } |
| 648 |
| 649 // static |
| 650 bool ParamTraits<ppapi::MediaStreamVideoTrackShared::Attributes>::Read( |
| 651 const Message* m, |
| 652 PickleIterator* iter, |
| 653 param_type* r) { |
| 654 if (!ParamTraits<uint32_t>::Read(m, iter, &(r->mask))) |
| 655 return false; |
| 656 if (!ParamTraits<int32_t>::Read(m, iter, &(r->buffers))) |
| 657 return false; |
| 658 if (!ParamTraits<int32_t>::Read(m, iter, &(r->width))) |
| 659 return false; |
| 660 if (!ParamTraits<int32_t>::Read(m, iter, &(r->height))) |
| 661 return false; |
| 662 int32_t value = 0; |
| 663 if (!ParamTraits<int32_t>::Read(m, iter, &value)) |
| 664 return false; |
| 665 r->format = static_cast<PP_VideoFrame_Format>(value); |
| 666 return true; |
| 667 } |
| 668 |
| 669 // static |
| 670 void ParamTraits<ppapi::MediaStreamVideoTrackShared::Attributes>::Log( |
| 671 const param_type& p, |
| 672 std::string* l) { |
| 673 } |
636 } // namespace IPC | 674 } // namespace IPC |
OLD | NEW |