DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Untracked file

nsINetworkPredictor

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsINetworkPredictor.idl
 */

#ifndef __gen_nsINetworkPredictor_h__
#define __gen_nsINetworkPredictor_h__


#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

#include "js/Value.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIURI; /* forward declaration */

class nsINetworkPredictorVerifier; /* forward declaration */

typedef uint32_t  PredictorPredictReason;

typedef uint32_t  PredictorLearnReason;


/* starting interface:    nsINetworkPredictor */
#define NS_INETWORKPREDICTOR_IID_STR "acc88e7c-3f39-42c7-ac31-6377c2c3d73e"

#define NS_INETWORKPREDICTOR_IID \
  {0xacc88e7c, 0x3f39, 0x42c7, \
    { 0xac, 0x31, 0x63, 0x77, 0xc2, 0xc3, 0xd7, 0x3e }}

class NS_NO_VTABLE nsINetworkPredictor : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_INETWORKPREDICTOR_IID)

  enum {
    PREDICT_LINK = 0U,
    PREDICT_LOAD = 1U,
    PREDICT_STARTUP = 2U
  };

  /* [implicit_jscontext] void predict (in nsIURI targetURI, in nsIURI sourceURI, in PredictorPredictReason reason, in jsval originAttributes, in nsINetworkPredictorVerifier verifier); */
  NS_IMETHOD Predict(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, JS::HandleValue originAttributes, nsINetworkPredictorVerifier *verifier, JSContext* cx) = 0;

  /* [notxpcom] nsresult predictNative (in nsIURI targetURI, in nsIURI sourceURI, in PredictorPredictReason reason, in OriginAttributes originAttributes, in nsINetworkPredictorVerifier verifier); */
  NS_IMETHOD_(nsresult) PredictNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, const mozilla::OriginAttributes & originAttributes, nsINetworkPredictorVerifier *verifier) = 0;

  enum {
    LEARN_LOAD_TOPLEVEL = 0U,
    LEARN_LOAD_SUBRESOURCE = 1U,
    LEARN_LOAD_REDIRECT = 2U,
    LEARN_STARTUP = 3U
  };

  /* [implicit_jscontext] void learn (in nsIURI targetURI, in nsIURI sourceURI, in PredictorLearnReason reason, in jsval originAttributes); */
  NS_IMETHOD Learn(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, JS::HandleValue originAttributes, JSContext* cx) = 0;

  /* [notxpcom] nsresult learnNative (in nsIURI targetURI, in nsIURI sourceURI, in PredictorLearnReason reason, in OriginAttributes originAttributes); */
  NS_IMETHOD_(nsresult) LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes) = 0;

  /* void reset (); */
  NS_IMETHOD Reset(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsINetworkPredictor, NS_INETWORKPREDICTOR_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSINETWORKPREDICTOR \
  NS_IMETHOD Predict(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, JS::HandleValue originAttributes, nsINetworkPredictorVerifier *verifier, JSContext* cx) override; \
  NS_IMETHOD_(nsresult) PredictNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, const mozilla::OriginAttributes & originAttributes, nsINetworkPredictorVerifier *verifier) override; \
  NS_IMETHOD Learn(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, JS::HandleValue originAttributes, JSContext* cx) override; \
  NS_IMETHOD_(nsresult) LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes) override; \
  NS_IMETHOD Reset(void) override; 

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSINETWORKPREDICTOR \
  nsresult Predict(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, JS::HandleValue originAttributes, nsINetworkPredictorVerifier *verifier, JSContext* cx); \
  nsresult_(nsresult) PredictNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, const mozilla::OriginAttributes & originAttributes, nsINetworkPredictorVerifier *verifier); \
  nsresult Learn(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, JS::HandleValue originAttributes, JSContext* cx); \
  nsresult_(nsresult) LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes); \
  nsresult Reset(void); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSINETWORKPREDICTOR(_to) \
  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); } \
  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); } \
  NS_IMETHOD Learn(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, JS::HandleValue originAttributes, JSContext* cx) override { return _to Learn(targetURI, sourceURI, reason, originAttributes, cx); } \
  NS_IMETHOD_(nsresult) LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes) override { return _to LearnNative(targetURI, sourceURI, reason, originAttributes); } \
  NS_IMETHOD Reset(void) override { return _to Reset(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSINETWORKPREDICTOR(_to) \
  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); } \
  NS_IMETHOD_(nsresult) PredictNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, const mozilla::OriginAttributes & originAttributes, nsINetworkPredictorVerifier *verifier) override; \
  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); } \
  NS_IMETHOD_(nsresult) LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes) override; \
  NS_IMETHOD Reset(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Reset(); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsNetworkPredictor : public nsINetworkPredictor
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSINETWORKPREDICTOR

  nsNetworkPredictor();

private:
  ~nsNetworkPredictor();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsNetworkPredictor, nsINetworkPredictor)

