no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / extensions / permissions / PermissionDelegateIPCUtils.h
blobc570a587f58f6a3c1666a662b7307525bca152b9
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_permissiondelegateipcutils_h
8 #define mozilla_permissiondelegateipcutils_h
10 #include "ipc/IPCMessageUtils.h"
12 #include "mozilla/PermissionDelegateHandler.h"
14 namespace IPC {
16 template <>
17 struct ParamTraits<
18 mozilla::PermissionDelegateHandler::DelegatedPermissionList> {
19 typedef mozilla::PermissionDelegateHandler::DelegatedPermissionList paramType;
21 static void Write(MessageWriter* aWriter, const paramType& aParam) {
22 for (auto& permission : aParam.mPermissions) {
23 WriteParam(aWriter, permission);
27 static bool Read(MessageReader* aReader, paramType* aResult) {
28 for (auto& permission : aResult->mPermissions) {
29 if (!ReadParam(aReader, &permission)) {
30 return false;
34 return true;
38 } // namespace IPC
40 #endif // mozilla_permissiondelegateipcutils_h