Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef mozilla_ipc_Transport_posix_h
8 : #define mozilla_ipc_Transport_posix_h 1
9 :
10 : #include "ipc/IPCMessageUtils.h"
11 :
12 :
13 : namespace mozilla {
14 : namespace ipc {
15 :
16 74 : struct TransportDescriptor
17 : {
18 : base::FileDescriptor mFd;
19 : };
20 :
21 : } // namespace ipc
22 : } // namespace mozilla
23 :
24 :
25 : namespace IPC {
26 :
27 : template<>
28 : struct ParamTraits<mozilla::ipc::TransportDescriptor>
29 : {
30 : typedef mozilla::ipc::TransportDescriptor paramType;
31 13 : static void Write(Message* aMsg, const paramType& aParam)
32 : {
33 13 : WriteParam(aMsg, aParam.mFd);
34 13 : }
35 12 : static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
36 : {
37 12 : return ReadParam(aMsg, aIter, &aResult->mFd);
38 : }
39 : };
40 :
41 : } // namespace IPC
42 :
43 :
44 : #endif // mozilla_ipc_Transport_posix_h
|