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

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

Issue 7237039: Remove PPBoolToBool and BoolToPPBool and use PP_FromBool and PP_ToBool instead. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_file_info.h" 9 #include "ppapi/c/pp_file_info.h"
10 #include "ppapi/c/pp_resource.h" 10 #include "ppapi/c/pp_resource.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 for (size_t i = 0; i < p.size(); i++) 71 for (size_t i = 0; i < p.size(); i++)
72 WriteParam(m, p[i]); 72 WriteParam(m, p[i]);
73 } 73 }
74 74
75 } // namespace 75 } // namespace
76 76
77 // PP_Bool --------------------------------------------------------------------- 77 // PP_Bool ---------------------------------------------------------------------
78 78
79 // static 79 // static
80 void ParamTraits<PP_Bool>::Write(Message* m, const param_type& p) { 80 void ParamTraits<PP_Bool>::Write(Message* m, const param_type& p) {
81 ParamTraits<bool>::Write(m, pp::proxy::PPBoolToBool(p)); 81 ParamTraits<bool>::Write(m, PP_ToBool(p));
82 } 82 }
83 83
84 // static 84 // static
85 bool ParamTraits<PP_Bool>::Read(const Message* m, void** iter, param_type* r) { 85 bool ParamTraits<PP_Bool>::Read(const Message* m, void** iter, param_type* r) {
86 // We specifically want to be strict here about what types of input we accept, 86 // We specifically want to be strict here about what types of input we accept,
87 // which ParamTraits<bool> does for us. We don't want to deserialize "2" into 87 // which ParamTraits<bool> does for us. We don't want to deserialize "2" into
88 // a PP_Bool, for example. 88 // a PP_Bool, for example.
89 bool result = false; 89 bool result = false;
90 if (!ParamTraits<bool>::Read(m, iter, &result)) 90 if (!ParamTraits<bool>::Read(m, iter, &result))
91 return false; 91 return false;
92 *r = pp::proxy::BoolToPPBool(result); 92 *r = PP_FromBool(result);
93 return true; 93 return true;
94 } 94 }
95 95
96 // static 96 // static
97 void ParamTraits<PP_Bool>::Log(const param_type& p, std::string* l) { 97 void ParamTraits<PP_Bool>::Log(const param_type& p, std::string* l) {
98 } 98 }
99 99
100 // PP_FileInfo ------------------------------------------------------------- 100 // PP_FileInfo -------------------------------------------------------------
101 101
102 // static 102 // static
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 param_type* r) { 501 param_type* r) {
502 return r->ReadFromMessage(m, iter); 502 return r->ReadFromMessage(m, iter);
503 } 503 }
504 504
505 // static 505 // static
506 void ParamTraits<pp::proxy::SerializedFlashMenu>::Log(const param_type& p, 506 void ParamTraits<pp::proxy::SerializedFlashMenu>::Log(const param_type& p,
507 std::string* l) { 507 std::string* l) {
508 } 508 }
509 509
510 } // namespace IPC 510 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698