Bug 1634779 - pt 2. Partially revert Bug 1603006 r=kmag
[gecko.git] / dom / ipc / PropertyBagUtils.h
bloba85f87b16febad0f78bffc9b0a788d0702e8b733
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 IPC_PropertyBagUtils_h
8 #define IPC_PropertyBagUtils_h
10 #include "mozilla/ipc/IPDLParamTraits.h"
11 #include "nsIPropertyBag2.h"
12 #include "nsIVariant.h"
14 namespace mozilla {
15 namespace ipc {
17 /**
18 * Limited nsIVariant support. Not all types are implemented and only
19 * nsIURI is implemented with nsIVariant::GetAsInterface.
21 template <>
22 struct IPDLParamTraits<nsIVariant*> {
23 static void Write(IPC::Message* aMsg, IProtocol* aActor, nsIVariant* aParam);
24 static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
25 IProtocol* aActor, RefPtr<nsIVariant>* aResult);
28 template <>
29 struct IPDLParamTraits<nsIPropertyBag2*> {
30 static void Write(IPC::Message* aMsg, IProtocol* aActor,
31 nsIPropertyBag2* aParam);
32 static bool Read(const IPC::Message* aMsg, PickleIterator* aIter,
33 IProtocol* aActor, RefPtr<nsIPropertyBag2>* aResult);
36 } // namespace ipc
37 } // namespace mozilla
39 #endif // mozilla_ipc_URIUtils_h