|
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/. */ |
|
4 |
|
5 #ifndef mozilla_ipc_nsIIPCSerializableURI_h |
|
6 #define mozilla_ipc_nsIIPCSerializableURI_h |
|
7 |
|
8 #include "nsISupports.h" |
|
9 #include "mozilla/Attributes.h" |
|
10 |
|
11 namespace mozilla { |
|
12 namespace ipc { |
|
13 class URIParams; |
|
14 } |
|
15 } |
|
16 |
|
17 #define NS_IIPCSERIALIZABLEURI_IID \ |
|
18 {0xfee3437d, 0x3daf, 0x411f, {0xb0, 0x1d, 0xdc, 0xd4, 0x88, 0x55, 0xe3, 0xd}} |
|
19 |
|
20 class NS_NO_VTABLE nsIIPCSerializableURI : public nsISupports |
|
21 { |
|
22 public: |
|
23 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIPCSERIALIZABLEURI_IID) |
|
24 |
|
25 virtual void |
|
26 Serialize(mozilla::ipc::URIParams& aParams) = 0; |
|
27 |
|
28 virtual bool |
|
29 Deserialize(const mozilla::ipc::URIParams& aParams) = 0; |
|
30 }; |
|
31 |
|
32 NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableURI, |
|
33 NS_IIPCSERIALIZABLEURI_IID) |
|
34 |
|
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; |
|
40 |
|
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); } |
|
48 |
|
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; } |
|
56 |
|
57 #endif // mozilla_ipc_nsIIPCSerializableURI_h |