/work/obj-fuzz/dist/include/nsIObjectOutputStream.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * DO NOT EDIT. THIS FILE IS GENERATED FROM /src/mozilla-central/xpcom/io/nsIObjectOutputStream.idl |
3 | | */ |
4 | | |
5 | | #ifndef __gen_nsIObjectOutputStream_h__ |
6 | | #define __gen_nsIObjectOutputStream_h__ |
7 | | |
8 | | |
9 | | #ifndef __gen_nsIBinaryOutputStream_h__ |
10 | | #include "nsIBinaryOutputStream.h" |
11 | | #endif |
12 | | |
13 | | #include "js/GCAnnotations.h" |
14 | | |
15 | | /* For IDL files that don't want to include root IDL files. */ |
16 | | #ifndef NS_NO_VTABLE |
17 | | #define NS_NO_VTABLE |
18 | | #endif |
19 | | |
20 | | /* starting interface: nsIObjectOutputStream */ |
21 | | #define NS_IOBJECTOUTPUTSTREAM_IID_STR "92c898ac-5fde-4b99-87b3-5d486422094b" |
22 | | |
23 | | #define NS_IOBJECTOUTPUTSTREAM_IID \ |
24 | | {0x92c898ac, 0x5fde, 0x4b99, \ |
25 | | { 0x87, 0xb3, 0x5d, 0x48, 0x64, 0x22, 0x09, 0x4b }} |
26 | | |
27 | | class NS_NO_VTABLE nsIObjectOutputStream : public nsIBinaryOutputStream { |
28 | | public: |
29 | | |
30 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOBJECTOUTPUTSTREAM_IID) |
31 | | |
32 | | /* void writeObject (in nsISupports aObject, in boolean aIsStrongRef); */ |
33 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteObject(nsISupports *aObject, bool aIsStrongRef) = 0; |
34 | | |
35 | | /* void writeSingleRefObject (in nsISupports aObject); */ |
36 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteSingleRefObject(nsISupports *aObject) = 0; |
37 | | |
38 | | /* void writeCompoundObject (in nsISupports aObject, in nsIIDRef aIID, in boolean aIsStrongRef); */ |
39 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteCompoundObject(nsISupports *aObject, const nsIID & aIID, bool aIsStrongRef) = 0; |
40 | | |
41 | | /* void writeID (in nsIDRef aID); */ |
42 | | JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteID(const nsID & aID) = 0; |
43 | | |
44 | | /* [notxpcom] charPtr getBuffer (in uint32_t aLength, in uint32_t aAlignMask); */ |
45 | | NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) = 0; |
46 | | |
47 | | /* [notxpcom] void putBuffer (in charPtr aBuffer, in uint32_t aLength); */ |
48 | | NS_IMETHOD_(void) PutBuffer(char * aBuffer, uint32_t aLength) = 0; |
49 | | |
50 | | }; |
51 | | |
52 | | NS_DEFINE_STATIC_IID_ACCESSOR(nsIObjectOutputStream, NS_IOBJECTOUTPUTSTREAM_IID) |
53 | | |
54 | | /* Use this macro when declaring classes that implement this interface. */ |
55 | | #define NS_DECL_NSIOBJECTOUTPUTSTREAM \ |
56 | | NS_IMETHOD WriteObject(nsISupports *aObject, bool aIsStrongRef) override; \ |
57 | | NS_IMETHOD WriteSingleRefObject(nsISupports *aObject) override; \ |
58 | | NS_IMETHOD WriteCompoundObject(nsISupports *aObject, const nsIID & aIID, bool aIsStrongRef) override; \ |
59 | | NS_IMETHOD WriteID(const nsID & aID) override; \ |
60 | | NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override; \ |
61 | | NS_IMETHOD_(void) PutBuffer(char * aBuffer, uint32_t aLength) override; |
62 | | |
63 | | /* Use this macro when declaring the members of this interface when the |
64 | | class doesn't implement the interface. This is useful for forwarding. */ |
65 | | #define NS_DECL_NON_VIRTUAL_NSIOBJECTOUTPUTSTREAM \ |
66 | | nsresult WriteObject(nsISupports *aObject, bool aIsStrongRef); \ |
67 | | nsresult WriteSingleRefObject(nsISupports *aObject); \ |
68 | | nsresult WriteCompoundObject(nsISupports *aObject, const nsIID & aIID, bool aIsStrongRef); \ |
69 | | nsresult WriteID(const nsID & aID); \ |
70 | | nsresult_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask); \ |
71 | | nsresult_(void) PutBuffer(char * aBuffer, uint32_t aLength); |
72 | | |
73 | | /* Use this macro to declare functions that forward the behavior of this interface to another object. */ |
74 | | #define NS_FORWARD_NSIOBJECTOUTPUTSTREAM(_to) \ |
75 | | NS_IMETHOD WriteObject(nsISupports *aObject, bool aIsStrongRef) override { return _to WriteObject(aObject, aIsStrongRef); } \ |
76 | | NS_IMETHOD WriteSingleRefObject(nsISupports *aObject) override { return _to WriteSingleRefObject(aObject); } \ |
77 | | NS_IMETHOD WriteCompoundObject(nsISupports *aObject, const nsIID & aIID, bool aIsStrongRef) override { return _to WriteCompoundObject(aObject, aIID, aIsStrongRef); } \ |
78 | | NS_IMETHOD WriteID(const nsID & aID) override { return _to WriteID(aID); } \ |
79 | | NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override { return _to GetBuffer(aLength, aAlignMask); } \ |
80 | | NS_IMETHOD_(void) PutBuffer(char * aBuffer, uint32_t aLength) override { return _to PutBuffer(aBuffer, aLength); } |
81 | | |
82 | | /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ |
83 | | #define NS_FORWARD_SAFE_NSIOBJECTOUTPUTSTREAM(_to) \ |
84 | | NS_IMETHOD WriteObject(nsISupports *aObject, bool aIsStrongRef) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteObject(aObject, aIsStrongRef); } \ |
85 | | NS_IMETHOD WriteSingleRefObject(nsISupports *aObject) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteSingleRefObject(aObject); } \ |
86 | | NS_IMETHOD WriteCompoundObject(nsISupports *aObject, const nsIID & aIID, bool aIsStrongRef) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteCompoundObject(aObject, aIID, aIsStrongRef); } \ |
87 | | NS_IMETHOD WriteID(const nsID & aID) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteID(aID); } \ |
88 | | NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override; \ |
89 | | NS_IMETHOD_(void) PutBuffer(char * aBuffer, uint32_t aLength) override; |
90 | | |
91 | | already_AddRefed<nsIObjectOutputStream> |
92 | | NS_NewObjectOutputStream(nsIOutputStream* aOutputStream); |
93 | | inline nsresult |
94 | | NS_WriteOptionalObject(nsIObjectOutputStream* aStream, nsISupports* aObject, |
95 | | bool aIsStrongRef) |
96 | 0 | { |
97 | 0 | bool nonnull = (aObject != nullptr); |
98 | 0 | nsresult rv = aStream->WriteBoolean(nonnull); |
99 | 0 | if (NS_SUCCEEDED(rv) && nonnull) |
100 | 0 | rv = aStream->WriteObject(aObject, aIsStrongRef); |
101 | 0 | return rv; |
102 | 0 | } |
103 | | inline nsresult |
104 | | NS_WriteOptionalSingleRefObject(nsIObjectOutputStream* aStream, |
105 | | nsISupports* aObject) |
106 | 0 | { |
107 | 0 | bool nonnull = (aObject != nullptr); |
108 | 0 | nsresult rv = aStream->WriteBoolean(nonnull); |
109 | 0 | if (NS_SUCCEEDED(rv) && nonnull) |
110 | 0 | rv = aStream->WriteSingleRefObject(aObject); |
111 | 0 | return rv; |
112 | 0 | } |
113 | | inline nsresult |
114 | | NS_WriteOptionalCompoundObject(nsIObjectOutputStream* aStream, |
115 | | nsISupports* aObject, |
116 | | const nsIID& aIID, |
117 | | bool aIsStrongRef) |
118 | 0 | { |
119 | 0 | bool nonnull = (aObject != nullptr); |
120 | 0 | nsresult rv = aStream->WriteBoolean(nonnull); |
121 | 0 | if (NS_SUCCEEDED(rv) && nonnull) |
122 | 0 | rv = aStream->WriteCompoundObject(aObject, aIID, aIsStrongRef); |
123 | 0 | return rv; |
124 | 0 | } |
125 | | |
126 | | #endif /* __gen_nsIObjectOutputStream_h__ */ |