OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_COMMON_IPC_MESSAGE_UTILS_H_ | 5 #ifndef CHROME_COMMON_IPC_MESSAGE_UTILS_H_ |
6 #define CHROME_COMMON_IPC_MESSAGE_UTILS_H_ | 6 #define CHROME_COMMON_IPC_MESSAGE_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 #include <map> | 10 #include <map> |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 } | 683 } |
684 static void Log(const param_type& p, std::wstring* l) { | 684 static void Log(const param_type& p, std::wstring* l) { |
685 if (p.auto_close) { | 685 if (p.auto_close) { |
686 l->append(StringPrintf(L"FD(%d auto-close)", p.fd)); | 686 l->append(StringPrintf(L"FD(%d auto-close)", p.fd)); |
687 } else { | 687 } else { |
688 l->append(StringPrintf(L"FD(%d)", p.fd)); | 688 l->append(StringPrintf(L"FD(%d)", p.fd)); |
689 } | 689 } |
690 } | 690 } |
691 }; | 691 }; |
692 | 692 |
| 693 template <> |
| 694 struct ParamTraits<string16> { |
| 695 typedef string16 param_type; |
| 696 static void Write(Message* m, const param_type& p) { |
| 697 m->WriteString16(p); |
| 698 } |
| 699 static bool Read(const Message* m, void** iter, param_type* r) { |
| 700 return m->ReadString16(iter, r); |
| 701 } |
| 702 static void Log(const param_type& p, std::wstring* l) { |
| 703 l->append(UTF16ToWide(p)); |
| 704 } |
| 705 }; |
| 706 |
693 #endif // defined(OS_POSIX) | 707 #endif // defined(OS_POSIX) |
694 | 708 |
695 template<> | 709 template<> |
696 struct ParamTraits<ThumbnailScore> { | 710 struct ParamTraits<ThumbnailScore> { |
697 typedef ThumbnailScore param_type; | 711 typedef ThumbnailScore param_type; |
698 static void Write(Message* m, const param_type& p) { | 712 static void Write(Message* m, const param_type& p) { |
699 IPC::ParamTraits<double>::Write(m, p.boring_score); | 713 IPC::ParamTraits<double>::Write(m, p.boring_score); |
700 IPC::ParamTraits<bool>::Write(m, p.good_clipping); | 714 IPC::ParamTraits<bool>::Write(m, p.good_clipping); |
701 IPC::ParamTraits<bool>::Write(m, p.at_top); | 715 IPC::ParamTraits<bool>::Write(m, p.at_top); |
702 IPC::ParamTraits<base::Time>::Write(m, p.time_at_snapshot); | 716 IPC::ParamTraits<base::Time>::Write(m, p.time_at_snapshot); |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 l->append(L"<FindInPageRequest>"); | 1454 l->append(L"<FindInPageRequest>"); |
1441 } | 1455 } |
1442 }; | 1456 }; |
1443 | 1457 |
1444 //----------------------------------------------------------------------------- | 1458 //----------------------------------------------------------------------------- |
1445 | 1459 |
1446 } // namespace IPC | 1460 } // namespace IPC |
1447 | 1461 |
1448 #endif // CHROME_COMMON_IPC_MESSAGE_UTILS_H_ | 1462 #endif // CHROME_COMMON_IPC_MESSAGE_UTILS_H_ |
1449 | 1463 |
OLD | NEW |