1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim:set ts=4 sw=4 sts=4 cin: */
3 /* ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is Mozilla.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications.
20 * Portions created by the Initial Developer are Copyright (C) 2001
21 * the Initial Developer. All Rights Reserved.
24 * Gagan Saksena <gagan@netscape.com> (original author)
25 * Darin Fisher <darin@netscape.com>
26 * Christian Biesinger <cbiesinger@web.de>
28 * Alternatively, the contents of this file may be used under the terms of
29 * either the GNU General Public License Version 2 or later (the "GPL"), or
30 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 * in which case the provisions of the GPL or the LGPL are applicable instead
32 * of those above. If you wish to allow use of your version of this file only
33 * under the terms of either the GPL or the LGPL, and not to allow others to
34 * use your version of this file under the terms of the MPL, indicate your
35 * decision by deleting the provisions above and replace them with the notice
36 * and other provisions required by the GPL or the LGPL. If you do not delete
37 * the provisions above, a recipient may use your version of this file under
38 * the terms of any one of the MPL, the GPL or the LGPL.
40 * ***** END LICENSE BLOCK ***** */
42 #include
"nsISupports.idl"
47 * Implement this interface to receive control over various channel events.
48 * Channels will try to get this interface from a channel's
49 * notificationCallbacks or, if not available there, from the loadGroup's
50 * notificationCallbacks.
52 * These methods are called before onStartRequest, and should be handled
55 [scriptable
, uuid(6757d790
-2916-498e
-aaca
-6b668a956875
)]
56 interface nsIChannelEventSink
: nsISupports
59 * This is a temporary redirect. New requests for this resource should
60 * continue to use the URI of the old channel.
62 * The new URI may be identical to the old one.
64 const unsigned long REDIRECT_TEMPORARY
= 1 << 0;
67 * This is a permanent redirect. New requests for this resource should use
68 * the URI of the new channel (This might be an HTTP 301 reponse).
69 * If this flag is not set, this is a temporary redirect.
71 * The new URI may be identical to the old one.
73 const unsigned long REDIRECT_PERMANENT
= 1 << 1;
76 * This is an internal redirect, i.e. it was not initiated by the remote
77 * server, but is specific to the channel implementation.
79 * The new URI may be identical to the old one.
81 const unsigned long REDIRECT_INTERNAL
= 1 << 2;
84 * Called when a redirect occurs. This may happen due to an HTTP 3xx status
88 * The channel that's being redirected.
90 * The new channel. This channel is not opened yet.
92 * Flags indicating the type of redirect. A bitmask consisting
93 * of flags from above.
94 * One of REDIRECT_TEMPORARY and REDIRECT_PERMANENT will always be
97 * @throw <any> Throwing an exception will cancel the load. No network
98 * request for the new channel will be made.
100 void onChannelRedirect
(in nsIChannel oldChannel
,
101 in nsIChannel newChannel
,
102 in unsigned long flags
);