Source code

Revision control

Other Tools

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
#include "nsIParentChannel.idl"
6
7
interface nsIRemoteTab;
8
interface nsIChannel;
9
interface nsIAsyncVerifyRedirectCallback;
10
11
[builtinclass, uuid(01987690-48cf-45de-bae3-e143c2adc2a8)]
12
interface nsIAsyncVerifyRedirectReadyCallback : nsISupports
13
{
14
/**
15
* Asynchronous callback when redirected channel finishes the preparation for
16
* completing the verification procedure.
17
*
18
* @param result
19
* SUCCEEDED if preparation for redirection verification succceed.
20
* If FAILED the redirection must be aborted.
21
*/
22
void readyToVerify(in nsresult result);
23
};
24
25
/**
26
* Implemented by chrome side of IPC protocols that support redirect responses.
27
*/
28
29
[scriptable, uuid(3ed1d288-5324-46ee-8a98-33ac37d1080b)]
30
interface nsIParentRedirectingChannel : nsIParentChannel
31
{
32
/**
33
* Called when the channel got a response that redirects it to a different
34
* URI. The implementation is responsible for calling the redirect observers
35
* on the child process and provide the decision result to the callback.
36
*
37
* @param newChannelId
38
* id of the redirect channel obtained from nsIRedirectChannelRegistrar.
39
* @param newURI
40
* the URI we redirect to
41
* @param callback
42
* redirect result callback, usage is compatible with how
43
* nsIChannelEventSink defines it
44
*/
45
void startRedirect(in uint32_t newChannelId,
46
in nsIChannel newChannel,
47
in uint32_t redirectFlags,
48
in nsIAsyncVerifyRedirectCallback callback);
49
50
/**
51
* Called to new channel when the original channel got Redirect2Verify
52
* response from child. Callback will be invoked when the new channel
53
* finishes the preparation for Redirect2Verify and can be called immediately.
54
*
55
* @param callback
56
* redirect ready callback, will be called when redirect verification
57
* procedure can proceed.
58
*/
59
void continueVerification(in nsIAsyncVerifyRedirectReadyCallback callback);
60
61
/**
62
* Called after we are done with redirecting process and we know if to
63
* redirect or not. Forward the redirect result to the child process. From
64
* that moment the nsIParentChannel implementation expects it will be
65
* forwarded all notifications from the 'real' channel.
66
*
67
* Primarilly used by HttpChannelParentListener::OnRedirectResult and kept
68
* as mActiveChannel and mRedirectChannel in that class.
69
*/
70
void completeRedirect(in boolean succeeded);
71
};