Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsINetworkPredictor.idl
3 : */
4 :
5 : #ifndef __gen_nsINetworkPredictor_h__
6 : #define __gen_nsINetworkPredictor_h__
7 :
8 :
9 : #ifndef __gen_nsISupports_h__
10 : #include "nsISupports.h"
11 : #endif
12 :
13 : #include "js/Value.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 : class nsIURI; /* forward declaration */
20 :
21 : class nsINetworkPredictorVerifier; /* forward declaration */
22 :
23 : typedef uint32_t PredictorPredictReason;
24 :
25 : typedef uint32_t PredictorLearnReason;
26 :
27 :
28 : /* starting interface: nsINetworkPredictor */
29 : #define NS_INETWORKPREDICTOR_IID_STR "acc88e7c-3f39-42c7-ac31-6377c2c3d73e"
30 :
31 : #define NS_INETWORKPREDICTOR_IID \
32 : {0xacc88e7c, 0x3f39, 0x42c7, \
33 : { 0xac, 0x31, 0x63, 0x77, 0xc2, 0xc3, 0xd7, 0x3e }}
34 :
35 2 : class NS_NO_VTABLE nsINetworkPredictor : public nsISupports {
36 : public:
37 :
38 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_INETWORKPREDICTOR_IID)
39 :
40 : enum {
41 : PREDICT_LINK = 0U,
42 : PREDICT_LOAD = 1U,
43 : PREDICT_STARTUP = 2U
44 : };
45 :
46 : /* [implicit_jscontext] void predict (in nsIURI targetURI, in nsIURI sourceURI, in PredictorPredictReason reason, in jsval originAttributes, in nsINetworkPredictorVerifier verifier); */
47 : NS_IMETHOD Predict(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, JS::HandleValue originAttributes, nsINetworkPredictorVerifier *verifier, JSContext* cx) = 0;
48 :
49 : /* [notxpcom] nsresult predictNative (in nsIURI targetURI, in nsIURI sourceURI, in PredictorPredictReason reason, in OriginAttributes originAttributes, in nsINetworkPredictorVerifier verifier); */
50 : NS_IMETHOD_(nsresult) PredictNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, const mozilla::OriginAttributes & originAttributes, nsINetworkPredictorVerifier *verifier) = 0;
51 :
52 : enum {
53 : LEARN_LOAD_TOPLEVEL = 0U,
54 : LEARN_LOAD_SUBRESOURCE = 1U,
55 : LEARN_LOAD_REDIRECT = 2U,
56 : LEARN_STARTUP = 3U
57 : };
58 :
59 : /* [implicit_jscontext] void learn (in nsIURI targetURI, in nsIURI sourceURI, in PredictorLearnReason reason, in jsval originAttributes); */
60 : NS_IMETHOD Learn(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, JS::HandleValue originAttributes, JSContext* cx) = 0;
61 :
62 : /* [notxpcom] nsresult learnNative (in nsIURI targetURI, in nsIURI sourceURI, in PredictorLearnReason reason, in OriginAttributes originAttributes); */
63 : NS_IMETHOD_(nsresult) LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes) = 0;
64 :
65 : /* void reset (); */
66 : NS_IMETHOD Reset(void) = 0;
67 :
68 : };
69 :
70 : NS_DEFINE_STATIC_IID_ACCESSOR(nsINetworkPredictor, NS_INETWORKPREDICTOR_IID)
71 :
72 : /* Use this macro when declaring classes that implement this interface. */
73 : #define NS_DECL_NSINETWORKPREDICTOR \
74 : NS_IMETHOD Predict(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, JS::HandleValue originAttributes, nsINetworkPredictorVerifier *verifier, JSContext* cx) override; \
75 : NS_IMETHOD_(nsresult) PredictNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, const mozilla::OriginAttributes & originAttributes, nsINetworkPredictorVerifier *verifier) override; \
76 : NS_IMETHOD Learn(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, JS::HandleValue originAttributes, JSContext* cx) override; \
77 : NS_IMETHOD_(nsresult) LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes) override; \
78 : NS_IMETHOD Reset(void) override;
79 :
80 : /* Use this macro when declaring the members of this interface when the
81 : class doesn't implement the interface. This is useful for forwarding. */
82 : #define NS_DECL_NON_VIRTUAL_NSINETWORKPREDICTOR \
83 : nsresult Predict(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, JS::HandleValue originAttributes, nsINetworkPredictorVerifier *verifier, JSContext* cx); \
84 : nsresult_(nsresult) PredictNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, const mozilla::OriginAttributes & originAttributes, nsINetworkPredictorVerifier *verifier); \
85 : nsresult Learn(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, JS::HandleValue originAttributes, JSContext* cx); \
86 : nsresult_(nsresult) LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes); \
87 : nsresult Reset(void);
88 :
89 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
90 : #define NS_FORWARD_NSINETWORKPREDICTOR(_to) \
91 : NS_IMETHOD Predict(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, JS::HandleValue originAttributes, nsINetworkPredictorVerifier *verifier, JSContext* cx) override { return _to Predict(targetURI, sourceURI, reason, originAttributes, verifier, cx); } \
92 : NS_IMETHOD_(nsresult) PredictNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, const mozilla::OriginAttributes & originAttributes, nsINetworkPredictorVerifier *verifier) override { return _to PredictNative(targetURI, sourceURI, reason, originAttributes, verifier); } \
93 : NS_IMETHOD Learn(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, JS::HandleValue originAttributes, JSContext* cx) override { return _to Learn(targetURI, sourceURI, reason, originAttributes, cx); } \
94 : NS_IMETHOD_(nsresult) LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes) override { return _to LearnNative(targetURI, sourceURI, reason, originAttributes); } \
95 : NS_IMETHOD Reset(void) override { return _to Reset(); }
96 :
97 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
98 : #define NS_FORWARD_SAFE_NSINETWORKPREDICTOR(_to) \
99 : NS_IMETHOD Predict(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, JS::HandleValue originAttributes, nsINetworkPredictorVerifier *verifier, JSContext* cx) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Predict(targetURI, sourceURI, reason, originAttributes, verifier, cx); } \
100 : NS_IMETHOD_(nsresult) PredictNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, const mozilla::OriginAttributes & originAttributes, nsINetworkPredictorVerifier *verifier) override; \
101 : NS_IMETHOD Learn(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, JS::HandleValue originAttributes, JSContext* cx) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Learn(targetURI, sourceURI, reason, originAttributes, cx); } \
102 : NS_IMETHOD_(nsresult) LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes) override; \
103 : NS_IMETHOD Reset(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Reset(); }
104 :
105 : #if 0
106 : /* Use the code below as a template for the implementation class for this interface. */
107 :
108 : /* Header file */
109 : class nsNetworkPredictor : public nsINetworkPredictor
110 : {
111 : public:
112 : NS_DECL_ISUPPORTS
113 : NS_DECL_NSINETWORKPREDICTOR
114 :
115 : nsNetworkPredictor();
116 :
117 : private:
118 : ~nsNetworkPredictor();
119 :
120 : protected:
121 : /* additional members */
122 : };
123 :
124 : /* Implementation file */
125 : NS_IMPL_ISUPPORTS(nsNetworkPredictor, nsINetworkPredictor)
126 :
127 : nsNetworkPredictor::nsNetworkPredictor()
128 : {
129 : /* member initializers and constructor code */
130 : }
131 :
132 : nsNetworkPredictor::~nsNetworkPredictor()
133 : {
134 : /* destructor code */
135 : }
136 :
137 : /* [implicit_jscontext] void predict (in nsIURI targetURI, in nsIURI sourceURI, in PredictorPredictReason reason, in jsval originAttributes, in nsINetworkPredictorVerifier verifier); */
138 : NS_IMETHODIMP nsNetworkPredictor::Predict(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, JS::HandleValue originAttributes, nsINetworkPredictorVerifier *verifier, JSContext* cx)
139 : {
140 : return NS_ERROR_NOT_IMPLEMENTED;
141 : }
142 :
143 : /* [notxpcom] nsresult predictNative (in nsIURI targetURI, in nsIURI sourceURI, in PredictorPredictReason reason, in OriginAttributes originAttributes, in nsINetworkPredictorVerifier verifier); */
144 : NS_IMETHODIMP_(nsresult) nsNetworkPredictor::PredictNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, const mozilla::OriginAttributes & originAttributes, nsINetworkPredictorVerifier *verifier)
145 : {
146 : return NS_ERROR_NOT_IMPLEMENTED;
147 : }
148 :
149 : /* [implicit_jscontext] void learn (in nsIURI targetURI, in nsIURI sourceURI, in PredictorLearnReason reason, in jsval originAttributes); */
150 : NS_IMETHODIMP nsNetworkPredictor::Learn(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, JS::HandleValue originAttributes, JSContext* cx)
151 : {
152 : return NS_ERROR_NOT_IMPLEMENTED;
153 : }
154 :
155 : /* [notxpcom] nsresult learnNative (in nsIURI targetURI, in nsIURI sourceURI, in PredictorLearnReason reason, in OriginAttributes originAttributes); */
156 : NS_IMETHODIMP_(nsresult) nsNetworkPredictor::LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes)
157 : {
158 : return NS_ERROR_NOT_IMPLEMENTED;
159 : }
160 :
161 : /* void reset (); */
162 : NS_IMETHODIMP nsNetworkPredictor::Reset()
163 : {
164 : return NS_ERROR_NOT_IMPLEMENTED;
165 : }
166 :
167 : /* End of implementation class template. */
168 : #endif
169 :
170 : // Wrapper functions to make use of the predictor easier and less invasive
171 : class nsIChannel;
172 : class nsIDocument;
173 : class nsILoadContext;
174 : class nsILoadGroup;
175 : class nsINetworkPredictorVerifier;
176 : namespace mozilla {
177 : namespace net {
178 : nsresult PredictorPredict(nsIURI *targetURI,
179 : nsIURI *sourceURI,
180 : PredictorPredictReason reason,
181 : const OriginAttributes& originAttributes,
182 : nsINetworkPredictorVerifier *verifier);
183 : nsresult PredictorLearn(nsIURI *targetURI,
184 : nsIURI *sourceURI,
185 : PredictorLearnReason reason,
186 : const OriginAttributes& originAttributes);
187 : nsresult PredictorLearn(nsIURI *targetURI,
188 : nsIURI *sourceURI,
189 : PredictorLearnReason reason,
190 : nsILoadGroup *loadGroup);
191 : nsresult PredictorLearn(nsIURI *targetURI,
192 : nsIURI *sourceURI,
193 : PredictorLearnReason reason,
194 : nsIDocument *document);
195 : nsresult PredictorLearnRedirect(nsIURI *targetURI,
196 : nsIChannel *channel,
197 : const OriginAttributes& originAttributes);
198 : } // mozilla::net
199 : } // mozilla
200 :
201 : #endif /* __gen_nsINetworkPredictor_h__ */
|