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 <limits.h> | 8 #include <limits.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "build/build_config.h" | 30 #include "build/build_config.h" |
31 #include "ipc/ipc_message_start.h" | 31 #include "ipc/ipc_message_start.h" |
32 #include "ipc/ipc_param_traits.h" | 32 #include "ipc/ipc_param_traits.h" |
33 #include "ipc/ipc_sync_message.h" | 33 #include "ipc/ipc_sync_message.h" |
34 | 34 |
35 namespace base { | 35 namespace base { |
36 class DictionaryValue; | 36 class DictionaryValue; |
37 class FilePath; | 37 class FilePath; |
38 class ListValue; | 38 class ListValue; |
39 class NullableString16; | 39 class NullableString16; |
| 40 class SharedMemoryHandle; |
40 class Time; | 41 class Time; |
41 class TimeDelta; | 42 class TimeDelta; |
42 class TimeTicks; | 43 class TimeTicks; |
43 class UnguessableToken; | 44 class UnguessableToken; |
44 struct FileDescriptor; | 45 struct FileDescriptor; |
45 | |
46 #if (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN) | |
47 class SharedMemoryHandle; | |
48 #endif // (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN) | |
49 } | 46 } |
50 | 47 |
51 namespace IPC { | 48 namespace IPC { |
52 | 49 |
53 struct ChannelHandle; | 50 struct ChannelHandle; |
54 | 51 |
55 // ----------------------------------------------------------------------------- | 52 // ----------------------------------------------------------------------------- |
56 // How we send IPC message logs across channels. | 53 // How we send IPC message logs across channels. |
57 struct IPC_EXPORT LogData { | 54 struct IPC_EXPORT LogData { |
58 LogData(); | 55 LogData(); |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 typedef base::FileDescriptor param_type; | 575 typedef base::FileDescriptor param_type; |
579 static void GetSize(base::PickleSizer* sizer, const param_type& p); | 576 static void GetSize(base::PickleSizer* sizer, const param_type& p); |
580 static void Write(base::Pickle* m, const param_type& p); | 577 static void Write(base::Pickle* m, const param_type& p); |
581 static bool Read(const base::Pickle* m, | 578 static bool Read(const base::Pickle* m, |
582 base::PickleIterator* iter, | 579 base::PickleIterator* iter, |
583 param_type* r); | 580 param_type* r); |
584 static void Log(const param_type& p, std::string* l); | 581 static void Log(const param_type& p, std::string* l); |
585 }; | 582 }; |
586 #endif // defined(OS_POSIX) | 583 #endif // defined(OS_POSIX) |
587 | 584 |
588 #if (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN) | |
589 template <> | 585 template <> |
590 struct IPC_EXPORT ParamTraits<base::SharedMemoryHandle> { | 586 struct IPC_EXPORT ParamTraits<base::SharedMemoryHandle> { |
591 typedef base::SharedMemoryHandle param_type; | 587 typedef base::SharedMemoryHandle param_type; |
592 static void GetSize(base::PickleSizer* sizer, const param_type& p); | 588 static void GetSize(base::PickleSizer* sizer, const param_type& p); |
593 static void Write(base::Pickle* m, const param_type& p); | 589 static void Write(base::Pickle* m, const param_type& p); |
594 static bool Read(const base::Pickle* m, | 590 static bool Read(const base::Pickle* m, |
595 base::PickleIterator* iter, | 591 base::PickleIterator* iter, |
596 param_type* r); | 592 param_type* r); |
597 static void Log(const param_type& p, std::string* l); | 593 static void Log(const param_type& p, std::string* l); |
598 }; | 594 }; |
599 #endif // (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN) | |
600 | 595 |
601 template <> | 596 template <> |
602 struct IPC_EXPORT ParamTraits<base::FilePath> { | 597 struct IPC_EXPORT ParamTraits<base::FilePath> { |
603 typedef base::FilePath param_type; | 598 typedef base::FilePath param_type; |
604 static void GetSize(base::PickleSizer* sizer, const param_type& p); | 599 static void GetSize(base::PickleSizer* sizer, const param_type& p); |
605 static void Write(base::Pickle* m, const param_type& p); | 600 static void Write(base::Pickle* m, const param_type& p); |
606 static bool Read(const base::Pickle* m, | 601 static bool Read(const base::Pickle* m, |
607 base::PickleIterator* iter, | 602 base::PickleIterator* iter, |
608 param_type* r); | 603 param_type* r); |
609 static void Log(const param_type& p, std::string* l); | 604 static void Log(const param_type& p, std::string* l); |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 template <class ReplyParamType> | 1179 template <class ReplyParamType> |
1185 inline void LogReplyParamsToMessage(const ReplyParamType& reply_params, | 1180 inline void LogReplyParamsToMessage(const ReplyParamType& reply_params, |
1186 const Message* msg) {} | 1181 const Message* msg) {} |
1187 | 1182 |
1188 inline void ConnectMessageAndReply(const Message* msg, Message* reply) {} | 1183 inline void ConnectMessageAndReply(const Message* msg, Message* reply) {} |
1189 #endif | 1184 #endif |
1190 | 1185 |
1191 } // namespace IPC | 1186 } // namespace IPC |
1192 | 1187 |
1193 #endif // IPC_IPC_MESSAGE_UTILS_H_ | 1188 #endif // IPC_IPC_MESSAGE_UTILS_H_ |
OLD | NEW |