summaryrefslogtreecommitdiff
path: root/netwerk/base/nsIParentRedirectingChannel.idl
blob: df37a0131b05d32f1f5dab6e617aa670e02d7723 (plain)
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
/* 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/. */

#include "nsIParentChannel.idl"

interface nsITabParent;
interface nsIChannel;
interface nsIAsyncVerifyRedirectCallback;

/**
 * Implemented by chrome side of IPC protocols that support redirect responses.
 */

[scriptable, uuid(3ed1d288-5324-46ee-8a98-33ac37d1080b)]
interface nsIParentRedirectingChannel : nsIParentChannel
{
  /**
   * Called when the channel got a response that redirects it to a different
   * URI.  The implementation is responsible for calling the redirect observers
   * on the child process and provide the decision result to the callback.
   *
   * @param newChannelId
   *    id of the redirect channel obtained from nsIRedirectChannelRegistrar.
   * @param newURI
   *    the URI we redirect to
   * @param callback
   *    redirect result callback, usage is compatible with how
   *    nsIChannelEventSink defines it
   */
  void startRedirect(in uint32_t newChannelId,
                     in nsIChannel newChannel,
                     in uint32_t redirectFlags,
                     in nsIAsyncVerifyRedirectCallback callback);

  /**
   * Called after we are done with redirecting process and we know if to
   * redirect or not.  Forward the redirect result to the child process.  From
   * that moment the nsIParentChannel implementation expects it will be
   * forwarded all notifications from the 'real' channel.
   *
   * Primarilly used by HttpChannelParentListener::OnRedirectResult and kept
   * as mActiveChannel and mRedirectChannel in that class.
   */
  void completeRedirect(in boolean succeeded);
};