| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 class FilePath; | 99 class FilePath; |
| 100 class NullableString16; | 100 class NullableString16; |
| 101 | 101 |
| 102 namespace base { | 102 namespace base { |
| 103 class DictionaryValue; | 103 class DictionaryValue; |
| 104 class ListValue; | 104 class ListValue; |
| 105 class Time; | 105 class Time; |
| 106 class TimeDelta; | 106 class TimeDelta; |
| 107 class TimeTicks; |
| 107 struct FileDescriptor; | 108 struct FileDescriptor; |
| 108 } | 109 } |
| 109 | 110 |
| 110 namespace IPC { | 111 namespace IPC { |
| 111 | 112 |
| 112 struct ChannelHandle; | 113 struct ChannelHandle; |
| 113 | 114 |
| 114 //----------------------------------------------------------------------------- | 115 //----------------------------------------------------------------------------- |
| 115 // An iterator class for reading the fields contained within a Message. | 116 // An iterator class for reading the fields contained within a Message. |
| 116 | 117 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 }; | 325 }; |
| 325 | 326 |
| 326 template <> | 327 template <> |
| 327 struct IPC_EXPORT ParamTraits<base::TimeDelta> { | 328 struct IPC_EXPORT ParamTraits<base::TimeDelta> { |
| 328 typedef base::TimeDelta param_type; | 329 typedef base::TimeDelta param_type; |
| 329 static void Write(Message* m, const param_type& p); | 330 static void Write(Message* m, const param_type& p); |
| 330 static bool Read(const Message* m, void** iter, param_type* r); | 331 static bool Read(const Message* m, void** iter, param_type* r); |
| 331 static void Log(const param_type& p, std::string* l); | 332 static void Log(const param_type& p, std::string* l); |
| 332 }; | 333 }; |
| 333 | 334 |
| 335 template <> |
| 336 struct IPC_EXPORT ParamTraits<base::TimeTicks> { |
| 337 typedef base::TimeTicks param_type; |
| 338 static void Write(Message* m, const param_type& p); |
| 339 static bool Read(const Message* m, void** iter, param_type* r); |
| 340 static void Log(const param_type& p, std::string* l); |
| 341 }; |
| 342 |
| 334 #if defined(OS_WIN) | 343 #if defined(OS_WIN) |
| 335 template <> | 344 template <> |
| 336 struct ParamTraits<LOGFONT> { | 345 struct ParamTraits<LOGFONT> { |
| 337 typedef LOGFONT param_type; | 346 typedef LOGFONT param_type; |
| 338 static void Write(Message* m, const param_type& p) { | 347 static void Write(Message* m, const param_type& p) { |
| 339 m->WriteData(reinterpret_cast<const char*>(&p), sizeof(LOGFONT)); | 348 m->WriteData(reinterpret_cast<const char*>(&p), sizeof(LOGFONT)); |
| 340 } | 349 } |
| 341 static bool Read(const Message* m, void** iter, param_type* r) { | 350 static bool Read(const Message* m, void** iter, param_type* r) { |
| 342 const char *data; | 351 const char *data; |
| 343 int data_size = 0; | 352 int data_size = 0; |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 ReplyParam p(a, b, c, d, e); | 1102 ReplyParam p(a, b, c, d, e); |
| 1094 WriteParam(reply, p); | 1103 WriteParam(reply, p); |
| 1095 } | 1104 } |
| 1096 }; | 1105 }; |
| 1097 | 1106 |
| 1098 //----------------------------------------------------------------------------- | 1107 //----------------------------------------------------------------------------- |
| 1099 | 1108 |
| 1100 } // namespace IPC | 1109 } // namespace IPC |
| 1101 | 1110 |
| 1102 #endif // IPC_IPC_MESSAGE_UTILS_H_ | 1111 #endif // IPC_IPC_MESSAGE_UTILS_H_ |
| OLD | NEW |