| 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 #include "ipc/ipc_message_utils.h" | 5 #include "ipc/ipc_message_utils.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/nullable_string16.h" | 10 #include "base/nullable_string16.h" |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 void ParamTraits<base::FileDescriptor>::Log(const param_type& p, | 481 void ParamTraits<base::FileDescriptor>::Log(const param_type& p, |
| 482 std::string* l) { | 482 std::string* l) { |
| 483 if (p.auto_close) { | 483 if (p.auto_close) { |
| 484 l->append(StringPrintf("FD(%d auto-close)", p.fd)); | 484 l->append(StringPrintf("FD(%d auto-close)", p.fd)); |
| 485 } else { | 485 } else { |
| 486 l->append(StringPrintf("FD(%d)", p.fd)); | 486 l->append(StringPrintf("FD(%d)", p.fd)); |
| 487 } | 487 } |
| 488 } | 488 } |
| 489 #endif // defined(OS_POSIX) | 489 #endif // defined(OS_POSIX) |
| 490 | 490 |
| 491 void ParamTraits<FilePath>::Write(Message* m, const param_type& p) { | 491 void ParamTraits<base::FilePath>::Write(Message* m, const param_type& p) { |
| 492 p.WriteToPickle(m); | 492 p.WriteToPickle(m); |
| 493 } | 493 } |
| 494 | 494 |
| 495 bool ParamTraits<FilePath>::Read(const Message* m, | 495 bool ParamTraits<base::FilePath>::Read(const Message* m, |
| 496 PickleIterator* iter, | 496 PickleIterator* iter, |
| 497 param_type* r) { | 497 param_type* r) { |
| 498 return r->ReadFromPickle(iter); | 498 return r->ReadFromPickle(iter); |
| 499 } | 499 } |
| 500 | 500 |
| 501 void ParamTraits<FilePath>::Log(const param_type& p, std::string* l) { | 501 void ParamTraits<base::FilePath>::Log(const param_type& p, std::string* l) { |
| 502 ParamTraits<FilePath::StringType>::Log(p.value(), l); | 502 ParamTraits<base::FilePath::StringType>::Log(p.value(), l); |
| 503 } | 503 } |
| 504 | 504 |
| 505 void ParamTraits<ListValue>::Write(Message* m, const param_type& p) { | 505 void ParamTraits<ListValue>::Write(Message* m, const param_type& p) { |
| 506 WriteValue(m, &p, 0); | 506 WriteValue(m, &p, 0); |
| 507 } | 507 } |
| 508 | 508 |
| 509 bool ParamTraits<ListValue>::Read( | 509 bool ParamTraits<ListValue>::Read( |
| 510 const Message* m, PickleIterator* iter, param_type* r) { | 510 const Message* m, PickleIterator* iter, param_type* r) { |
| 511 int type; | 511 int type; |
| 512 if (!ReadParam(m, iter, &type) || type != Value::TYPE_LIST) | 512 if (!ReadParam(m, iter, &type) || type != Value::TYPE_LIST) |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 return result; | 814 return result; |
| 815 } | 815 } |
| 816 | 816 |
| 817 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 817 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
| 818 l->append("<MSG>"); | 818 l->append("<MSG>"); |
| 819 } | 819 } |
| 820 | 820 |
| 821 #endif // OS_WIN | 821 #endif // OS_WIN |
| 822 | 822 |
| 823 } // namespace IPC | 823 } // namespace IPC |
| OLD | NEW |