nsIParentRedirectingChannel.idl (2468B)
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 [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 [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 newURI 38 * the URI we redirect to 39 * @param callback 40 * redirect result callback, usage is compatible with how 41 * nsIChannelEventSink defines it 42 */ 43 void startRedirect(in nsIChannel newChannel, 44 in uint32_t redirectFlags, 45 in nsIAsyncVerifyRedirectCallback callback); 46 47 /** 48 * Called to new channel when the original channel got Redirect2Verify 49 * response from child. Callback will be invoked when the new channel 50 * finishes the preparation for Redirect2Verify and can be called immediately. 51 * 52 * @param callback 53 * redirect ready callback, will be called when redirect verification 54 * procedure can proceed. 55 */ 56 void continueVerification(in nsIAsyncVerifyRedirectReadyCallback callback); 57 58 /** 59 * Called after we are done with redirecting process and we know if to 60 * redirect or not. Forward the redirect result to the child process. From 61 * that moment the nsIParentChannel implementation expects it will be 62 * forwarded all notifications from the 'real' channel. 63 * 64 * Primarilly used by HttpChannelParent::OnRedirectResult and kept as 65 * mActiveChannel and mRedirectChannel in that class. 66 */ 67 void completeRedirect(in nsresult succeeded); 68 };