| 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 // This file is used to define IPC::ParamTraits<> specializations for a number | 5 // This file is used to define IPC::ParamTraits<> specializations for a number |
| 6 // of types so that they can be serialized over IPC. IPC::ParamTraits<> | 6 // of types so that they can be serialized over IPC. IPC::ParamTraits<> |
| 7 // specializations for basic types (like int and std::string) and types in the | 7 // specializations for basic types (like int and std::string) and types in the |
| 8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains | 8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains |
| 9 // specializations for types that are used by the content code, and which need | 9 // specializations for types that are used by the content code, and which need |
| 10 // manual serialization code. This is usually because they're not structs with | 10 // manual serialization code. This is usually because they're not structs with |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 static void Log(const param_type& p, std::string* l) { | 177 static void Log(const param_type& p, std::string* l) { |
| 178 l->append("TransportDIB("); | 178 l->append("TransportDIB("); |
| 179 LogParam(p.handle, l); | 179 LogParam(p.handle, l); |
| 180 l->append(", "); | 180 l->append(", "); |
| 181 LogParam(p.sequence_num, l); | 181 LogParam(p.sequence_num, l); |
| 182 l->append(")"); | 182 l->append(")"); |
| 183 } | 183 } |
| 184 }; | 184 }; |
| 185 #endif | 185 #endif |
| 186 | 186 |
| 187 #if defined(USE_X11) | 187 #if defined(TOOLKIT_GTK) |
| 188 template<> | 188 template<> |
| 189 struct ParamTraits<TransportDIB::Id> { | 189 struct ParamTraits<TransportDIB::Id> { |
| 190 typedef TransportDIB::Id param_type; | 190 typedef TransportDIB::Id param_type; |
| 191 static void Write(Message* m, const param_type& p) { | 191 static void Write(Message* m, const param_type& p) { |
| 192 WriteParam(m, p.shmkey); | 192 WriteParam(m, p.shmkey); |
| 193 } | 193 } |
| 194 static bool Read(const Message* m, PickleIterator* iter, param_type* r) { | 194 static bool Read(const Message* m, PickleIterator* iter, param_type* r) { |
| 195 return ReadParam(m, iter, &r->shmkey); | 195 return ReadParam(m, iter, &r->shmkey); |
| 196 } | 196 } |
| 197 static void Log(const param_type& p, std::string* l) { | 197 static void Log(const param_type& p, std::string* l) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 210 // Note: This function expects parameter |r| to be of type &SkBitmap since | 210 // Note: This function expects parameter |r| to be of type &SkBitmap since |
| 211 // r->SetConfig() and r->SetPixels() are called. | 211 // r->SetConfig() and r->SetPixels() are called. |
| 212 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 212 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 213 | 213 |
| 214 static void Log(const param_type& p, std::string* l); | 214 static void Log(const param_type& p, std::string* l); |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 } // namespace IPC | 217 } // namespace IPC |
| 218 | 218 |
| 219 #endif // CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_ | 219 #endif // CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_ |
| OLD | NEW |