no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / ipc / glue / TaintingIPCUtils.h
blobd4f61d95b5702cc313d0298a03cd95028d9fc3a9
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"
17 namespace mozilla {
18 namespace ipc {
20 template <typename T>
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));
38 } // namespace ipc
39 } // namespace mozilla
41 #endif // ifndef mozilla_ipc_Tainting_h