1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipc/glue/nsIIPCSerializableURI.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef mozilla_ipc_nsIIPCSerializableURI_h 1.9 +#define mozilla_ipc_nsIIPCSerializableURI_h 1.10 + 1.11 +#include "nsISupports.h" 1.12 +#include "mozilla/Attributes.h" 1.13 + 1.14 +namespace mozilla { 1.15 +namespace ipc { 1.16 +class URIParams; 1.17 +} 1.18 +} 1.19 + 1.20 +#define NS_IIPCSERIALIZABLEURI_IID \ 1.21 + {0xfee3437d, 0x3daf, 0x411f, {0xb0, 0x1d, 0xdc, 0xd4, 0x88, 0x55, 0xe3, 0xd}} 1.22 + 1.23 +class NS_NO_VTABLE nsIIPCSerializableURI : public nsISupports 1.24 +{ 1.25 +public: 1.26 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIPCSERIALIZABLEURI_IID) 1.27 + 1.28 + virtual void 1.29 + Serialize(mozilla::ipc::URIParams& aParams) = 0; 1.30 + 1.31 + virtual bool 1.32 + Deserialize(const mozilla::ipc::URIParams& aParams) = 0; 1.33 +}; 1.34 + 1.35 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableURI, 1.36 + NS_IIPCSERIALIZABLEURI_IID) 1.37 + 1.38 +#define NS_DECL_NSIIPCSERIALIZABLEURI \ 1.39 + virtual void \ 1.40 + Serialize(mozilla::ipc::URIParams&) MOZ_OVERRIDE; \ 1.41 + virtual bool \ 1.42 + Deserialize(const mozilla::ipc::URIParams&) MOZ_OVERRIDE; 1.43 + 1.44 +#define NS_FORWARD_NSIIPCSERIALIZABLEURI(_to) \ 1.45 + virtual void \ 1.46 + Serialize(mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \ 1.47 + { _to Serialize(aParams); } \ 1.48 + virtual bool \ 1.49 + Deserialize(const mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \ 1.50 + { return _to Deserialize(aParams); } 1.51 + 1.52 +#define NS_FORWARD_SAFE_NSIIPCSERIALIZABLEURI(_to) \ 1.53 + virtual void \ 1.54 + Serialize(mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \ 1.55 + { if (_to) { _to->Serialize(aParams); } } \ 1.56 + virtual bool \ 1.57 + Deserialize(const mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \ 1.58 + { if (_to) { return _to->Deserialize(aParams); } return false; } 1.59 + 1.60 +#endif // mozilla_ipc_nsIIPCSerializableURI_h