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/. */
7 #ifndef mozilla_ipc_Tainting_h
8 #define mozilla_ipc_Tainting_h
10 #include "mozilla/Tainting.h"
12 #include "base/basictypes.h"
13 #include "base/process.h"
15 #include "mozilla/ipc/IPDLParamTraits.h"
21 struct IPDLParamTraits
<mozilla::Tainted
<T
>> {
22 static void Write(IPC::MessageWriter
* aWriter
, IProtocol
* aActor
,
23 const mozilla::Tainted
<T
>& aParam
) {
24 WriteIPDLParam(aWriter
, aActor
, aParam
.mValue
);
27 static void Write(IPC::MessageWriter
* aWriter
, IProtocol
* aActor
,
28 mozilla::Tainted
<T
>&& aParam
) {
29 WriteIPDLParam(aWriter
, aActor
, std::move(aParam
.mValue
));
32 static bool Read(IPC::MessageReader
* aReader
, IProtocol
* aActor
,
33 mozilla::Tainted
<T
>* aResult
) {
34 return ReadIPDLParam(aReader
, aActor
, &(aResult
->mValue
));
39 } // namespace mozilla
41 #endif // ifndef mozilla_ipc_Tainting_h