OLD | NEW |
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 // NOTE: New trait definitions that will be used by Chrome Frame must be placed | 5 // NOTE: New trait definitions that will be used by Chrome Frame must be placed |
6 // in common_param_traits2.cc. | 6 // in common_param_traits2.cc. |
7 | 7 |
8 #include "content/common/webkit_param_traits.h" | 8 #include "content/common/webkit_param_traits.h" |
9 | 9 |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 (r->type == NPVARIANT_PARAM_NULL)) { | 295 (r->type == NPVARIANT_PARAM_NULL)) { |
296 result = true; | 296 result = true; |
297 } else { | 297 } else { |
298 NOTREACHED(); | 298 NOTREACHED(); |
299 } | 299 } |
300 | 300 |
301 return result; | 301 return result; |
302 } | 302 } |
303 | 303 |
304 void ParamTraits<NPVariant_Param>::Log(const param_type& p, std::string* l) { | 304 void ParamTraits<NPVariant_Param>::Log(const param_type& p, std::string* l) { |
| 305 l->append(StringPrintf("NPVariant_Param(%d, ", static_cast<int>(p.type))); |
305 if (p.type == NPVARIANT_PARAM_BOOL) { | 306 if (p.type == NPVARIANT_PARAM_BOOL) { |
306 LogParam(p.bool_value, l); | 307 LogParam(p.bool_value, l); |
307 } else if (p.type == NPVARIANT_PARAM_INT) { | 308 } else if (p.type == NPVARIANT_PARAM_INT) { |
308 LogParam(p.int_value, l); | 309 LogParam(p.int_value, l); |
309 } else if (p.type == NPVARIANT_PARAM_DOUBLE) { | 310 } else if (p.type == NPVARIANT_PARAM_DOUBLE) { |
310 LogParam(p.double_value, l); | 311 LogParam(p.double_value, l); |
311 } else if (p.type == NPVARIANT_PARAM_STRING) { | 312 } else if (p.type == NPVARIANT_PARAM_STRING) { |
312 LogParam(p.string_value, l); | 313 LogParam(p.string_value, l); |
313 } else if (p.type == NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID || | 314 } else if (p.type == NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID || |
314 p.type == NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID) { | 315 p.type == NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID) { |
315 LogParam(p.npobject_routing_id, l); | 316 LogParam(p.npobject_routing_id, l); |
| 317 } else { |
| 318 l->append("<none>"); |
316 } | 319 } |
| 320 l->append(")"); |
317 } | 321 } |
318 | 322 |
319 void ParamTraits<NPIdentifier_Param>::Write(Message* m, const param_type& p) { | 323 void ParamTraits<NPIdentifier_Param>::Write(Message* m, const param_type& p) { |
320 webkit_glue::SerializeNPIdentifier(p.identifier, m); | 324 webkit_glue::SerializeNPIdentifier(p.identifier, m); |
321 } | 325 } |
322 | 326 |
323 bool ParamTraits<NPIdentifier_Param>::Read(const Message* m, | 327 bool ParamTraits<NPIdentifier_Param>::Read(const Message* m, |
324 void** iter, | 328 void** iter, |
325 param_type* r) { | 329 param_type* r) { |
326 return webkit_glue::DeserializeNPIdentifier(*m, iter, &r->identifier); | 330 return webkit_glue::DeserializeNPIdentifier(*m, iter, &r->identifier); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 ReadParam(m, iter, &p->ssl_valid) && | 374 ReadParam(m, iter, &p->ssl_valid) && |
371 ReadParam(m, iter, &p->preferred) && | 375 ReadParam(m, iter, &p->preferred) && |
372 ReadParam(m, iter, &p->blacklisted_by_user); | 376 ReadParam(m, iter, &p->blacklisted_by_user); |
373 } | 377 } |
374 void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p, | 378 void ParamTraits<webkit_glue::PasswordForm>::Log(const param_type& p, |
375 std::string* l) { | 379 std::string* l) { |
376 l->append("<PasswordForm>"); | 380 l->append("<PasswordForm>"); |
377 } | 381 } |
378 | 382 |
379 } // namespace IPC | 383 } // namespace IPC |
OLD | NEW |