Name Description Size
ArenaAllocator.h A very simple arena allocator based on NSPR's PLArena. The arena allocator only provides for allocation, all memory is retained until the allocator is destroyed. It's useful for situations where a large amount of small transient allocations are expected. Example usage: // Define an allocator that is page sized and returns allocations that are // 8-byte aligned. ArenaAllocator<4096, 8> a; for (int i = 0; i < 1000; i++) { DoSomething(a.Allocate(i)); } 5982
ArenaAllocatorExtensions.h Extensions to the ArenaAllocator class. 2476
ArrayIterator.h 4164 1896
AtomArray.h 548
components.conf 841
Dafsa.cpp 5247
Dafsa.h A deterministic acyclic finite state automaton suitable for storing static dictionaries of tagged ascii strings. Consider using this if you have a very large set of strings that need an associated enum value. Currently the string tag is limited by `` to a value of [0-4]. In theory [0-15] can easily be supported. See `` for more details. 1445 15909
IncrementalTokenizer.cpp 4938
IncrementalTokenizer.h The consumer callback. The function is called for every single token as found in the input. Failure result returned by this callback stops the tokenization immediately and bubbles to result of Feed/FinishInput. Fragment()s of consumed tokens are ensured to remain valid until next call to Feed/FinishInput and are pointing to a single linear buffer. Hence, those can be safely used to accumulate the data for processing after Feed/FinishInput returned. 4686 3579
MruCache.h 4926
nsArray.cpp 4266
nsArray.h Both of these factory functions create a cycle-collectable array on the main thread and a non-cycle-collectable array on other threads. 2367
nsArrayEnumerator.cpp 5937
nsArrayEnumerator.h 1259
nsArrayUtils.cpp 719
nsArrayUtils.h 1226
nsAtom.h 9685
nsAtomTable.cpp 24875
nsAtomTable.h 788
nsBaseHashtable.h the private nsTHashtable::EntryType class used by nsBaseHashtable @see nsTHashtable for the specification of this class @see nsBaseHashtable for template parameters 13048
nsCharSeparatedTokenizer.h This parses a SeparatorChar-separated string into tokens. Whitespace surrounding tokens is not treated as part of tokens, however whitespace inside a token is. If the final token is the empty string, it is not returned. Some examples, with SeparatorChar = ',': "foo, bar, baz" -> "foo" "bar" "baz" "foo,bar,baz" -> "foo" "bar" "baz" "foo , bar hi , baz" -> "foo" "bar hi" "baz" "foo, ,bar,baz" -> "foo" "" "bar" "baz" "foo,,bar,baz" -> "foo" "" "bar" "baz" "foo,bar,baz," -> "foo" "bar" "baz" The function used for whitespace detection is a template argument. By default, it is NS_IsAsciiWhitespace. 6332
nsCheapSets.h A set that takes up minimal size when there are 0 or 1 entries in the set. Use for cases where sizes of 0 and 1 are even slightly common. 3802
nsClassHashtable.h templated hashtable class maps keys to C++ object pointers. See nsBaseHashtable for complete declaration. @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h for a complete specification. @param Class the class-type being wrapped @see nsInterfaceHashtable, nsClassHashtable 3381
nsCOMArray.cpp 7263
nsCOMArray.h 14529
nsCRT.cpp MODULE NOTES: @update gess7/30/98 Much as I hate to do it, we were using string compares wrong. Often, programmers call functions like strcmp(s1,s2), and pass one or more null strings. Rather than blow up on these, I've added quick checks to ensure that cases like this don't cause us to fail. In general, if you pass a null into any of these string compare routines, we simply return 0. 3165
nsCRT.h XP_UNIX 3368
nsDataHashtable.h templated hashtable class maps keys to simple datatypes. See nsBaseHashtable for complete declaration @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h for a complete specification. @param DataType the simple datatype being wrapped @see nsInterfaceHashtable, nsClassHashtable 2053
nsDeque.cpp Standard constructor @param deallocator, called by Erase and ~nsDeque 7605
nsDeque.h MODULE NOTES: The Deque is a very small, very efficient container object than can hold items of type void*, offering the following features: - Its interface supports pushing, popping, and peeking of items at the back or front, and retrieval from any position. - It can iterate over items via a ForEach method, range-for, or an iterator class. - When full, it can efficiently resize dynamically. NOTE: The only bit of trickery here is that this deque is built upon a ring-buffer. Like all ring buffers, the first item may not be at index[0]. The mOrigin member determines where the first child is. This point is quietly hidden from customers of this class. 8989
nsEnumeratorUtils.cpp 6274
nsEnumeratorUtils.h nsEnumeratorUtils_h__ 888
nsExpirationTracker.h Data used to track the expiration state of an object. We promise that this is 32 bits so that objects that includes this as a field can pad and align efficiently. 20632
nsGkAtoms.cpp 2276
nsGkAtoms.h 6972
nsHashKeys.h @file nsHashKeys.h standard HashKey classes for nsBaseHashtable and relatives. Each of these classes follows the nsTHashtable::EntryType specification Lightweight keytypes provided here: nsStringHashKey nsCStringHashKey nsUint32HashKey nsUint64HashKey nsFloatHashKey IntPtrHashKey nsPtrHashKey nsClearingPtrHashKey nsVoidPtrHashKey nsClearingVoidPtrHashKey nsISupportsHashKey nsIDHashKey nsDepCharHashKey nsCharPtrHashKey nsUnicharPtrHashKey nsGenericHashKey 17932
nsHashPropertyBag.cpp nsHashPropertyBagBase implementation. 8858
nsHashPropertyBag.h A cycle collected nsHashPropertyBag for main-thread-only use. 1732
nsIArray.idl nsIArray An indexed collection of elements. Provides basic functionality for retrieving elements at a specific position, searching for elements. Indexes are zero-based, such that the last element in the array is stored at the index length-1. For an array which can be modified, see nsIMutableArray below. Neither interface makes any attempt to protect the individual elements from modification. The convention is that the elements of the array should not be modified. Documentation within a specific interface should describe variations from this convention. It is also convention that if an interface provides access to an nsIArray, that the array should not be QueryInterfaced to an nsIMutableArray for modification. If the interface in question had intended the array to be modified, it would have returned an nsIMutableArray! null is a valid entry in the array, and as such any nsISupports parameters may be null, except where noted. 3763
nsIArrayExtensions.idl Helper interface for allowing scripts to treat nsIArray instances as if they were nsISupportsArray instances while iterating. nsISupportsArray is convenient to iterate over in JavaScript: for (let i = 0; i < array.Count(); ++i) { let elem = array.GetElementAt(i); ... } but doing the same with nsIArray is somewhat less convenient, since queryElementAt is not nearly so nice to use from JavaScript. So we provide this extension interface so interfaces that currently return nsISupportsArray can start returning nsIArrayExtensions and all JavaScript should Just Work. Eventually we'll roll this interface into nsIArray itself, possibly getting rid of the Count() method, as it duplicates nsIArray functionality. 1773
nsIINIParser.idl Enumerates the [section]s available in the INI file. 1360
nsIMutableArray.idl nsIMutableArray A separate set of methods that will act on the array. Consumers of nsIArray should not QueryInterface to nsIMutableArray unless they own the array. As above, it is legal to add null elements to the array. Note also that null elements can be created as a side effect of insertElementAt(). Conversely, if insertElementAt() is never used, and null elements are never explicitly added to the array, then it is guaranteed that queryElementAt() will never return a null value. Any of these methods may throw NS_ERROR_OUT_OF_MEMORY when the array must grow to complete the call, but the allocation fails. 3526
nsINIParserImpl.cpp 4096
nsINIParserImpl.h 1053
nsInterfaceHashtable.h templated hashtable class maps keys to interface pointers. See nsBaseHashtable for complete declaration. @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h for a complete specification. @param Interface the interface-type being wrapped @see nsDataHashtable, nsClassHashtable 5533
nsIObserver.idl This interface is implemented by an object that wants to observe an event corresponding to a topic. 1334
nsIObserverService.idl nsIObserverService Service allows a client listener (nsIObserver) to register and unregister for notifications of specific string referenced topic. Service also provides a way to notify registered listeners and a way to enumerate registered client listeners. 2643
nsIPersistentProperties.h __gen_nsIPersistentProperties_h__ 552
nsIPersistentProperties2.idl load a set of name/value pairs from the input stream names and values should be in UTF8 1762
nsIProperties.idl Simple mapping service interface. 1304
nsIProperty.idl nsIVariant based Property support. 666
nsIPropertyBag.idl nsIVariant based Property Bag support. 854
nsIPropertyBag2.idl nsIVariant based Property Bag support. 1554
nsISerializable.idl Initialize the object implementing nsISerializable, which must have been freshly constructed via CreateInstance. All data members that can't be set to default values must have been serialized by write, and should be read from aInputStream in the same order by this method. 1337
nsISimpleEnumerator.idl Used to enumerate over elements defined by its implementor. Although hasMoreElements() can be called independently of getNext(), getNext() must be pre-ceeded by a call to hasMoreElements(). There is no way to "reset" an enumerator, once you obtain one. @version 1.0 2734
nsIStringEnumerator.idl Used to enumerate over an ordered list of strings. 1035
nsISupportsIterators.idl nsISupportsIterators.idl --- IDL defining general purpose iterators 12437
nsISupportsPrimitives.idl nsISupports wrappers for single primitive pieces of data. 5426
nsIVariant.idl The long avoided variant support for xpcom. 6257
nsIWindowsRegKey.idl This interface is designed to provide scriptable access to the Windows registry system ("With Great Power Comes Great Responsibility"). The interface represents a single key in the registry. This interface is highly Win32 specific. 11665
nsIWritablePropertyBag.idl nsIVariant based writable Property Bag support. 894
nsIWritablePropertyBag2.idl nsIVariant based Property Bag support. 1168
nsJSThingHashtable.h namespace JS 1999
nsMathUtils.h round 3542
nsObserverList.cpp 2660
nsObserverList.h nsObserverList_h___ 2098
nsObserverService.cpp process 10774
nsObserverService.h nsObserverService_h___ 1874
nsPersistentProperties.cpp 18511
nsPersistentProperties.h nsPersistentProperties_h___ 1520
nsPointerHashKeys.h Definitions for nsPtrHashKey<T> and nsVoidPtrHashKey. 1417
nsProperties.cpp 1749
nsProperties.h nsProperties_h___ 823
nsQuickSort.cpp - Copyright (c) 1992, 1993 The Regents of the University of California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 5690
nsQuickSort.h We need this because Solaris' version of qsort is broken and causes array bounds reads. 1202
nsRefPtrHashtable.h templated hashtable class maps keys to reference pointers. See nsBaseHashtable for complete declaration. @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h for a complete specification. @param PtrType the reference-type being wrapped @see nsDataHashtable, nsClassHashtable 5626
nsSimpleEnumerator.cpp 2193
nsSimpleEnumerator.h 675
nsStaticAtomUtils.h 1223
nsStaticNameTable.cpp Class to manage lookup of static names in a table. 5947
nsStaticNameTable.h Classes to manage lookup of static names in a table. 1627
nsStringEnumerator.cpp 8581
nsStringEnumerator.h 4036
nsSupportsPrimitives.cpp / NS_IMPL_ISUPPORTS(nsSupportsID, nsISupportsID, nsISupportsPrimitive) nsSupportsID::nsSupportsID() : mData(nullptr) {} NS_IMETHODIMP nsSupportsID::GetType(uint16_t* aType) { NS_ASSERTION(aType, "Bad pointer"); aType = TYPE_ID; return NS_OK; } NS_IMETHODIMP nsSupportsID::GetData(nsID** aData) { NS_ASSERTION(aData, "Bad pointer"); aData = mData ? mData->Clone() : nullptr; return NS_OK; } NS_IMETHODIMP nsSupportsID::SetData(const nsID* aData) { if (mData) { free(mData); } mData = aData ? aData->Clone() : nullptr; return NS_OK; } NS_IMETHODIMP nsSupportsID::ToString(char** aResult) { NS_ASSERTION(aResult, "Bad pointer"); if (mData) { aResult = mData->ToString(); } else { aResult = moz_xstrdup("null"); } return NS_OK; } /***************************************************************************** nsSupportsCString *************************************************************************** 14717
nsSupportsPrimitives.h / class nsSupportsCString final : public nsISupportsCString { public: NS_DECL_ISUPPORTS NS_DECL_NSISUPPORTSPRIMITIVE NS_DECL_NSISUPPORTSCSTRING nsSupportsCString() {} private: ~nsSupportsCString() {} nsCString mData; }; /************************************************************************** 6029
nsTArray-inl.h 19236
nsTArray.cpp 1285
nsTArray.h namespace JS 100468
nsTArrayForwardDeclare.h 912
nsTHashtable.h a base class for templated hashtables. Clients will rarely need to use this class directly. Check the derived classes first, to see if they will meet your needs. @param EntryType the templated entry-type class that is managed by the hashtable. <code>EntryType</code> must extend the following declaration, and <strong>must not declare any virtual functions or derive from classes with virtual functions.</strong> Any vtable pointer would break the PLDHashTable code. <pre> class EntryType : public PLDHashEntryHdr { public: or friend nsTHashtable<EntryType>; // KeyType is what we use when Get()ing or Put()ing this entry // this should either be a simple datatype (uint32_t, nsISupports*) or // a const reference (const nsAString&) typedef something KeyType; // KeyTypePointer is the pointer-version of KeyType, because // PLDHashTable.h requires keys to cast to <code>const void*</code> typedef const something* KeyTypePointer; EntryType(KeyTypePointer aKey); // A copy or C++11 Move constructor must be defined, even if // AllowMemMove() == true, otherwise you will cause link errors. EntryType(const EntryType& aEnt); // Either this... EntryType(EntryType&& aEnt); // ...or this // the destructor must be defined... or you will cause link errors! ~EntryType(); // KeyEquals(): does this entry match this key? bool KeyEquals(KeyTypePointer aKey) const; // KeyToPointer(): Convert KeyType to KeyTypePointer static KeyTypePointer KeyToPointer(KeyType aKey); // HashKey(): calculate the hash number static PLDHashNumber HashKey(KeyTypePointer aKey); // ALLOW_MEMMOVE can we move this class with memmove(), or do we have // to use the copy constructor? enum { ALLOW_MEMMOVE = true/false }; }</pre> @see nsInterfaceHashtable @see nsDataHashtable @see nsClassHashtable @author "Benjamin Smedberg <>" 18917
nsTObserverArray.cpp 886
nsTObserverArray.h An array of observers. Like a normal array, but supports iterators that are stable even if the array is modified during iteration. The template parameter T is the observer type the array will hold; N is the number of built-in storage slots that come with the array. NOTE: You probably want to use nsTObserverArray, unless you specifically want built-in storage. See below. @see nsTObserverArray, nsTArray 18847
nsTPriorityQueue.h A templatized priority queue data structure that uses an nsTArray to serve as a binary heap. The default comparator causes this to act like a min-heap. Only the LessThan method of the comparator is used. 4444
nsVariant.cpp 59716
nsVariant.h Map the nsAUTF8String, nsUTF8String classes to the nsACString and nsCString classes respectively for now. These defines need to be removed once Jag lands his nsUTF8String implementation. 7489
nsWhitespaceTokenizer.h Checks if any more tokens are available. 3183
nsWindowsRegKey.cpp 14470
nsWindowsRegKey.h This ContractID may be used to instantiate a windows registry key object via the XPCOM component manager. 1671
Observer.h Observer<T> provides a way for a class to observe something. When an event has to be broadcasted to all Observer<T>, Notify() method is called. T represents the type of the object passed in argument to Notify(). @see ObserverList. 2087
PerfectHash.h Helper routines for Not to be used directly. 1674
PLDHashTable.cpp static 24978
PLDHashTable.h 27512
SimpleEnumerator.h A wrapper class around nsISimpleEnumerator to support ranged iteration. This requires every element in the enumeration to implement the same interface, T. If any element does not implement this interface, the enumeration ends at that element, and triggers an assertion in debug builds. Typical usage looks something like: for (auto& docShell : SimpleEnumerator<nsIDocShell>(docShellEnum)) { docShell.LoadURI(...); } 1962 100528
StickyTimeDuration.h A ValueCalculator class that performs additional checks before performing arithmetic operations such that if either operand is Forever (or the negative equivalent) the result remains Forever (or the negative equivalent as appropriate). Currently this only checks if either argument to each operation is Forever/-Forever. However, it is possible that, for example, aA + aB > INT64_MAX (or < INT64_MIN). We currently don't check for that case since we don't expect that to happen often except under test conditions in which case the wrapping behavior is probably acceptable. 8169
Tokenizer.cpp 19714
Tokenizer.h The analyzer works with elements in the input cut to a sequence of token where each token has an elementary type 18610
tools 2