Bug 1111017 - Followup on Bug 1087442 - Updating comments (r=sicking)
authorChristoph Kerschbaumer <mozilla@christophkerschbaumer.com>
Fri, 12 Dec 2014 13:45:51 -0800
changeset 219597 e7e1d62f2a41f53ea1a37f9665843d8aa6c4e7ac
parent 219596 1165556f34c355199cdf4b6fd8a385f3fdca9193
child 219598 ecdbe4421df012e5241d385f497a8a5335e51d4a
push idunknown
push userunknown
push dateunknown
reviewerssicking
bugs1111017, 1087442
milestone37.0a1
Bug 1111017 - Followup on Bug 1087442 - Updating comments (r=sicking)
netwerk/base/public/nsIIOService.idl
netwerk/base/public/nsIIOService2.idl
netwerk/base/public/nsNetUtil.h
--- a/netwerk/base/public/nsIIOService.idl
+++ b/netwerk/base/public/nsIIOService.idl
@@ -62,20 +62,16 @@ interface nsIIOService : nsISupports
      * callers to specify whether this is a file or directory by
      * splitting this  into newDirURI() and newActualFileURI().
      */
     nsIURI newFileURI(in nsIFile aFile);
 
     /**
      * Creates a channel for a given URI.
      *
-     * Please note, if you provide both a loadingNode and a loadingPrincipal,
-     * then loadingPrincipal must be equal to loadingNode->NodePrincipal().
-     * But less error prone is to just supply a loadingNode.
-     *
      * @param aURI
      *        nsIURI from which to make a channel
      * @param aLoadingNode
      *        The loadingDocument of the channel.
      *        The element or document where the result of this request will be
      *        used. This is the document/element that will get access to the
      *        result of this request. For example for an image load, it's the
      *        document in which the image will be loaded. And for a CSS
@@ -117,16 +113,19 @@ interface nsIIOService : nsISupports
      * @param aSecurityFlags
      *        The securityFlags of the channel.
      *        Any of the securityflags defined in nsILoadInfo.idl
      * @param aContentPolicyType
      *        The contentPolicyType of the channel.
      *        Any of the content types defined in nsIContentPolicy.idl
      * @return reference to the new nsIChannel object
      *
+     * Please note, if you provide both a loadingNode and a loadingPrincipal,
+     * then loadingPrincipal must be equal to loadingNode->NodePrincipal().
+     * But less error prone is to just supply a loadingNode.
      */
     nsIChannel newChannelFromURI2(in nsIURI aURI,
                                   in nsIDOMNode aLoadingNode,
                                   in nsIPrincipal aLoadingPrincipal,
                                   in nsIPrincipal aTriggeringPrincipal,
                                   in unsigned long aSecurityFlags,
                                   in unsigned long aContentPolicyType);
 
