| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // 8 bytes on 64 bit builds. So if a 32 bit and 64 bit process have a channel | 186 // 8 bytes on 64 bit builds. So if a 32 bit and 64 bit process have a channel |
| 187 // that would cause problem. | 187 // that would cause problem. |
| 188 // We need to keep this on for a few configs: | 188 // We need to keep this on for a few configs: |
| 189 // 1) Windows because DWORD is typedef'd to it, which is fine because we have | 189 // 1) Windows because DWORD is typedef'd to it, which is fine because we have |
| 190 // very few IPCs that cross this boundary. | 190 // very few IPCs that cross this boundary. |
| 191 // 2) We also need to keep it for Linux for two reasons: int64_t is typedef'd | 191 // 2) We also need to keep it for Linux for two reasons: int64_t is typedef'd |
| 192 // to long, and gfx::PluginWindow is long and is used in one GPU IPC. | 192 // to long, and gfx::PluginWindow is long and is used in one GPU IPC. |
| 193 // 3) Android 64 bit also has int64_t typedef'd to long. | 193 // 3) Android 64 bit also has int64_t typedef'd to long. |
| 194 // Since we want to support Android 32<>64 bit IPC, as long as we don't have | 194 // Since we want to support Android 32<>64 bit IPC, as long as we don't have |
| 195 // these traits for 32 bit ARM then that'll catch any errors. | 195 // these traits for 32 bit ARM then that'll catch any errors. |
| 196 #if defined(OS_WIN) || defined(OS_LINUX) || defined(ARCH_CPU_ARM64) | 196 #if defined(OS_WIN) || defined(OS_LINUX) || \ |
| 197 (defined(OS_ANDROID) && defined(ARCH_CPU_64_BITS)) |
| 197 template <> | 198 template <> |
| 198 struct ParamTraits<long> { | 199 struct ParamTraits<long> { |
| 199 typedef long param_type; | 200 typedef long param_type; |
| 200 static void GetSize(base::PickleSizer* sizer, const param_type& p) { | 201 static void GetSize(base::PickleSizer* sizer, const param_type& p) { |
| 201 sizer->AddLong(); | 202 sizer->AddLong(); |
| 202 } | 203 } |
| 203 static void Write(base::Pickle* m, const param_type& p) { | 204 static void Write(base::Pickle* m, const param_type& p) { |
| 204 m->WriteLong(p); | 205 m->WriteLong(p); |
| 205 } | 206 } |
| 206 static bool Read(const base::Pickle* m, | 207 static bool Read(const base::Pickle* m, |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 template <class ReplyParamType> | 1084 template <class ReplyParamType> |
| 1084 inline void LogReplyParamsToMessage(const ReplyParamType& reply_params, | 1085 inline void LogReplyParamsToMessage(const ReplyParamType& reply_params, |
| 1085 const Message* msg) {} | 1086 const Message* msg) {} |
| 1086 | 1087 |
| 1087 inline void ConnectMessageAndReply(const Message* msg, Message* reply) {} | 1088 inline void ConnectMessageAndReply(const Message* msg, Message* reply) {} |
| 1088 #endif | 1089 #endif |
| 1089 | 1090 |
| 1090 } // namespace IPC | 1091 } // namespace IPC |
| 1091 | 1092 |
| 1092 #endif // IPC_IPC_MESSAGE_UTILS_H_ | 1093 #endif // IPC_IPC_MESSAGE_UTILS_H_ |
| OLD | NEW |