| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/files/file.h" |
| 14 #include "base/format_macros.h" | 15 #include "base/format_macros.h" |
| 15 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 16 #include "base/platform_file.h" | |
| 17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
| 20 #include "base/tuple.h" | 20 #include "base/tuple.h" |
| 21 #include "ipc/ipc_message_start.h" | 21 #include "ipc/ipc_message_start.h" |
| 22 #include "ipc/ipc_param_traits.h" | 22 #include "ipc/ipc_param_traits.h" |
| 23 #include "ipc/ipc_sync_message.h" | 23 #include "ipc/ipc_sync_message.h" |
| 24 | 24 |
| 25 #if defined(COMPILER_GCC) | 25 #if defined(COMPILER_GCC) |
| 26 // GCC "helpfully" tries to inline template methods in release mode. Except we | 26 // GCC "helpfully" tries to inline template methods in release mode. Except we |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 template <> | 467 template <> |
| 468 struct IPC_EXPORT ParamTraits<base::NullableString16> { | 468 struct IPC_EXPORT ParamTraits<base::NullableString16> { |
| 469 typedef base::NullableString16 param_type; | 469 typedef base::NullableString16 param_type; |
| 470 static void Write(Message* m, const param_type& p); | 470 static void Write(Message* m, const param_type& p); |
| 471 static bool Read(const Message* m, PickleIterator* iter, | 471 static bool Read(const Message* m, PickleIterator* iter, |
| 472 param_type* r); | 472 param_type* r); |
| 473 static void Log(const param_type& p, std::string* l); | 473 static void Log(const param_type& p, std::string* l); |
| 474 }; | 474 }; |
| 475 | 475 |
| 476 template <> | 476 template <> |
| 477 struct IPC_EXPORT ParamTraits<base::PlatformFileInfo> { | 477 struct IPC_EXPORT ParamTraits<base::File::Info> { |
| 478 typedef base::PlatformFileInfo param_type; | 478 typedef base::File::Info param_type; |
| 479 static void Write(Message* m, const param_type& p); | 479 static void Write(Message* m, const param_type& p); |
| 480 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 480 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 481 static void Log(const param_type& p, std::string* l); | 481 static void Log(const param_type& p, std::string* l); |
| 482 }; | 482 }; |
| 483 | 483 |
| 484 template <> | 484 template <> |
| 485 struct SimilarTypeTraits<base::PlatformFileError> { | 485 struct SimilarTypeTraits<base::File::Error> { |
| 486 typedef int Type; | 486 typedef int Type; |
| 487 }; | 487 }; |
| 488 | 488 |
| 489 #if defined(OS_WIN) | 489 #if defined(OS_WIN) |
| 490 template <> | 490 template <> |
| 491 struct SimilarTypeTraits<HWND> { | 491 struct SimilarTypeTraits<HWND> { |
| 492 typedef HANDLE Type; | 492 typedef HANDLE Type; |
| 493 }; | 493 }; |
| 494 #endif // defined(OS_WIN) | 494 #endif // defined(OS_WIN) |
| 495 | 495 |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 template<typename TA, typename TB, typename TC, typename TD, typename TE> | 878 template<typename TA, typename TB, typename TC, typename TD, typename TE> |
| 879 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e) { | 879 static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e) { |
| 880 ReplyParam p(a, b, c, d, e); | 880 ReplyParam p(a, b, c, d, e); |
| 881 WriteParam(reply, p); | 881 WriteParam(reply, p); |
| 882 } | 882 } |
| 883 }; | 883 }; |
| 884 | 884 |
| 885 } // namespace IPC | 885 } // namespace IPC |
| 886 | 886 |
| 887 #endif // IPC_IPC_MESSAGE_UTILS_H_ | 887 #endif // IPC_IPC_MESSAGE_UTILS_H_ |
| OLD | NEW |