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

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

Issue 1548813002: Switch to standard integer types in ppapi/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 5 years 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') | ppapi/proxy/ppapi_proxy_test.h » ('j') | 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>
8 #include <stdint.h>
7 #include <string.h> // For memcpy 9 #include <string.h> // For memcpy
8 10
11 #include "base/macros.h"
12 #include "build/build_config.h"
9 #include "ppapi/c/pp_resource.h" 13 #include "ppapi/c/pp_resource.h"
10 #include "ppapi/proxy/ppapi_messages.h" 14 #include "ppapi/proxy/ppapi_messages.h"
15 #include "ppapi/proxy/serialized_flash_menu.h"
11 #include "ppapi/proxy/serialized_var.h" 16 #include "ppapi/proxy/serialized_var.h"
12 #include "ppapi/proxy/serialized_flash_menu.h"
13 #include "ppapi/shared_impl/host_resource.h" 17 #include "ppapi/shared_impl/host_resource.h"
14 #include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h" 18 #include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h"
15 19
16 namespace IPC { 20 namespace IPC {
17 21
18 namespace { 22 namespace {
19 23
20 // Deserializes a vector from IPC. This special version must be used instead 24 // Deserializes a vector from IPC. This special version must be used instead
21 // of the default IPC version when the vector contains a SerializedVar, either 25 // of the default IPC version when the vector contains a SerializedVar, either
22 // directly or indirectly (i.e. a vector of objects that have a SerializedVar 26 // directly or indirectly (i.e. a vector of objects that have a SerializedVar
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 void ParamTraits<PP_NetAddress_Private>::Write(Message* m, 153 void ParamTraits<PP_NetAddress_Private>::Write(Message* m,
150 const param_type& p) { 154 const param_type& p) {
151 WriteParam(m, p.size); 155 WriteParam(m, p.size);
152 m->WriteBytes(p.data, static_cast<int>(p.size)); 156 m->WriteBytes(p.data, static_cast<int>(p.size));
153 } 157 }
154 158
155 // static 159 // static
156 bool ParamTraits<PP_NetAddress_Private>::Read(const Message* m, 160 bool ParamTraits<PP_NetAddress_Private>::Read(const Message* m,
157 base::PickleIterator* iter, 161 base::PickleIterator* iter,
158 param_type* p) { 162 param_type* p) {
159 uint16 size; 163 uint16_t size;
160 if (!ReadParam(m, iter, &size)) 164 if (!ReadParam(m, iter, &size))
161 return false; 165 return false;
162 if (size > sizeof(p->data)) 166 if (size > sizeof(p->data))
163 return false; 167 return false;
164 p->size = size; 168 p->size = size;
165 169
166 const char* data; 170 const char* data;
167 if (!iter->ReadBytes(&data, size)) 171 if (!iter->ReadBytes(&data, size))
168 return false; 172 return false;
169 memcpy(p->data, data, size); 173 memcpy(p->data, data, size);
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 } 692 }
689 return true; 693 return true;
690 } 694 }
691 695
692 void ParamTraits<ppapi::CompositorLayerData::Transform>::Log( 696 void ParamTraits<ppapi::CompositorLayerData::Transform>::Log(
693 const param_type& p, 697 const param_type& p,
694 std::string* l) { 698 std::string* l) {
695 } 699 }
696 700
697 } // namespace IPC 701 } // namespace IPC
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_param_traits.h ('k') | ppapi/proxy/ppapi_proxy_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698