Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1090)

Side by Side Diff: ipc/ipc_message_utils.h

Issue 2846293002: Make PlatformFileForTransit its own class on Windows. (Closed)
Patch Set: Change message serialization to write nothing if the handle isn't valid. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/nacl/renderer/ppb_nacl_private_impl.cc ('k') | ipc/ipc_message_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 class TimeDelta; 42 class TimeDelta;
43 class TimeTicks; 43 class TimeTicks;
44 class UnguessableToken; 44 class UnguessableToken;
45 struct FileDescriptor; 45 struct FileDescriptor;
46 } 46 }
47 47
48 namespace IPC { 48 namespace IPC {
49 49
50 struct ChannelHandle; 50 struct ChannelHandle;
51 51
52 #if defined(OS_WIN)
53 class PlatformFileForTransit;
54 #endif
55
52 // ----------------------------------------------------------------------------- 56 // -----------------------------------------------------------------------------
53 // How we send IPC message logs across channels. 57 // How we send IPC message logs across channels.
54 struct IPC_EXPORT LogData { 58 struct IPC_EXPORT LogData {
55 LogData(); 59 LogData();
56 LogData(const LogData& other); 60 LogData(const LogData& other);
57 ~LogData(); 61 ~LogData();
58 62
59 std::string channel; 63 std::string channel;
60 int32_t routing_id; 64 int32_t routing_id;
61 uint32_t type; // "User-defined" message type, from ipc_message.h. 65 uint32_t type; // "User-defined" message type, from ipc_message.h.
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 struct IPC_EXPORT ParamTraits<base::SharedMemoryHandle> { 590 struct IPC_EXPORT ParamTraits<base::SharedMemoryHandle> {
587 typedef base::SharedMemoryHandle param_type; 591 typedef base::SharedMemoryHandle param_type;
588 static void GetSize(base::PickleSizer* sizer, const param_type& p); 592 static void GetSize(base::PickleSizer* sizer, const param_type& p);
589 static void Write(base::Pickle* m, const param_type& p); 593 static void Write(base::Pickle* m, const param_type& p);
590 static bool Read(const base::Pickle* m, 594 static bool Read(const base::Pickle* m,
591 base::PickleIterator* iter, 595 base::PickleIterator* iter,
592 param_type* r); 596 param_type* r);
593 static void Log(const param_type& p, std::string* l); 597 static void Log(const param_type& p, std::string* l);
594 }; 598 };
595 599
600 #if defined(OS_WIN)
601 template <>
602 struct IPC_EXPORT ParamTraits<PlatformFileForTransit> {
603 typedef PlatformFileForTransit param_type;
604 static void GetSize(base::PickleSizer* sizer, const param_type& p);
605 static void Write(base::Pickle* m, const param_type& p);
606 static bool Read(const base::Pickle* m,
607 base::PickleIterator* iter,
608 param_type* r);
609 static void Log(const param_type& p, std::string* l);
610 };
611 #endif // defined(OS_WIN)
612
596 template <> 613 template <>
597 struct IPC_EXPORT ParamTraits<base::FilePath> { 614 struct IPC_EXPORT ParamTraits<base::FilePath> {
598 typedef base::FilePath param_type; 615 typedef base::FilePath param_type;
599 static void GetSize(base::PickleSizer* sizer, const param_type& p); 616 static void GetSize(base::PickleSizer* sizer, const param_type& p);
600 static void Write(base::Pickle* m, const param_type& p); 617 static void Write(base::Pickle* m, const param_type& p);
601 static bool Read(const base::Pickle* m, 618 static bool Read(const base::Pickle* m,
602 base::PickleIterator* iter, 619 base::PickleIterator* iter,
603 param_type* r); 620 param_type* r);
604 static void Log(const param_type& p, std::string* l); 621 static void Log(const param_type& p, std::string* l);
605 }; 622 };
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 template <class ReplyParamType> 1196 template <class ReplyParamType>
1180 inline void LogReplyParamsToMessage(const ReplyParamType& reply_params, 1197 inline void LogReplyParamsToMessage(const ReplyParamType& reply_params,
1181 const Message* msg) {} 1198 const Message* msg) {}
1182 1199
1183 inline void ConnectMessageAndReply(const Message* msg, Message* reply) {} 1200 inline void ConnectMessageAndReply(const Message* msg, Message* reply) {}
1184 #endif 1201 #endif
1185 1202
1186 } // namespace IPC 1203 } // namespace IPC
1187 1204
1188 #endif // IPC_IPC_MESSAGE_UTILS_H_ 1205 #endif // IPC_IPC_MESSAGE_UTILS_H_
OLDNEW
« no previous file with comments | « components/nacl/renderer/ppb_nacl_private_impl.cc ('k') | ipc/ipc_message_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698