Name Description Size
AppShutdown.cpp XP_MACOSX 6275
AppShutdown.h Save environment variables that we might need if the app initiates a restart later in its lifecycle. 1760
AutoRestore.h functions for restoring saved values at the end of a C++ scope 1328
AvailableMemoryTracker.cpp ownsWeak 13030
AvailableMemoryTracker.h 939
ClearOnShutdown.cpp 2327
ClearOnShutdown.h This header exports two public methods in the mozilla namespace: template<class SmartPtr> void ClearOnShutdown(SmartPtr *aPtr, aPhase=ShutdownPhase::ShutdownFinal) This function takes a pointer to a smart pointer and nulls the smart pointer on shutdown (and a particular phase of shutdown as needed). If a phase is specified, the ptr will be cleared at the start of that phase. Also, if a phase has already occurred when ClearOnShutdown() is called it will cause a MOZ_ASSERT. In case a phase is not explicitly cleared we will clear it on the next phase that occurs. This is useful if you have a global smart pointer object which you don't want to "leak" on shutdown. Although ClearOnShutdown will work with any smart pointer (i.e., nsCOMPtr, nsRefPtr, nsAutoPtr, StaticRefPtr, and StaticAutoPtr), you probably want to use it only with StaticRefPtr and StaticAutoPtr. There is no way to undo a call to ClearOnShutdown, so you can call it only on smart pointers which you know will live until the program shuts down. In practice, these are likely global variables, which should be Static{Ref,Auto}Ptr. template <typename CallableT> void RunOnShutdown(CallableT&& aCallable, aPhase = ShutdownPhase::ShutdownFinal) This function takes a callable and executes it upon shutdown at the start of the specified phase. If the phase has already occurred when RunOnShutdown() is called, it will cause a MOZ_ASSERT. In case a phase is not explicitly cleared, we will clear it on the next phase that occurs. ClearOnShutdown and RunOnShutdown are both currently main-thread only because we don't want to accidentally free an object from a different thread than the one it was created on. 4570
CodeAddressService.h 8369
CountingAllocatorBase.h 5417
CycleCollectedJSContext.cpp 26709
CycleCollectedJSContext.h 12461
CycleCollectedJSRuntime.cpp ms 54564
CycleCollectedJSRuntime.h 12978
Debug.cpp 542
Debug.h 576
DebuggerOnGCRunnable.cpp static 1416
DebuggerOnGCRunnable.h 1102
DeferredFinalize.cpp 1007
DeferredFinalize.h 1279
EnumeratedArrayCycleCollection.h 1321
ErrorList.py A nserror module. When used with a `with` statement, binds the itself to Mod.active. 62670
ErrorNames.cpp 2257
ErrorNames.h 850
GkRustUtils.cpp static 550
GkRustUtils.h 504
HoldDropJSObjects.cpp 2082
HoldDropJSObjects.h 1802
IntentionalCrash.h 1791
JSObjectHolder.cpp 412
JSObjectHolder.h 1376
LogCommandLineHandler.cpp 2521
LogCommandLineHandler.h A helper function parsing provided command line arguments and handling two specific args: -MOZ_LOG=modulelist -MOZ_LOG_FILE=file/path both expecting an argument, and corresponding to the same-name environment variables we use for logging setup. When an argument is found in the proper form, the consumer callback is called with a string in a follwing form, note that we do this for every occurence, and not just at the end of the parsing: "MOZ_LOG=modulelist" or "MOZ_LOG_FILE=file/path" All the following forms of arguments of the application are possible: --MOZ_LOG modulelist -MOZ_LOG modulelist --MOZ_LOG=modulelist -MOZ_LOG=modulelist The motivation for a separte function and not implementing a command line handler interface is that we need to process this very early during the application startup. Command line handlers are proccessed way later after logging has already been set up. 1606
LogModulePrefWatcher.cpp Resets all the preferences in the logging. branch This is needed because we may crash while logging, and this would cause us to log after restarting as well. If logging after restart is desired, set the logging.config.clear_on_startup pref to false, or use the MOZ_LOG_FILE and MOZ_LOG_MODULES env vars. 5392
LogModulePrefWatcher.h Watches for changes to "logging.*" prefs and then updates the appropriate LogModule's log level. Both the integer and string versions of the LogLevel enum are supported. For example setting the pref "logging.Foo" to "Verbose" will set the LogModule for "Foo" to the LogLevel::Verbose level. Setting "logging.Bar" to 4 would set the LogModule for "Bar" to the LogLevel::Debug level. 1187
Logging.cpp A helper class providing reference counting for FILE*. It encapsulates the following: - the FILE handle - the order number it was created for when rotating (actual path) - number of active references 22111
Logging.h Safely converts an integer into a valid LogLevel. 11421
MacHelpers.h 518
MacHelpers.mm 1017
MacStringHelpers.h 582
MacStringHelpers.mm 993
MemoryInfo.cpp static 2991
MemoryInfo.h MemoryInfo is a helper class which describes the attributes and sizes of a particular region of VM memory on Windows. It roughtly corresponds to the values in a MEMORY_BASIC_INFORMATION struct, summed over an entire region or memory. 2090
MemoryMapping.cpp 6694
MemoryMapping.h MemoryMapping is a helper class which describes an entry in the Linux /proc/<pid>/smaps file. See procfs(5) for details on the entry format. The GetMemoryMappings() function returns an array of such entries, sorted by start address, one for each entry in the current process's address space. 6156
MemoryReportingProcess.h 1362
MemoryTelemetry.cpp static 17376
MemoryTelemetry.h Periodically gathers memory usage metrics after cycle collection, and populates telemetry histograms with their values. 2322
NSPRLogModulesParser.cpp 1481
NSPRLogModulesParser.h Helper function that parses the legacy NSPR_LOG_MODULES env var format for specifying log levels and logging options. @param aLogModules The log modules configuration string. @param aCallback The callback to invoke for each log module config entry. 829
OwningNonNull.h A class for non-null strong pointers to reference-counted objects. 6214
ShutdownPhase.h 769
SizeOfState.h 2473
StaticLocalPtr.h StaticLocalAutoPtr and StaticLocalRefPtr are like nsAutoPtr and nsRefPtr, except they are suitable for use as "magic static" local variables -- that is, they are able to take advantage of C++11's guarantee of thread safety during initialization by atomically constructing both the smart pointer itself as well as the object being pointed to. A static local instance of StaticLocal{Auto,Ref}Ptr does not cause the compiler to emit any atexit calls. In order to accomplish this, StaticLocal{Auto,Ref}Ptr must have a trivial destructor. As a consequence, it does not delete/release its raw pointer upon destruction. The clang plugin, run as part of our "static analysis" builds, makes it a compile-time error to use StaticLocal{Auto,Ref}Ptr as anything except a static local variable. StaticLocal{Auto,Ref}Ptr have a limited interface as compared to ns{Auto,Ref}Ptr; this is intentional, since their range of acceptable uses is smaller. 7997
StaticMonitor.h 3033
StaticMutex.h StaticMutex is a Mutex that can (and in fact, must) be used as a global/static variable. The main reason to use StaticMutex as opposed to StaticAutoPtr<OffTheBooksMutex> is that we instantiate the StaticMutex in a thread-safe manner the first time it's used. The same caveats that apply to StaticAutoPtr apply to StaticMutex. In particular, do not use StaticMutex as a stack variable or a class instance variable, because this class relies on the fact that global variablies are initialized to 0 in order to initialize mMutex. It is only safe to use StaticMutex as a global or static variable. 3542
StaticPtr.h StaticAutoPtr and StaticRefPtr are like nsAutoPtr and nsRefPtr, except they are suitable for use as global variables. In particular, a global instance of Static{Auto,Ref}Ptr doesn't cause the compiler to emit a static initializer (in release builds, anyway). In order to accomplish this, Static{Auto,Ref}Ptr must have a trivial constructor and destructor. As a consequence, it cannot initialize its raw pointer to 0 on construction, and it cannot delete/release its raw pointer upon destruction. Since the compiler guarantees that all global variables are initialized to 0, these trivial constructors are safe. Since we rely on this, the clang plugin, run as part of our "static analysis" builds, makes it a compile-time error to use Static{Auto,Ref}Ptr as anything except a global variable. Static{Auto,Ref}Ptr have a limited interface as compared to ns{Auto,Ref}Ptr; this is intentional, since their range of acceptable uses is smaller. 8265
TupleCycleCollection.h 1055
components.conf 1148
moz.build 6253
nsAgg.h \ Returns the nsISupports pointer of the inner object (aka the \ aggregatee). This pointer is really only useful to the outer object \ (aka the aggregator), which can use it to hold on to the inner \ object. Anything else wants the nsISupports pointer of the outer \ object (gotten by QI'ing inner or outer to nsISupports). This method \ returns a non-addrefed pointer. \ @return the nsISupports pointer of the inner object \ 19171
nsAlgorithm.h 1661
nsAutoPtr.h / // template <class T> class nsAutoPtrGetterTransfers; template <class T> class nsAutoPtr { private: static_assert(!mozilla::IsScalar<T>::value, "If you are using " "nsAutoPtr to hold an array, use UniquePtr<T[]> instead"); void** begin_assignment() { assign(0); return reinterpret_cast<void**>(&mRawPtr); } void assign(T* aNewPtr) { T* oldPtr = mRawPtr; if (aNewPtr && aNewPtr == oldPtr) { MOZ_CRASH("Logic flaw in the caller"); } mRawPtr = aNewPtr; delete oldPtr; } // |class Ptr| helps us prevent implicit "copy construction" // through |operator T*() const| from a |const nsAutoPtr<T>| // because two implicit conversions in a row aren't allowed. // It still allows assignment from T* through implicit conversion // from |T*| to |nsAutoPtr<T>::Ptr| class Ptr { public: MOZ_IMPLICIT Ptr(T* aPtr) : mPtr(aPtr) {} operator T*() const { return mPtr; } private: T* MOZ_NON_OWNING_REF mPtr; }; private: T* MOZ_OWNING_REF mRawPtr; public: typedef T element_type; ~nsAutoPtr() { delete mRawPtr; } // Constructors nsAutoPtr() : mRawPtr(0) // default constructor {} MOZ_IMPLICIT nsAutoPtr(Ptr aRawPtr) : mRawPtr(aRawPtr) // construct from a raw pointer (of the right type) {} // This constructor shouldn't exist; we should just use the && // constructor. nsAutoPtr(nsAutoPtr<T>& aSmartPtr) : mRawPtr(aSmartPtr.forget()) // Construct by transferring ownership from another smart pointer. {} template <typename I> MOZ_IMPLICIT nsAutoPtr(nsAutoPtr<I>& aSmartPtr) : mRawPtr(aSmartPtr.forget()) // Construct by transferring ownership from another smart pointer. {} nsAutoPtr(nsAutoPtr<T>&& aSmartPtr) : mRawPtr(aSmartPtr.forget()) // Construct by transferring ownership from another smart pointer. {} template <typename I> MOZ_IMPLICIT nsAutoPtr(nsAutoPtr<I>&& aSmartPtr) : mRawPtr(aSmartPtr.forget()) // Construct by transferring ownership from another smart pointer. {} // Assignment operators nsAutoPtr<T>& operator=(T* aRhs) // assign from a raw pointer (of the right type) { assign(aRhs); return *this; } nsAutoPtr<T>& operator=(nsAutoPtr<T>& aRhs) // assign by transferring ownership from another smart pointer. { assign(aRhs.forget()); return *this; } template <typename I> nsAutoPtr<T>& operator=(nsAutoPtr<I>& aRhs) // assign by transferring ownership from another smart pointer. { assign(aRhs.forget()); return *this; } nsAutoPtr<T>& operator=(nsAutoPtr<T>&& aRhs) { assign(aRhs.forget()); return *this; } template <typename I> nsAutoPtr<T>& operator=(nsAutoPtr<I>&& aRhs) { assign(aRhs.forget()); return *this; } // Other pointer operators T* get() const /* Prefer the implicit conversion provided automatically by |operator T*() const|. Use |get()| _only_ to resolve ambiguity. 9613
nsAutoRef.h template <class T> class nsAutoRef A class that holds a handle to a resource that must be released. No reference is added on construction. No copy constructor nor copy assignment operators are available, so the resource will be held until released on destruction or explicitly |reset()| or transferred through provided methods. The publicly available methods are the public methods on this class and its public base classes |nsAutoRefBase<T>| and |nsSimpleRef<T>|. For ref-counted resources see also |nsCountedRef<T>|. For function return values see |nsReturnRef<T>|. For each class |T|, |nsAutoRefTraits<T>| or |nsSimpleRef<T>| must be specialized to use |nsAutoRef<T>| and |nsCountedRef<T>|. @param T A class identifying the type of reference held by the |nsAutoRef<T>| and the unique set methods for managing references to the resource (defined by |nsAutoRefTraits<T>| or |nsSimpleRef<T>|). Often this is the class representing the resource. Sometimes a new possibly-incomplete class may need to be declared. Example: An Automatically closing file descriptor // References that are simple integral types (as file-descriptors are) // usually need a new class to represent the resource and how to handle its // references. class nsRawFD; // Specializing nsAutoRefTraits<nsRawFD> describes how to manage file // descriptors, so that nsAutoRef<nsRawFD> provides automatic closing of // its file descriptor on destruction. template <> class nsAutoRefTraits<nsRawFD> { public: // The file descriptor is held in an int. typedef int RawRef; // -1 means that there is no file associated with the handle. static int Void() { return -1; } // The file associated with a file descriptor is released with close(). static void Release(RawRef aFD) { close(aFD); } }; // A function returning a file descriptor that must be closed. nsReturnRef<nsRawFD> get_file(const char *filename) { // Constructing from a raw file descriptor assumes ownership. nsAutoRef<nsRawFD> fd(open(filename, O_RDONLY)); fcntl(fd, F_SETFD, FD_CLOEXEC); return fd.out(); } void f() { unsigned char buf[1024]; // Hold a file descriptor for /etc/hosts in fd1. nsAutoRef<nsRawFD> fd1(get_file("/etc/hosts")); nsAutoRef<nsRawFD> fd2; fd2.steal(fd1); // fd2 takes the file descriptor from fd1 ssize_t count = read(fd1, buf, 1024); // error fd1 has no file count = read(fd2, buf, 1024); // reads from /etc/hosts // If the file descriptor is not stored then it is closed. get_file("/etc/login.defs"); // login.defs is closed // Now use fd1 to hold a file descriptor for /etc/passwd. fd1 = get_file("/etc/passwd"); // The nsAutoRef<nsRawFD> can give up the file descriptor if explicitly // instructed, but the caller must then ensure that the file is closed. int rawfd = fd1.disown(); // Assume ownership of another file descriptor. fd1.own(open("/proc/1/maps"); // On destruction, fd1 closes /proc/1/maps and fd2 closes /etc/hosts, // but /etc/passwd is not closed. } 20045
nsCOMPtr.cpp 3533
nsCOMPtr.h Having problems? See the User Manual at: http://www.mozilla.org/projects/xpcom/nsCOMPtr.html nsCOMPtr better than a raw pointer for owning objects -- scc 48230
nsCRTGlue.cpp 8037
nsCRTGlue.h Scan a string for the first character that is *not* in a set of delimiters. If the string is only delimiter characters, the end of the string is returned. @param aDelims The set of delimiters (null-terminated) @param aStr The string to search (null-terminated) 4851
nsClassInfoImpl.cpp 1661
nsCom.h 390
nsConsoleMessage.cpp Base implementation for console messages. 1163
nsConsoleMessage.h __nsconsolemessage_h__ 809
nsConsoleService.cpp Maintains a circular buffer of recent messages, and notifies listeners when new messages are logged. 14668
nsConsoleService.h nsConsoleService class declaration. 3220
nsCrashOnException.cpp 1128
nsCrashOnException.h 745
nsCycleCollectionNoteChild.h 3131
nsCycleCollectionNoteRootCallback.h 1245
nsCycleCollectionParticipant.cpp 1260
nsCycleCollectionParticipant.h Note: the following two IIDs only differ in one bit in the last byte. This is a hack and is intentional in order to speed up the comparison inside NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED. 51731
nsCycleCollectionTraversalCallback.h 2235
nsCycleCollector.cpp 125290
nsCycleCollector.h 2450
nsCycleCollectorTraceJSHelpers.cpp 3055
nsDebug.h Warn if the given condition is true. The condition is evaluated in both release and debug builds, and the result is an expression which can be used in subsequent expressions, such as: if (NS_WARN_IF(NS_FAILED(rv)) { return rv; } This explicit warning and return is preferred to the NS_ENSURE_* macros which hide the warning and the return control flow. This macro can also be used outside of conditions just to issue a warning, like so: Unused << NS_WARN_IF(NS_FAILED(FnWithSideEffects()); (The |Unused <<| is necessary because of the MOZ_MUST_USE annotation.) However, note that the argument to this macro is evaluated in all builds. If you just want a warning assertion, it is better to use NS_WARNING_ASSERTION (which evaluates the condition only in debug builds) like so: NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "operation failed"); @note This is C++-only 13888
nsDebugImpl.cpp for getenv() 15756
nsDebugImpl.h If we are in multiprocess mode, return the process name. 1361
nsDumpUtils.cpp The following code supports triggering a registered callback upon receiving a specific signal. Take about:memory for example, we register 1. doGCCCDump for doMemoryReport 2. doMemoryReport for sDumpAboutMemorySignum(SIGRTMIN) and sDumpAboutMemoryAfterMMUSignum(SIGRTMIN+1). When we receive one of these signals, we write the signal number to a pipe. The IO thread then notices that the pipe has been written to, and kicks off the appropriate task on the main thread. This scheme is similar to using signalfd(), except it's portable and it doesn't require the use of sigprocmask, which is problematic because it masks signals received by child processes. In theory, we could use Chromium's MessageLoopForIO::CatchSignal() for this. But that uses libevent, which does not handle the realtime signals (bug 794074). 14388
nsDumpUtils.h Abstract base class for something which watches an fd and takes action when we can read from it without blocking. 5157
nsError.h @name Standard Error Handling Macros @return 0 or 1 (false/true with bool type for C++) 3056
nsErrorService.cpp 1818
nsErrorService.h 847
nsGZFileWriter.cpp 2694
nsGZFileWriter.h A simple class for writing .gz files. 1218
nsIClassInfoImpl.h This header file provides macros which help you make your class implement nsIClassInfo. Implementing nsIClassInfo is particularly helpful if you have a C++ class which implements multiple interfaces and which you access from JavaScript. If that class implements nsIClassInfo, the JavaScript code won't have to call QueryInterface on instances of the class; all methods from all interfaces returned by GetInterfaces() will be available automagically. Here's all you need to do. Given a class class nsFooBar : public nsIFoo, public nsIBar { }; you should already have the following nsISupports implementation in its cpp file: NS_IMPL_ISUPPORTS(nsFooBar, nsIFoo, nsIBar). Change this to NS_IMPL_CLASSINFO(nsFooBar, nullptr, 0, NS_FOOBAR_CID) NS_IMPL_ISUPPORTS_CI(nsFooBar, nsIFoo, nsIBar) If nsFooBar is threadsafe, change the 0 above to nsIClassInfo::THREADSAFE. If it's a singleton, use nsIClassInfo::SINGLETON. The full list of flags is in nsIClassInfo.idl. The nullptr parameter is there so you can pass a function for converting from an XPCOM object to a scriptable helper. Unless you're doing specialized JS work, you can probably leave this as nullptr. This file also defines the NS_IMPL_QUERY_INTERFACE_CI macro, which you can use to replace NS_IMPL_QUERY_INTERFACE, if you use that instead of NS_IMPL_ISUPPORTS. That's it! The rest is gory details. Notice that nsFooBar didn't need to inherit from nsIClassInfo in order to "implement" it. However, after adding these macros to nsFooBar, you you can QueryInterface an instance of nsFooBar to nsIClassInfo. How can this be? The answer lies in the NS_IMPL_ISUPPORTS_CI macro. It modifies nsFooBar's QueryInterface implementation such that, if we ask to QI to nsIClassInfo, it returns a singleton object associated with the class. (That singleton is defined by NS_IMPL_CLASSINFO.) So all nsFooBar instances will return the same object when QI'ed to nsIClassInfo. (You can see this in NS_IMPL_QUERY_CLASSINFO below.) This hack breaks XPCOM's rules, since if you take an instance of nsFooBar, QI it to nsIClassInfo, and then try to QI to nsIFoo, that will fail. On the upside, implementing nsIClassInfo doesn't add a vtable pointer to instances of your class. In principal, you can also implement nsIClassInfo by inheriting from the interface. But some code expects that when it QI's an object to nsIClassInfo, it gets back a singleton which isn't attached to any particular object. If a class were to implement nsIClassInfo through inheritance, that code might QI to nsIClassInfo and keep the resulting object alive, thinking it was only keeping alive the classinfo singleton, but in fact keeping a whole instance of the class alive. See, e.g., bug 658632. Unless you specifically need to have a different nsIClassInfo instance for each instance of your class, you should probably just implement nsIClassInfo as a singleton. 7780
nsIConsoleListener.idl Used by the console service to notify listeners of new console messages. 592
nsIConsoleMessage.idl This is intended as a base interface; implementations may want to provide an object that can be qi'ed to provide more specific message information. 1322
nsIConsoleService.idl Convenience method for logging simple messages. 1644
nsICycleCollectorListener.idl A set of interfaces for recording the cycle collector's work. An instance of nsICycleCollectorListener can be configured to enable various options, then passed to the cycle collector when it runs. Note that additional logging options are available by setting environment variables, as described at the top of nsCycleCollector.cpp. 6945
nsID.cpp Multiplies the_int_var with 16 (0x10) and adds the value of the hexadecimal digit the_char. If it fails it returns false from the function it's used in. 4361
nsID.h A "unique identifier". This is modeled after OSF DCE UUIDs. 5047
nsIDebug2.idl interface to expose information about calls to NS_DebugBreak 2563
nsIErrorService.idl nsIErrorService: This is an interim service that allows nsresult codes to be mapped to string bundles that can be used to look up error messages. String bundle keys can also be mapped. This service will eventually get replaced by extending xpidl to allow errors to be defined. (http://bugzilla.mozilla.org/show_bug.cgi?id=13423). 1265
nsIException.idl Interfaces for representing cross-language exceptions and stack traces. 3539
nsIGZFileWriter.idl A simple interface for writing to a .gz file. Note that the file that this interface produces has a different format than what you'd get if you compressed your data as a gzip stream and dumped the result to a file. The standard gunzip tool cannot decompress a raw gzip stream, but can handle the files produced by this interface. 2460
nsIInterfaceRequestor.idl The nsIInterfaceRequestor interface defines a generic interface for requesting interfaces that a given object might provide access to. This is very similar to QueryInterface found in nsISupports. The main difference is that interfaces returned from GetInterface() are not required to provide a way back to the object implementing this interface. The semantics of QI() dictate that given an interface A that you QI() on to get to interface B, you must be able to QI on B to get back to A. This interface however allows you to obtain an interface C from A that may or most likely will not have the ability to get back to A. 1532
nsIInterfaceRequestorUtils.cpp 950
nsIInterfaceRequestorUtils.h 1495
nsIMacPreferencesReader.idl This interface is designed to provide scriptable access to the macOS preferences system. This interface is highly macOS specific. 938
nsIMacUtils.idl nsIMacUtils: Generic globally-available Mac-specific utilities. 849
nsIMemory.idl nsIMemory: interface to allocate and deallocate memory. Also provides for notifications in low-memory situations. The frozen exported symbols moz_xmalloc, moz_xrealloc, and free provide a more efficient way to access XPCOM memory allocation. Using those symbols is preferred to using the methods on this interface. A client that wishes to be notified of low memory situations (for example, because the client maintains a large memory cache that could be released when memory is tight) should register with the observer service (see nsIObserverService) using the topic "memory-pressure". There are specific types of notications that can occur. These types will be passed as the |aData| parameter of the of the "memory-pressure" notification: "low-memory" This will be passed as the extra data when the pressure observer is being asked to flush for low-memory conditions. "low-memory-ongoing" This will be passed when we continue to be in a low-memory condition and we want to flush caches and do other cheap forms of memory minimization, but heavy handed approaches like a GC are unlikely to succeed. "heap-minimize" This will be passed as the extra data when the pressure observer is being asked to flush because of a heap minimize call. 2547
nsIMemoryInfoDumper.idl Callback interface for |dumpGCAndCCLogsToFile|, below. Note that these method calls can occur before |dumpGCAndCCLogsToFile| returns. 6614
nsIMemoryReporter.idl Memory reporters measure Firefox's memory usage. They are primarily used to generate the about:memory page. You should read https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Memory_reporting before writing a memory reporter. 25822
nsIMessageLoop.idl This service allows access to the current thread's Chromium MessageLoop instance, with some extra sugar added. If you're calling from C++, it may or may not make sense for you to use this interface. If you're calling from JS, you don't have a choice! Right now, you can only call PostIdleTask(), and the wrath of khuey is stopping you from adding other methods. nsIMessageLoop's contractid is "@mozilla.org/message-loop;1". 1496
nsINIParser.cpp 7890
nsINIParser.h Initialize the INIParser with a nsIFile. If this method fails, no other methods should be called. This method reads and parses the file, the class does not hold a file handle open. An instance must only be initialized once. 4805
nsISecurityConsoleMessage.idl Holds localization message tag and message category for security related console messages. 592
nsISizeOf.h Measures the size of the things pointed to by the object. 1257
nsISupports.idl The mother of all xpcom interfaces. 1188
nsISupportsBase.h @{ 2502
nsISupportsImpl.cpp 1523
nsISupportsImpl.h needed for cargo-culting headers 67732
nsISupportsUtils.h Macro for adding a reference to an interface. @param _ptr The interface pointer. 4739
nsIUUIDGenerator.idl nsIUUIDGenerator is implemented by a service that can generate universally unique identifiers, ideally using any platform-native method for generating UUIDs. 1407
nsIVersionComparator.idl Version strings are dot-separated sequences of version-parts. A version-part consists of up to four parts, all of which are optional: <number-a><string-b><number-c><string-d (everything else)> A version-part may also consist of a single asterisk "*" which indicates "infinity". Numbers are base-10, and are zero if left out. Strings are compared bytewise. For additional backwards compatibility, if "string-b" is "+" then "number-a" is incremented by 1 and "string-b" becomes "pre". 1.0pre1 < 1.0pre2 < 1.0 == 1.0.0 == 1.0.0.0 < 1.1pre == 1.1pre0 == 1.0+ < 1.1pre1a < 1.1pre1 < 1.1pre10a < 1.1pre10 Although not required by this interface, it is recommended that numbers remain within the limits of a signed char, i.e. -127 to 128. 1528
nsIWeakReference.idl An instance of |nsIWeakReference| is a proxy object that cooperates with its referent to give clients a non-owning, non-dangling reference. Clients own the proxy, and should generally manage it with an |nsCOMPtr| (see the type |nsWeakPtr| for a |typedef| name that stands out) as they would any other XPCOM object. The |QueryReferent| member function provides a (hopefully short-lived) owning reference on demand, through which clients can get useful access to the referent, while it still exists. @version 1.0 @see nsISupportsWeakReference @see nsWeakReference @see nsWeakPtr 3647
nsIWeakReferenceUtils.h / // a type-safe shortcut for calling the |QueryReferent()| member function // T must inherit from nsIWeakReference, but the cast may be ambiguous. template <class T, class DestinationType> inline nsresult CallQueryReferent(T* aSource, DestinationType** aDestination) { MOZ_ASSERT(aSource, "null parameter"); MOZ_ASSERT(aDestination, "null parameter"); return aSource->QueryReferent(NS_GET_TEMPLATE_IID(DestinationType), reinterpret_cast<void**>(aDestination)); } inline const nsQueryReferent do_QueryReferent(nsIWeakReference* aRawPtr, nsresult* aError = 0) { return nsQueryReferent(aRawPtr, aError); } /** Deprecated, use |do_GetWeakReference| instead. 3286
nsInterfaceRequestorAgg.cpp 2615
nsInterfaceRequestorAgg.h This function returns an instance of nsIInterfaceRequestor that aggregates two nsIInterfaceRequestor instances. Its GetInterface method queries aFirst for the requested interface and will query aSecond only if aFirst failed to supply the requested interface. Both aFirst and aSecond may be null, and will be released on the main thread when the aggregator is destroyed. 1377
nsMacPreferencesReader.h 1098
nsMacPreferencesReader.mm 2862
nsMacUtilsImpl.cpp 12830
nsMacUtilsImpl.h DEBUG 2720
nsMaybeWeakPtr.h 4587
nsMemory.cpp 1093
nsMemory.h 30a04e40-38e7-11d4-8cf5-0060b0fc14a3 4597
nsMemoryImpl.cpp static 4574
nsMemoryImpl.h 1594
nsMemoryInfoDumper.cpp The following code supports dumping about:memory upon receiving a signal. We listen for the following signals: - SIGRTMIN: Dump our memory reporters (and those of our child processes), - SIGRTMIN + 1: Dump our memory reporters (and those of our child processes) after minimizing memory usage, and - SIGRTMIN + 2: Dump the GC and CC logs in this and our child processes. When we receive one of these signals, we write the signal number to a pipe. The IO thread then notices that the pipe has been written to, and kicks off the appropriate task on the main thread. This scheme is similar to using signalfd(), except it's portable and it doesn't require the use of sigprocmask, which is problematic because it masks signals received by child processes. In theory, we could use Chromium's MessageLoopForIO::CatchSignal() for this. But that uses libevent, which does not handle the realtime signals (bug 794074). 25361
nsMemoryInfoDumper.h This class facilitates dumping information about our memory usage to disk. Its cpp file also has Linux-only code which watches various OS signals and dumps memory info upon receiving a signal. You can activate these listeners by calling Initialize(). 1578
nsMemoryReporterManager.cpp 89869
nsMemoryReporterManager.h 11967
nsMessageLoop.cpp This Task runs its nsIRunnable when Run() is called, or after aEnsureRunsAfterMS milliseconds have elapsed since the object was constructed. Note that the MessageLoop owns this object and will delete it after it calls Run(). Tread lightly. 4919
nsMessageLoop.h nsMessageLoop implements nsIMessageLoop, which wraps Chromium's MessageLoop class and adds a bit of sugar. 1044
nsObjCExceptions.h NOTE: Macros that claim to abort no longer abort, see bug 486574. If you actually want to log and abort, call "nsObjCExceptionLogAbort" from an exception handler. At some point we will fix this by replacing all macros in the tree with appropriately-named macros. 7692
nsQueryObject.h / template <class T> class MOZ_STACK_CLASS nsQueryObject final : public nsCOMPtr_helper { public: explicit nsQueryObject(T* aRawPtr) : mRawPtr(aRawPtr) {} virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, void** aResult) const override { nsresult status = mRawPtr ? mRawPtr->QueryInterface(aIID, aResult) : NS_ERROR_NULL_POINTER; return status; } private: T* MOZ_NON_OWNING_REF mRawPtr; }; template <class T> class MOZ_STACK_CLASS nsQueryObjectWithError final : public nsCOMPtr_helper { public: nsQueryObjectWithError(T* aRawPtr, nsresult* aErrorPtr) : mRawPtr(aRawPtr), mErrorPtr(aErrorPtr) {} virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, void** aResult) const override { nsresult status = mRawPtr ? mRawPtr->QueryInterface(aIID, aResult) : NS_ERROR_NULL_POINTER; if (mErrorPtr) { mErrorPtr = status; } return status; } private: T* MOZ_NON_OWNING_REF mRawPtr; nsresult* mErrorPtr; }; /**************************************************************************** 2932
nsSecurityConsoleMessage.cpp 1020
nsSecurityConsoleMessage.h 1050
nsSystemInfo.cpp 45420
nsSystemInfo.h IsExclusive 2950
nsTraceRefcnt.cpp yield 36245
nsTraceRefcnt.h Tell nsTraceRefcnt whether refcounting, allocation, and destruction activity is legal. This is used to trigger assertions for any such activity that occurs because of static constructors or destructors. 1107
nsUUIDGenerator.cpp initialize random number generator using NSPR random noise 4281
nsUUIDGenerator.h _NSUUIDGENERATOR_H_ 1237
nsVersionComparator.cpp Parse a version part into a number and "extra text". @returns A pointer to the next versionpart, or null if none. 7856
nsVersionComparator.h In order to compare version numbers in Mozilla, you need to use the mozilla::Version class. You can construct an object of this type by passing in a string version number to the constructor. Objects of this type can be compared using the standard comparison operators. For example, let's say that you want to make sure that a given version number is not older than 15.a2. Here's how you would write a function to do that. bool IsVersionValid(const char* version) { return mozilla::Version("15.a2") <= mozilla::Version(version); } Or, since Version's constructor is implicit, you can simplify this code: bool IsVersionValid(const char* version) { return mozilla::Version("15.a2") <= version; } 3390
nsVersionComparatorImpl.cpp 798
nsVersionComparatorImpl.h 974
nsWeakReference.cpp 3889
nsWeakReference.h 1205
nsWindowsHelpers.h 7432
nscore.h Make sure that we have the proper platform specific c++ definitions needed by nscore.h 8326
nsrootidl.idl Root idl declarations to be used by all. 3064