--- a/netwerk/base/public/nsIIOService2.idl
+++ b/netwerk/base/public/nsIIOService2.idl
@@ -28,20 +28,16 @@ interface nsIIOService2 : nsIIOService
    * if there is no link, until application code runs and can turn off
    * this management.
    */
   attribute boolean manageOfflineStatus;
 
   /**
    * Creates a channel for a given URI.
    *
-   * Please note, if you provide both a loadingNode and a loadingPrincipal,
-   * then loadingPrincipal must be equal to loadingNode->NodePrincipal().
-   * But less error prone is to just supply a loadingNode.
-   *
    * @param aURI
    *        nsIURI from which to make a channel
    * @param aProxyURI
    *        nsIURI to use for proxy resolution. Can be null in which
    *        case aURI is used
    * @param aProxyFlags flags from nsIProtocolProxyService to use
    *        when resolving proxies for this new channel
    * @param aLoadingNode
@@ -88,16 +84,19 @@ interface nsIIOService2 : nsIIOService
    * @param aSecurityFlags
    *        The securityFlags of the channel.
    *        Any of the securityflags defined in nsILoadInfo.idl
    * @param aContentPolicyType
    *        The contentPolicyType of the channel.
    *        Any of the content types defined in nsIContentPolicy.idl
    * @return reference to the new nsIChannel object
    *
+   * Please note, if you provide both a loadingNode and a loadingPrincipal,
+   * then loadingPrincipal must be equal to loadingNode->NodePrincipal().
+   * But less error prone is to just supply a loadingNode.
    */
   nsIChannel newChannelFromURIWithProxyFlags2(in nsIURI aURI,
                                               in nsIURI aProxyURI,
                                               in unsigned long aProxyFlags,
                                               in nsIDOMNode aLoadingNode,
                                               in nsIPrincipal aLoadingPrincipal,
                                               in nsIPrincipal aTriggeringPrincipal,
                                               in unsigned long aSecurityFlags,
--- a/netwerk/base/public/nsNetUtil.h
+++ b/netwerk/base/public/nsNetUtil.h
@@ -188,19 +188,26 @@ NS_NewFileURI(nsIURI* *result,
 }
 
 /*
 * How to create a new Channel, using NS_NewChannel,
 * NS_NewChannelWithTriggeringPrincipal, NS_OpenURI,
 * NS_NewInputStreamChannel, NS_NewChannelInternal
 * and it's variations:
 *
-* Please note, if you provide both a loadingNode and a loadingPrincipal,
-* then loadingPrincipal must be equal to loadingNode->NodePrincipal().
-* But less error prone is to just supply a loadingNode.
+* What specific API function to use:
+* * The NS_NewChannelInternal functions should almost never be directly
+*   called outside of necko code.
+* * If possible, use NS_NewChannel() providing a loading *nsINode*
+* * If no loading *nsINode* is avaialable, call NS_NewChannel() providing
+*   a loading *nsIPrincipal*.
+* * Call NS_NewChannelWithTriggeringPrincipal if the triggeringPrincipal
+*   is different from the loadingPrincipal.
+* * Call NS_NewChannelInternal() providing aLoadInfo object in cases where
+*   you already have loadInfo object, e.g in case of a channel redirect.
 *
 * @param aURI
 *        nsIURI from which to make a channel
 * @param aLoadingNode
 *        The loadingDocument of the channel.
 *        The element or document where the result of this request will be
 *        used. This is the document/element that will get access to the
 *        result of this request. For example for an image load, it's the
@@ -242,26 +249,19 @@ NS_NewFileURI(nsIURI* *result,
 *        the document whose rendering is affected is the loadingPrincipal.
 * @param aSecurityFlags
 *        The securityFlags of the channel.
 *        Any of the securityflags defined in nsILoadInfo.idl
 * @param aContentPolicyType
 *        The contentPolicyType of the channel.
 *        Any of the content types defined in nsIContentPolicy.idl
 *
-* What specific API function to use:
-* * The NS_NewChannelInternal functions should almost never be directly
-*   called outside of necko code.
-* * If possible, use NS_NewChannel() providing a loading *nsINode*
-* * If no loading *nsINode* is avaialable, call NS_NewChannel() providing
-*   a loading *nsIPrincipal*.
-* * Call NS_NewChannelWithTriggeringPrincipal if the triggeringPrincipal
-*   is different from the loadingPrincipal.
-* * Call NS_NewChannelInternal() providing aLoadInfo object in cases where
-*   you already have loadInfo object, e.g in case of a channel redirect.
+* Please note, if you provide both a loadingNode and a loadingPrincipal,
+* then loadingPrincipal must be equal to loadingNode->NodePrincipal().
+* But less error prone is to just supply a loadingNode.
 */
 inline nsresult
 NS_NewChannelInternal(nsIChannel**           outChannel,
                       nsIURI*                aUri,
                       nsINode*               aLoadingNode,
                       nsIPrincipal*          aLoadingPrincipal,
                       nsIPrincipal*          aTriggeringPrincipal,
                       nsSecurityFlags        aSecurityFlags,