michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_ipc_nsIIPCSerializableURI_h michael@0: #define mozilla_ipc_nsIIPCSerializableURI_h michael@0: michael@0: #include "nsISupports.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: namespace mozilla { michael@0: namespace ipc { michael@0: class URIParams; michael@0: } michael@0: } michael@0: michael@0: #define NS_IIPCSERIALIZABLEURI_IID \ michael@0: {0xfee3437d, 0x3daf, 0x411f, {0xb0, 0x1d, 0xdc, 0xd4, 0x88, 0x55, 0xe3, 0xd}} michael@0: michael@0: class NS_NO_VTABLE nsIIPCSerializableURI : public nsISupports michael@0: { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIPCSERIALIZABLEURI_IID) michael@0: michael@0: virtual void michael@0: Serialize(mozilla::ipc::URIParams& aParams) = 0; michael@0: michael@0: virtual bool michael@0: Deserialize(const mozilla::ipc::URIParams& aParams) = 0; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableURI, michael@0: NS_IIPCSERIALIZABLEURI_IID) michael@0: michael@0: #define NS_DECL_NSIIPCSERIALIZABLEURI \ michael@0: virtual void \ michael@0: Serialize(mozilla::ipc::URIParams&) MOZ_OVERRIDE; \ michael@0: virtual bool \ michael@0: Deserialize(const mozilla::ipc::URIParams&) MOZ_OVERRIDE; michael@0: michael@0: #define NS_FORWARD_NSIIPCSERIALIZABLEURI(_to) \ michael@0: virtual void \ michael@0: Serialize(mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \ michael@0: { _to Serialize(aParams); } \ michael@0: virtual bool \ michael@0: Deserialize(const mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \ michael@0: { return _to Deserialize(aParams); } michael@0: michael@0: #define NS_FORWARD_SAFE_NSIIPCSERIALIZABLEURI(_to) \ michael@0: virtual void \ michael@0: Serialize(mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \ michael@0: { if (_to) { _to->Serialize(aParams); } } \ michael@0: virtual bool \ michael@0: Deserialize(const mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \ michael@0: { if (_to) { return _to->Deserialize(aParams); } return false; } michael@0: michael@0: #endif // mozilla_ipc_nsIIPCSerializableURI_h