| 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) | |
| 64 } | 60 } |
| 65 | 61 |
| 66 namespace IPC { | 62 namespace IPC { |
| 67 | 63 |
| 68 struct ChannelHandle; | 64 struct ChannelHandle; |
| 69 | 65 |
| 70 // ----------------------------------------------------------------------------- | 66 // ----------------------------------------------------------------------------- |
| 71 // How we send IPC message logs across channels. | 67 // How we send IPC message logs across channels. |
| 72 struct IPC_EXPORT LogData { | 68 struct IPC_EXPORT LogData { |
| 73 LogData(); | 69 LogData(); |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 struct IPC_EXPORT ParamTraits<base::FileDescriptor> { | 460 struct IPC_EXPORT ParamTraits<base::FileDescriptor> { |
| 465 typedef base::FileDescriptor param_type; | 461 typedef base::FileDescriptor param_type; |
| 466 static void Write(Message* m, const param_type& p); | 462 static void Write(Message* m, const param_type& p); |
| 467 static bool Read(const Message* m, | 463 static bool Read(const Message* m, |
| 468 base::PickleIterator* iter, | 464 base::PickleIterator* iter, |
| 469 param_type* r); | 465 param_type* r); |
| 470 static void Log(const param_type& p, std::string* l); | 466 static void Log(const param_type& p, std::string* l); |
| 471 }; | 467 }; |
| 472 #endif // defined(OS_POSIX) | 468 #endif // defined(OS_POSIX) |
| 473 | 469 |
| 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 | |
| 484 template <> | 470 template <> |
| 485 struct IPC_EXPORT ParamTraits<base::FilePath> { | 471 struct IPC_EXPORT ParamTraits<base::FilePath> { |
| 486 typedef base::FilePath param_type; | 472 typedef base::FilePath param_type; |
| 487 static void Write(Message* m, const param_type& p); | 473 static void Write(Message* m, const param_type& p); |
| 488 static bool Read(const Message* m, | 474 static bool Read(const Message* m, |
| 489 base::PickleIterator* iter, | 475 base::PickleIterator* iter, |
| 490 param_type* r); | 476 param_type* r); |
| 491 static void Log(const param_type& p, std::string* l); | 477 static void Log(const param_type& p, std::string* l); |
| 492 }; | 478 }; |
| 493 | 479 |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 template <typename... Ts> | 996 template <typename... Ts> |
| 1011 static void WriteReplyParams(Message* reply, Ts... args) { | 997 static void WriteReplyParams(Message* reply, Ts... args) { |
| 1012 ReplyParam p(args...); | 998 ReplyParam p(args...); |
| 1013 WriteParam(reply, p); | 999 WriteParam(reply, p); |
| 1014 } | 1000 } |
| 1015 }; | 1001 }; |
| 1016 | 1002 |
| 1017 } // namespace IPC | 1003 } // namespace IPC |
| 1018 | 1004 |
| 1019 #endif // IPC_IPC_MESSAGE_UTILS_H_ | 1005 #endif // IPC_IPC_MESSAGE_UTILS_H_ |
| OLD | NEW |