Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes
txCompileObserver Class Reference
Inheritance diagram for txCompileObserver:
Inheritance graph
[legend]
Collaboration diagram for txCompileObserver:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 txCompileObserver (txMozillaXSLTProcessor *aProcessor, nsILoadGroup *aLoadGroup)
virtual ~txCompileObserver ()
nsresult startLoad (nsIURI *aUri, txStylesheetCompiler *aCompiler, nsIURI *aReferrerURI)
virtual nsrefcnt AddRef ()=0
virtual nsrefcnt Release ()=0
virtual nsresult loadURI (const nsAString &aUri, const nsAString &aReferrerUri, txStylesheetCompiler *aCompiler)=0
virtual void onDoneCompiling (txStylesheetCompiler *aCompiler, nsresult aResult, const PRUnichar *aErrorText=nsnull, const PRUnichar *aParam=nsnull)=0

Public Attributes

 TX_DECL_ACOMPILEOBSERVER

Protected Member Functions

 txCompileObserver ()

Protected Attributes

nsAutoRefCnt mRefCnt

Private Attributes

nsRefPtr< txMozillaXSLTProcessormProcessor
nsCOMPtr< nsILoadGroupmLoadGroup

Detailed Description

Definition at line 455 of file txMozillaStylesheetCompiler.cpp.


Constructor & Destructor Documentation

Definition at line 479 of file txMozillaStylesheetCompiler.cpp.

    : mProcessor(aProcessor),
      mLoadGroup(aLoadGroup)
{
}

Definition at line 486 of file txMozillaStylesheetCompiler.cpp.

{
}

Member Function Documentation

virtual nsrefcnt txACompileObserver::AddRef ( ) [pure virtual, inherited]

Implemented in txStylesheetCompiler.

virtual nsresult txACompileObserver::loadURI ( const nsAString &  aUri,
const nsAString &  aReferrerUri,
txStylesheetCompiler aCompiler 
) [pure virtual, inherited]

Implemented in txStylesheetCompiler.

virtual void txACompileObserver::onDoneCompiling ( txStylesheetCompiler aCompiler,
nsresult  aResult,
const PRUnichar aErrorText = nsnull,
const PRUnichar aParam = nsnull 
) [pure virtual, inherited]

Implemented in txStylesheetCompiler.

virtual nsrefcnt txACompileObserver::Release ( ) [pure virtual, inherited]

Implemented in txStylesheetCompiler.

nsresult txCompileObserver::startLoad ( nsIURI aUri,
txStylesheetCompiler aCompiler,
nsIURI aReferrerURI 
)

Definition at line 546 of file txMozillaStylesheetCompiler.cpp.

{
    nsCOMPtr<nsIChannel> channel;
    nsresult rv = NS_NewChannel(getter_AddRefs(channel), aUri);
    NS_ENSURE_SUCCESS(rv, rv);

    channel->SetLoadGroup(mLoadGroup);

    channel->SetContentType(NS_LITERAL_CSTRING("text/xml"));

    nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
    if (httpChannel) {
        httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
                                      NS_LITERAL_CSTRING("text/xml,application/xml,application/xhtml+xml,*/*;q=0.1"),
                                      PR_FALSE);

        if (aReferrerURI) {
            httpChannel->SetReferrer(aReferrerURI);
        }
    }

    nsCOMPtr<nsIParser> parser = do_CreateInstance(kCParserCID, &rv);
    NS_ENSURE_SUCCESS(rv, rv);

    nsRefPtr<txStylesheetSink> sink = new txStylesheetSink(aCompiler, parser);
    NS_ENSURE_TRUE(sink, NS_ERROR_OUT_OF_MEMORY);

    channel->SetNotificationCallbacks(sink);

    parser->SetCommand(kLoadAsData);
    parser->SetContentSink(sink);
    parser->Parse(aUri);

    return channel->AsyncOpen(sink, parser);
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 472 of file txMozillaStylesheetCompiler.cpp.

Definition at line 471 of file txMozillaStylesheetCompiler.cpp.

Definition at line 468 of file txMozillaStylesheetCompiler.cpp.

Definition at line 462 of file txMozillaStylesheetCompiler.cpp.


The documentation for this class was generated from the following file: