| 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/files/file_path.h" | 7 #include "base/files/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/strings/nullable_string16.h" | 10 #include "base/strings/nullable_string16.h" |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 if (ret) | 653 if (ret) |
| 654 *r = base::TimeTicks::FromInternalValue(value); | 654 *r = base::TimeTicks::FromInternalValue(value); |
| 655 | 655 |
| 656 return ret; | 656 return ret; |
| 657 } | 657 } |
| 658 | 658 |
| 659 void ParamTraits<base::TimeTicks>::Log(const param_type& p, std::string* l) { | 659 void ParamTraits<base::TimeTicks>::Log(const param_type& p, std::string* l) { |
| 660 ParamTraits<int64>::Log(p.ToInternalValue(), l); | 660 ParamTraits<int64>::Log(p.ToInternalValue(), l); |
| 661 } | 661 } |
| 662 | 662 |
| 663 void ParamTraits<base::TraceTicks>::Write(Message* m, const param_type& p) { |
| 664 ParamTraits<int64>::Write(m, p.ToInternalValue()); |
| 665 } |
| 666 |
| 667 bool ParamTraits<base::TraceTicks>::Read(const Message* m, |
| 668 PickleIterator* iter, |
| 669 param_type* r) { |
| 670 int64 value; |
| 671 bool ret = ParamTraits<int64>::Read(m, iter, &value); |
| 672 if (ret) |
| 673 *r = base::TraceTicks::FromInternalValue(value); |
| 674 |
| 675 return ret; |
| 676 } |
| 677 |
| 678 void ParamTraits<base::TraceTicks>::Log(const param_type& p, std::string* l) { |
| 679 ParamTraits<int64>::Log(p.ToInternalValue(), l); |
| 680 } |
| 681 |
| 663 void ParamTraits<IPC::ChannelHandle>::Write(Message* m, const param_type& p) { | 682 void ParamTraits<IPC::ChannelHandle>::Write(Message* m, const param_type& p) { |
| 664 #if defined(OS_WIN) | 683 #if defined(OS_WIN) |
| 665 // On Windows marshalling pipe handle is not supported. | 684 // On Windows marshalling pipe handle is not supported. |
| 666 DCHECK(p.pipe.handle == NULL); | 685 DCHECK(p.pipe.handle == NULL); |
| 667 #endif // defined (OS_WIN) | 686 #endif // defined (OS_WIN) |
| 668 WriteParam(m, p.name); | 687 WriteParam(m, p.name); |
| 669 #if defined(OS_POSIX) | 688 #if defined(OS_POSIX) |
| 670 WriteParam(m, p.socket); | 689 WriteParam(m, p.socket); |
| 671 #endif | 690 #endif |
| 672 } | 691 } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 return result; | 848 return result; |
| 830 } | 849 } |
| 831 | 850 |
| 832 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 851 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
| 833 l->append("<MSG>"); | 852 l->append("<MSG>"); |
| 834 } | 853 } |
| 835 | 854 |
| 836 #endif // OS_WIN | 855 #endif // OS_WIN |
| 837 | 856 |
| 838 } // namespace IPC | 857 } // namespace IPC |
| OLD | NEW |