Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/nsIObjectInputStream.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /src/mozilla-central/xpcom/io/nsIObjectInputStream.idl
3
 */
4
5
#ifndef __gen_nsIObjectInputStream_h__
6
#define __gen_nsIObjectInputStream_h__
7
8
9
#ifndef __gen_nsIBinaryInputStream_h__
10
#include "nsIBinaryInputStream.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:    nsIObjectInputStream */
21
#define NS_IOBJECTINPUTSTREAM_IID_STR "6c248606-4eae-46fa-9df0-ba58502368eb"
22
23
#define NS_IOBJECTINPUTSTREAM_IID \
24
  {0x6c248606, 0x4eae, 0x46fa, \
25
    { 0x9d, 0xf0, 0xba, 0x58, 0x50, 0x23, 0x68, 0xeb }}
26
27
class NS_NO_VTABLE nsIObjectInputStream : public nsIBinaryInputStream {
28
 public:
29
30
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOBJECTINPUTSTREAM_IID)
31
32
  /* nsISupports readObject (in boolean aIsStrongRef); */
33
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD ReadObject(bool aIsStrongRef, nsISupports **_retval) = 0;
34
35
  /* [notxpcom] nsresult readID (out nsID aID); */
36
  NS_IMETHOD_(nsresult) ReadID(nsID * aID) = 0;
37
38
  /* [notxpcom] charPtr getBuffer (in uint32_t aLength, in uint32_t aAlignMask); */
39
  NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) = 0;
40
41
  /* [notxpcom] void putBuffer (in charPtr aBuffer, in uint32_t aLength); */
42
  NS_IMETHOD_(void) PutBuffer(char * aBuffer, uint32_t aLength) = 0;
43
44
};
45
46
  NS_DEFINE_STATIC_IID_ACCESSOR(nsIObjectInputStream, NS_IOBJECTINPUTSTREAM_IID)
47
48
/* Use this macro when declaring classes that implement this interface. */
49
#define NS_DECL_NSIOBJECTINPUTSTREAM \
50
  NS_IMETHOD ReadObject(bool aIsStrongRef, nsISupports **_retval) override; \
51
  NS_IMETHOD_(nsresult) ReadID(nsID * aID) override; \
52
  NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override; \
53
  NS_IMETHOD_(void) PutBuffer(char * aBuffer, uint32_t aLength) override; 
54
55
/* Use this macro when declaring the members of this interface when the
56
   class doesn't implement the interface. This is useful for forwarding. */
57
#define NS_DECL_NON_VIRTUAL_NSIOBJECTINPUTSTREAM \
58
  nsresult ReadObject(bool aIsStrongRef, nsISupports **_retval); \
59
  nsresult_(nsresult) ReadID(nsID * aID); \
60
  nsresult_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask); \
61
  nsresult_(void) PutBuffer(char * aBuffer, uint32_t aLength); 
62
63
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
64
#define NS_FORWARD_NSIOBJECTINPUTSTREAM(_to) \
65
  NS_IMETHOD ReadObject(bool aIsStrongRef, nsISupports **_retval) override { return _to ReadObject(aIsStrongRef, _retval); } \
66
  NS_IMETHOD_(nsresult) ReadID(nsID * aID) override { return _to ReadID(aID); } \
67
  NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override { return _to GetBuffer(aLength, aAlignMask); } \
68
  NS_IMETHOD_(void) PutBuffer(char * aBuffer, uint32_t aLength) override { return _to PutBuffer(aBuffer, aLength); } 
69
70
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
71
#define NS_FORWARD_SAFE_NSIOBJECTINPUTSTREAM(_to) \
72
  NS_IMETHOD ReadObject(bool aIsStrongRef, nsISupports **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadObject(aIsStrongRef, _retval); } \
73
  NS_IMETHOD_(nsresult) ReadID(nsID * aID) override; \
74
  NS_IMETHOD_(char *) GetBuffer(uint32_t aLength, uint32_t aAlignMask) override; \
75
  NS_IMETHOD_(void) PutBuffer(char * aBuffer, uint32_t aLength) override; 
76
77
78
already_AddRefed<nsIObjectInputStream>
79
NS_NewObjectInputStream(nsIInputStream* aOutputStream);
80
inline nsresult
81
NS_ReadOptionalObject(nsIObjectInputStream* aStream, bool aIsStrongRef,
82
                      nsISupports* *aResult)
83
0
{
84
0
    bool nonnull;
85
0
    nsresult rv = aStream->ReadBoolean(&nonnull);
86
0
    if (NS_SUCCEEDED(rv)) {
87
0
        if (nonnull)
88
0
            rv = aStream->ReadObject(aIsStrongRef, aResult);
89
0
        else
90
0
            *aResult = nullptr;
91
0
    }
92
0
    return rv;
93
0
}
94
95
#endif /* __gen_nsIObjectInputStream_h__ */