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 #ifndef IPC_IPC_MESSAGE_UTILS_H_ | 5 #ifndef IPC_IPC_MESSAGE_UTILS_H_ |
6 #define IPC_IPC_MESSAGE_UTILS_H_ | 6 #define IPC_IPC_MESSAGE_UTILS_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 namespace base { | 50 namespace base { |
51 class DictionaryValue; | 51 class DictionaryValue; |
52 class FilePath; | 52 class FilePath; |
53 class ListValue; | 53 class ListValue; |
54 class NullableString16; | 54 class NullableString16; |
55 class Time; | 55 class Time; |
56 class TimeDelta; | 56 class TimeDelta; |
57 class TimeTicks; | 57 class TimeTicks; |
58 class TraceTicks; | 58 class TraceTicks; |
59 struct FileDescriptor; | 59 struct FileDescriptor; |
| 60 |
| 61 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 62 class SharedMemoryHandle; |
| 63 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
60 } | 64 } |
61 | 65 |
62 namespace IPC { | 66 namespace IPC { |
63 | 67 |
64 struct ChannelHandle; | 68 struct ChannelHandle; |
65 | 69 |
66 // ----------------------------------------------------------------------------- | 70 // ----------------------------------------------------------------------------- |
67 // How we send IPC message logs across channels. | 71 // How we send IPC message logs across channels. |
68 struct IPC_EXPORT LogData { | 72 struct IPC_EXPORT LogData { |
69 LogData(); | 73 LogData(); |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 struct IPC_EXPORT ParamTraits<base::FileDescriptor> { | 464 struct IPC_EXPORT ParamTraits<base::FileDescriptor> { |
461 typedef base::FileDescriptor param_type; | 465 typedef base::FileDescriptor param_type; |
462 static void Write(Message* m, const param_type& p); | 466 static void Write(Message* m, const param_type& p); |
463 static bool Read(const Message* m, | 467 static bool Read(const Message* m, |
464 base::PickleIterator* iter, | 468 base::PickleIterator* iter, |
465 param_type* r); | 469 param_type* r); |
466 static void Log(const param_type& p, std::string* l); | 470 static void Log(const param_type& p, std::string* l); |
467 }; | 471 }; |
468 #endif // defined(OS_POSIX) | 472 #endif // defined(OS_POSIX) |
469 | 473 |
| 474 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 475 template <> |
| 476 struct IPC_EXPORT ParamTraits<base::SharedMemoryHandle> { |
| 477 typedef base::SharedMemoryHandle param_type; |
| 478 static void Write(Message* m, const param_type& p); |
| 479 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); |
| 480 static void Log(const param_type& p, std::string* l); |
| 481 }; |
| 482 #endif |
| 483 |
470 template <> | 484 template <> |
471 struct IPC_EXPORT ParamTraits<base::FilePath> { | 485 struct IPC_EXPORT ParamTraits<base::FilePath> { |
472 typedef base::FilePath param_type; | 486 typedef base::FilePath param_type; |
473 static void Write(Message* m, const param_type& p); | 487 static void Write(Message* m, const param_type& p); |
474 static bool Read(const Message* m, | 488 static bool Read(const Message* m, |
475 base::PickleIterator* iter, | 489 base::PickleIterator* iter, |
476 param_type* r); | 490 param_type* r); |
477 static void Log(const param_type& p, std::string* l); | 491 static void Log(const param_type& p, std::string* l); |
478 }; | 492 }; |
479 | 493 |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 template <typename... Ts> | 1010 template <typename... Ts> |
997 static void WriteReplyParams(Message* reply, Ts... args) { | 1011 static void WriteReplyParams(Message* reply, Ts... args) { |
998 ReplyParam p(args...); | 1012 ReplyParam p(args...); |
999 WriteParam(reply, p); | 1013 WriteParam(reply, p); |
1000 } | 1014 } |
1001 }; | 1015 }; |
1002 | 1016 |
1003 } // namespace IPC | 1017 } // namespace IPC |
1004 | 1018 |
1005 #endif // IPC_IPC_MESSAGE_UTILS_H_ | 1019 #endif // IPC_IPC_MESSAGE_UTILS_H_ |
OLD | NEW |