Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
mozJSSubScriptLoader.cpp File Reference
#include "mozJSSubScriptLoader.h"
#include "nsIServiceManager.h"
#include "nsIXPConnect.h"
#include "nsIURI.h"
#include "nsIIOService.h"
#include "nsIChannel.h"
#include "nsIInputStream.h"
#include "nsNetCID.h"
#include "nsDependentString.h"
#include "nsAutoPtr.h"
#include "nsNetUtil.h"
#include "nsIProtocolHandler.h"
#include "nsIFileURL.h"
#include "jsapi.h"
#include "jsdbgapi.h"

Go to the source code of this file.


#define LOAD_ERROR_NOSERVICE   "Error creating IO Service."
#define LOAD_ERROR_NOURI   "Error creating URI (invalid URL scheme?)"
#define LOAD_ERROR_NOSCHEME   "Failed to get URI scheme. This is bad."
#define LOAD_ERROR_URI_NOT_LOCAL   "Trying to load a non-local URI."
#define LOAD_ERROR_NOSTREAM   "Error opening input stream (invalid filename?)"
#define LOAD_ERROR_NOCONTENT   "ContentLength not available (not a local URL?)"
#define LOAD_ERROR_BADREAD   "File Read Error."
#define LOAD_ERROR_READUNDERFLOW   "File Read Error (underflow.)"
#define LOAD_ERROR_NOPRINCIPALS   "Failed to get principals."
#define LOAD_ERROR_NOSPEC   "Failed to get URI spec. This is bad."


void JS_DLL_CALLBACK mozJSLoaderErrorReporter (JSContext *cx, const char *message, JSErrorReport *rep)

Define Documentation

#define LOAD_ERROR_BADREAD   "File Read Error."

Definition at line 72 of file mozJSSubScriptLoader.cpp.

#define LOAD_ERROR_NOCONTENT   "ContentLength not available (not a local URL?)"

Definition at line 71 of file mozJSSubScriptLoader.cpp.

#define LOAD_ERROR_NOPRINCIPALS   "Failed to get principals."

Definition at line 74 of file mozJSSubScriptLoader.cpp.

#define LOAD_ERROR_NOSCHEME   "Failed to get URI scheme. This is bad."

Definition at line 68 of file mozJSSubScriptLoader.cpp.

#define LOAD_ERROR_NOSERVICE   "Error creating IO Service."

Definition at line 66 of file mozJSSubScriptLoader.cpp.

#define LOAD_ERROR_NOSPEC   "Failed to get URI spec. This is bad."

Definition at line 75 of file mozJSSubScriptLoader.cpp.

#define LOAD_ERROR_NOSTREAM   "Error opening input stream (invalid filename?)"

Definition at line 70 of file mozJSSubScriptLoader.cpp.

#define LOAD_ERROR_NOURI   "Error creating URI (invalid URL scheme?)"

Definition at line 67 of file mozJSSubScriptLoader.cpp.

#define LOAD_ERROR_READUNDERFLOW   "File Read Error (underflow.)"

Definition at line 73 of file mozJSSubScriptLoader.cpp.

#define LOAD_ERROR_URI_NOT_LOCAL   "Trying to load a non-local URI."

Definition at line 69 of file mozJSSubScriptLoader.cpp.

Function Documentation

void JS_DLL_CALLBACK mozJSLoaderErrorReporter ( JSContext cx,
const char *  message,
JSErrorReport rep 

Definition at line 110 of file mozJSComponentLoader.cpp.

    nsresult rv;

    /* Use the console service to register the error. */
    nsCOMPtr<nsIConsoleService> consoleService =

     * Make an nsIScriptError, populate it with information from this
     * error, then log it with the console service.  The UI can then
     * poll the service to update the Error console.
    nsCOMPtr<nsIScriptError> errorObject = 
    if (consoleService && errorObject) {
         * Got an error object; prepare appropriate-width versions of
         * various arguments to it.
        nsAutoString fileUni;

        PRUint32 column = rep->uctokenptr - rep->uclinebuf;

        rv = errorObject->Init(NS_REINTERPRET_CAST(const PRUnichar*,
                               NS_REINTERPRET_CAST(const PRUnichar*,
                               rep->lineno, column, rep->flags,
                               "component javascript");
        if (NS_SUCCEEDED(rv)) {
            rv = consoleService->LogMessage(errorObject);
            if (NS_SUCCEEDED(rv)) {
                // We're done!  Skip return to fall thru to stderr
                // printout, for the benefit of those invoking the
                // browser with -console
                // return;

     * If any of the above fails for some reason, fall back to
     * printing to stderr.
#ifdef DEBUG
    fprintf(stderr, "JS Component Loader: %s %s:%d\n"
            "                     %s\n",
            JSREPORT_IS_WARNING(rep->flags) ? "WARNING" : "ERROR",
            rep->filename, rep->lineno,
            message ? message : "<no message>");

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_DEFINE_CID ( kIOServiceCID  ,
) [static]