Line data Source code
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 file,
5 : * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef mozilla_ipc_nsIIPCSerializableURI_h
8 : #define mozilla_ipc_nsIIPCSerializableURI_h
9 :
10 : #include "nsISupports.h"
11 : #include "mozilla/Attributes.h"
12 :
13 : namespace mozilla {
14 : namespace ipc {
15 : class URIParams;
16 : } // namespace ipc
17 : } // namespace mozilla
18 :
19 : #define NS_IIPCSERIALIZABLEURI_IID \
20 : {0xfee3437d, 0x3daf, 0x411f, {0xb0, 0x1d, 0xdc, 0xd4, 0x88, 0x55, 0xe3, 0xd}}
21 :
22 10945 : class NS_NO_VTABLE nsIIPCSerializableURI : public nsISupports
23 : {
24 : public:
25 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIPCSERIALIZABLEURI_IID)
26 :
27 : virtual void
28 : Serialize(mozilla::ipc::URIParams& aParams) = 0;
29 :
30 : virtual bool
31 : Deserialize(const mozilla::ipc::URIParams& aParams) = 0;
32 : };
33 :
34 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCSerializableURI,
35 : NS_IIPCSERIALIZABLEURI_IID)
36 :
37 : #define NS_DECL_NSIIPCSERIALIZABLEURI \
38 : virtual void \
39 : Serialize(mozilla::ipc::URIParams&) override; \
40 : virtual bool \
41 : Deserialize(const mozilla::ipc::URIParams&) override;
42 :
43 : #define NS_FORWARD_NSIIPCSERIALIZABLEURI(_to) \
44 : virtual void \
45 : Serialize(mozilla::ipc::URIParams& aParams) override \
46 : { _to Serialize(aParams); } \
47 : virtual bool \
48 : Deserialize(const mozilla::ipc::URIParams& aParams) override \
49 : { return _to Deserialize(aParams); }
50 :
51 : #define NS_FORWARD_SAFE_NSIIPCSERIALIZABLEURI(_to) \
52 : virtual void \
53 : Serialize(mozilla::ipc::URIParams& aParams) override \
54 : { if (_to) { _to->Serialize(aParams); } } \
55 : virtual bool \
56 : Deserialize(const mozilla::ipc::URIParams& aParams) override \
57 : { if (_to) { return _to->Deserialize(aParams); } return false; }
58 :
59 : #endif // mozilla_ipc_nsIIPCSerializableURI_h
|