nsNetworkPredictor::nsNetworkPredictor()
{
  /* member initializers and constructor code */
}

nsNetworkPredictor::~nsNetworkPredictor()
{
  /* destructor code */
}

/* [implicit_jscontext] void predict (in nsIURI targetURI, in nsIURI sourceURI, in PredictorPredictReason reason, in jsval originAttributes, in nsINetworkPredictorVerifier verifier); */
NS_IMETHODIMP nsNetworkPredictor::Predict(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, JS::HandleValue originAttributes, nsINetworkPredictorVerifier *verifier, JSContext* cx)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [notxpcom] nsresult predictNative (in nsIURI targetURI, in nsIURI sourceURI, in PredictorPredictReason reason, in OriginAttributes originAttributes, in nsINetworkPredictorVerifier verifier); */
NS_IMETHODIMP_(nsresult) nsNetworkPredictor::PredictNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorPredictReason reason, const mozilla::OriginAttributes & originAttributes, nsINetworkPredictorVerifier *verifier)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [implicit_jscontext] void learn (in nsIURI targetURI, in nsIURI sourceURI, in PredictorLearnReason reason, in jsval originAttributes); */
NS_IMETHODIMP nsNetworkPredictor::Learn(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, JS::HandleValue originAttributes, JSContext* cx)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [notxpcom] nsresult learnNative (in nsIURI targetURI, in nsIURI sourceURI, in PredictorLearnReason reason, in OriginAttributes originAttributes); */
NS_IMETHODIMP_(nsresult) nsNetworkPredictor::LearnNative(nsIURI *targetURI, nsIURI *sourceURI, PredictorLearnReason reason, const mozilla::OriginAttributes & originAttributes)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void reset (); */
NS_IMETHODIMP nsNetworkPredictor::Reset()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

// Wrapper functions to make use of the predictor easier and less invasive
class nsIChannel;
class nsIDocument;
class nsILoadContext;
class nsILoadGroup;
class nsINetworkPredictorVerifier;
namespace mozilla {
namespace net {
nsresult PredictorPredict(nsIURI *targetURI,
                          nsIURI *sourceURI,
                          PredictorPredictReason reason,
                          const OriginAttributes& originAttributes,
                          nsINetworkPredictorVerifier *verifier);
nsresult PredictorLearn(nsIURI *targetURI,
                        nsIURI *sourceURI,
                        PredictorLearnReason reason,
                        const OriginAttributes& originAttributes);
nsresult PredictorLearn(nsIURI *targetURI,
                        nsIURI *sourceURI,
                        PredictorLearnReason reason,
                        nsILoadGroup *loadGroup);
nsresult PredictorLearn(nsIURI *targetURI,
                        nsIURI *sourceURI,
                        PredictorLearnReason reason,
                        nsIDocument *document);
nsresult PredictorLearnRedirect(nsIURI *targetURI,
                                nsIChannel *channel,
                                const OriginAttributes& originAttributes);
} // mozilla::net
} // mozilla

#endif /* __gen_nsINetworkPredictor_h__ */