Name Description Size
AppShutdown.cpp 11660
AppShutdown.h Returns the current exit code that the process will be terminated with. 2778
AutoRestore.h functions for restoring saved values at the end of a C++ scope 1181
AvailableMemoryTracker.cpp ownsWeak 13443
AvailableMemoryTracker.h 939
ClearOnShutdown.cpp 2409
ClearOnShutdown.h This header exports two public methods in the mozilla namespace: template<class SmartPtr> void ClearOnShutdown(SmartPtr *aPtr, aPhase=ShutdownPhase::XPCOMShutdownFinal) 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, RefPtr, 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::XPCOMShutdownFinal) 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. 4761
CodeAddressService.h 8584
CountingAllocatorBase.h 5375
CycleCollectedJSContext.cpp 28541
CycleCollectedJSContext.h 13012
CycleCollectedJSRuntime.cpp 68831
CycleCollectedJSRuntime.h 15057
Debug.cpp 542
Debug.h 576
DebuggerOnGCRunnable.cpp static 1430
DebuggerOnGCRunnable.h 1102
DeferredFinalize.cpp 1007
DeferredFinalize.h 1316
EnumeratedArrayCycleCollection.h 1321 A nserror module. When used with a `with` statement, binds the itself to 63622
ErrorNames.cpp 2339
ErrorNames.h 1053
GkRustUtils.cpp static 800
GkRustUtils.h 648
HoldDropJSObjects.cpp 1909
HoldDropJSObjects.h Classes that hold strong references to JS GC things such as `JSObjects` and `JS::Values` (e.g. `JS::Heap<JSObject*> mFoo;`) must use these, generally by calling `HoldJSObjects(this)` and `DropJSObjects(this)` in the ctor and dtor respectively. For classes that are wrapper cached and hold no other strong references to JS GC things, there's no need to call these; it will be taken care of automatically by nsWrapperCache. 2263
IntentionalCrash.h 1791
JSObjectHolder.cpp 412
JSObjectHolder.h 1365
LogCommandLineHandler.cpp 2466
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. 5454
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 29904
Logging.h Safely converts an integer into a valid LogLevel. 11078
MacHelpers.h 518 1019
MacStringHelpers.h 582 995
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. 2137
MemoryMapping.cpp 6889
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. 6256
MemoryReportingProcess.h 1395
MemoryTelemetry.cpp static 16869
MemoryTelemetry.h Periodically gathers memory usage metrics after cycle collection, and populates telemetry histograms with their values. 1844
NSPRLogModulesParser.cpp 2163
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. 6241
ShutdownPhase.h 939
SizeOfState.h 2446
StaticLocalPtr.h StaticLocalAutoPtr and StaticLocalRefPtr are like UniquePtr and RefPtr, 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. 7995
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. 2601
StaticPtr.h StaticAutoPtr and StaticRefPtr are like UniquePtr and RefPtr, 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. 8263
TupleCycleCollection.h 1090
components.conf 1148 6229
nsAlgorithm.h 1637
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 function return values see |nsReturnRef<T>|. For each class |T|, |nsAutoRefTraits<T>| or |nsSimpleRef<T>| must be specialized to use |nsAutoRef<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. } 17223
nsCOMPtr.cpp 3407
nsCOMPtr.h Having problems? See the User Manual at: nsCOMPtr better than a raw pointer for owning objects -- scc 49093
nsCRTGlue.cpp 8909
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. 1597
nsConsoleMessage.h __nsconsolemessage_h__ 848
nsConsoleService.cpp Maintains a circular buffer of recent messages, and notifies listeners when new messages are logged. 14750
nsConsoleService.h nsConsoleService class declaration. 3468
nsCrashOnException.cpp 1128
nsCrashOnException.h 745
nsCycleCollectionNoteChild.h 3099
nsCycleCollectionNoteRootCallback.h 1317
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. 50827
nsCycleCollectionTraversalCallback.h 2258
nsCycleCollector.cpp 124889
nsCycleCollector.h 2507
nsCycleCollectorTraceJSHelpers.cpp 3096
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 [[nodiscard]] 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 14780
nsDebugImpl.cpp for getenv() 15929
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). 14364
nsDumpUtils.h Abstract base class for something which watches an fd and takes action when we can read from it without blocking. 5148
nsError.h @name Standard Error Handling Macros @return 0 or 1 (false/true with bool type for C++) 3080
nsErrorService.cpp 1844
nsErrorService.h 847
nsGZFileWriter.cpp 2694
nsGZFileWriter.h A simple class for writing .gz files. 1220
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. 8644
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. 1376
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. 6944
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 2949
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. ( 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. 2465
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. 6865
nsIMemoryReporter.idl Memory reporters measure Firefox's memory usage. They are primarily used to generate the about:memory page. You should read before writing a memory reporter. 25526
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 ";1". 1496
nsINIParser.cpp 7935
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 3938
nsISupportsImpl.h needed for cargo-culting headers 75922
nsISupportsUtils.h Macro for adding a reference to an interface. @param _ptr The interface pointer. 4715
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.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 2609
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 3045
nsMacUtilsImpl.cpp 18307
nsMacUtilsImpl.h DEBUG 3613
nsMaybeWeakPtr.h 4593
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). 25289
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 89129
nsMemoryReporterManager.h 12352
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. 4812
nsMessageLoop.h nsMessageLoop implements nsIMessageLoop, which wraps Chromium's MessageLoop class and adds a bit of sugar. 1044
nsObjCExceptions.h 2015 1465
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; }; /**************************************************************************** 2956
nsSecurityConsoleMessage.cpp 1020
nsSecurityConsoleMessage.h 1050
nsSystemInfo.cpp 49286
nsSystemInfo.h IsExclusive 3224
nsTraceRefcnt.cpp yield 35503
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. 933
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; } 3474
nsVersionComparatorImpl.cpp 798
nsVersionComparatorImpl.h 974
nsWeakReference.cpp 3889
nsWeakReference.h 2367
nsWindowsHelpers.h 7877
nscore.h Make sure that we have the proper platform specific c++ definitions needed by nscore.h 8888
nsrootidl.idl Root idl declarations to be used by all. 3083