Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef mozilla_ipc_nsIIPCSerializableURI_h
6 #define mozilla_ipc_nsIIPCSerializableURI_h
8 #include "nsISupports.h"
9 #include "mozilla/Attributes.h"
11 namespace mozilla {
12 namespace ipc {
13 class URIParams;
14 }
15 }
17 #define NS_IIPCSERIALIZABLEURI_IID \
18 {0xfee3437d, 0x3daf, 0x411f, {0xb0, 0x1d, 0xdc, 0xd4, 0x88, 0x55, 0xe3, 0xd}}
20 class NS_NO_VTABLE nsIIPCSerializableURI : public nsISupports
21 {
22 public:
23 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIPCSERIALIZABLEURI_IID)
25 virtual void
26 Serialize(mozilla::ipc::URIParams& aParams) = 0;
28 virtual bool
29 Deserialize(const mozilla::ipc::URIParams& aParams) = 0;
30 };
32 NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableURI,
33 NS_IIPCSERIALIZABLEURI_IID)
35 #define NS_DECL_NSIIPCSERIALIZABLEURI \
36 virtual void \
37 Serialize(mozilla::ipc::URIParams&) MOZ_OVERRIDE; \
38 virtual bool \
39 Deserialize(const mozilla::ipc::URIParams&) MOZ_OVERRIDE;
41 #define NS_FORWARD_NSIIPCSERIALIZABLEURI(_to) \
42 virtual void \
43 Serialize(mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \
44 { _to Serialize(aParams); } \
45 virtual bool \
46 Deserialize(const mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \
47 { return _to Deserialize(aParams); }
49 #define NS_FORWARD_SAFE_NSIIPCSERIALIZABLEURI(_to) \
50 virtual void \
51 Serialize(mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \
52 { if (_to) { _to->Serialize(aParams); } } \
53 virtual bool \
54 Deserialize(const mozilla::ipc::URIParams& aParams) MOZ_OVERRIDE \
55 { if (_to) { return _to->Deserialize(aParams); } return false; }
57 #endif // mozilla_ipc_nsIIPCSerializableURI_h