content/base/src/nsSyncLoadService.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 /*
     7  * A service that provides methods for synchronously loading a DOM in various ways.
     8  */
    10 #ifndef nsSyncLoadService_h__
    11 #define nsSyncLoadService_h__
    13 #include "nscore.h"
    15 class nsIInputStream;
    16 class nsILoadGroup;
    17 class nsIStreamListener;
    18 class nsIURI;
    19 class nsIPrincipal;
    20 class nsIDOMDocument;
    21 class nsIChannel;
    23 class nsSyncLoadService
    24 {
    25 public:
    26     /**
    27      * Synchronously load the document from the specified URI.
    28      *
    29      * @param aURI URI to load the document from.
    30      * @param aLoaderPrincipal Principal of loading document. For security
    31      *                         checks and referrer header. May be null if no
    32      *                         security checks should be done.
    33      * @param aLoadGroup The loadgroup to use for loading the document.
    34      * @param aForceToXML Whether to parse the document as XML, regardless of
    35      *                    content type.
    36      * @param aResult [out] The document loaded from the URI.
    37      */
    38     static nsresult LoadDocument(nsIURI *aURI, nsIPrincipal *aLoaderPrincipal,
    39                                  nsILoadGroup *aLoadGroup, bool aForceToXML,
    40                                  nsIDOMDocument** aResult);
    42     /**
    43      * Read input stream aIn in chunks and deliver synchronously to aListener.
    44      *
    45      * @param aIn The stream to be read.
    46      * @param aListener The listener that will receive
    47      *                  OnStartRequest/OnDataAvailable/OnStopRequest
    48      *                  notifications.
    49      * @param aChannel The channel that aIn was opened from.
    50      */
    51     static nsresult PushSyncStreamToListener(nsIInputStream* aIn,
    52                                              nsIStreamListener* aListener,
    53                                              nsIChannel* aChannel);
    54 };
    56 #endif // nsSyncLoadService_h__

mercurial