Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: ppapi/proxy/ppapi_param_traits.cc

Issue 2686503004: Add IPC ParamTraits for c-style arrays (Closed)
Patch Set: nit Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/proxy/ppapi_param_traits.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> // For memcpy 9 #include <string.h> // For memcpy
10 10
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 // No default so the compiler will warn on new types. 691 // No default so the compiler will warn on new types.
692 } 692 }
693 return false; 693 return false;
694 } 694 }
695 695
696 // static 696 // static
697 void ParamTraits<ppapi::SocketOptionData>::Log(const param_type& p, 697 void ParamTraits<ppapi::SocketOptionData>::Log(const param_type& p,
698 std::string* l) { 698 std::string* l) {
699 } 699 }
700 700
701 // ppapi::CompositorLayerData --------------------------------------------------
702
703 // static
704 void ParamTraits<ppapi::CompositorLayerData::Transform>::GetSize(
705 base::PickleSizer* s, const param_type& p) {
706 for (size_t i = 0; i < arraysize(p.matrix); i++)
707 GetParamSize(s, p.matrix[i]);
708 }
709
710 // static
711 void ParamTraits<ppapi::CompositorLayerData::Transform>::Write(
712 base::Pickle* m,
713 const param_type& p) {
714 for (size_t i = 0; i < arraysize(p.matrix); i++)
715 WriteParam(m, p.matrix[i]);
716 }
717
718 // static
719 bool ParamTraits<ppapi::CompositorLayerData::Transform>::Read(
720 const base::Pickle* m,
721 base::PickleIterator* iter,
722 param_type* r) {
723 for (size_t i = 0; i < arraysize(r->matrix);i++) {
724 if (!ReadParam(m, iter, &r->matrix[i]))
725 return false;
726 }
727 return true;
728 }
729
730 void ParamTraits<ppapi::CompositorLayerData::Transform>::Log(
731 const param_type& p,
732 std::string* l) {
733 }
734
735 } // namespace IPC 701 } // namespace IPC
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_param_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698