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.

Mercurial (7e962631ba42)

VCS Links

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
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

interface LoadInfo;
interface MozChannel;
interface URI;
interface nsISupports;

/**
 * Load types that correspond to the external types in nsIContentPolicy.idl.
 * Please also update that IDL when updating this list.
 */
enum MozContentPolicyType {
  "main_frame",
  "sub_frame",
  "stylesheet",
  "script",
  "image",
  "object",
  "object_subrequest",
  "xmlhttprequest",
  "fetch",
  "xbl",
  "xslt",
  "ping",
  "beacon",
  "xml_dtd",
  "font",
  "media",
  "websocket",
  "csp_report",
  "imageset",
  "web_manifest",
  "other"
};

/**
 * A thin wrapper around nsIChannel and nsIHttpChannel that allows JS
 * callers to access them without XPConnect overhead.
 */
[ChromeOnly, Exposed=System]
interface ChannelWrapper {
  /**
   * Returns the wrapper instance for the given channel. The same wrapper is
   * always returned for a given channel.
   */
  static ChannelWrapper get(MozChannel channel);

  [Constant, StoreInSlot]
  readonly attribute unsigned long long id;

  // Not technically pure, since it's backed by a weak reference, but if JS
  // has a reference to the previous value, we can depend on it not being
  // collected.
  [Pure]
  attribute MozChannel? channel;


  [Throws]
  void cancel(unsigned long result);

  [Throws]
  void redirectTo(URI url);


  [Pure]
  attribute ByteString contentType;


  [Cached, Pure]
  readonly attribute ByteString method;

  [Cached, Pure]
  readonly attribute MozContentPolicyType type;


  [Pure, SetterThrows]
  attribute boolean suspended;


  [Cached, GetterThrows, Pure]
  readonly attribute URI finalURI;

  [Cached, GetterThrows, Pure]
  readonly attribute ByteString finalURL;


  [Cached, Pure]
  readonly attribute unsigned long statusCode;

  [Cached, Pure]
  readonly attribute ByteString statusLine;


  [Cached, Frozen, GetterThrows, Pure]
  readonly attribute MozProxyInfo? proxyInfo;

  [Cached, Pure]
  readonly attribute ByteString? remoteAddress;


  [Cached, Pure]
  readonly attribute LoadInfo? loadInfo;

  [Cached, Pure]
  readonly attribute boolean isSystemLoad;

  [Cached, Pure]
  readonly attribute ByteString? originURL;

  [Cached, Pure]
  readonly attribute ByteString? documentURL;

  [Pure]
  readonly attribute URI? originURI;

  [Pure]
  readonly attribute URI? documentURI;


  [Cached, GetterThrows, Pure]
  readonly attribute boolean canModify;


  [Cached, Constant]
  readonly attribute long long windowId;

  [Cached, Constant]
  readonly attribute long long parentWindowId;

  [Cached, Pure]
  readonly attribute nsISupports? browserElement;


  [Throws]
  object getRequestHeaders();

  [Throws]
  object getResponseHeaders();

  [Throws]
  void setRequestHeader(ByteString header, ByteString value);

  [Throws]
  void setResponseHeader(ByteString header, ByteString value);
};

dictionary MozProxyInfo {
  required ByteString host;
  required long port;
  required ByteString type;

  required boolean proxyDNS;

  ByteString? username = null;

  unsigned long failoverTimeout;
};