Namespaces | Classes | Typedefs | Enumerations | Functions | Variables

mozilla Namespace Reference

This is the base class for all link classes. More...

Namespaces

namespace  browser
namespace  CheckedInt_internal
namespace  css
namespace  docshell
namespace  dom
namespace  gfx
namespace  gl
namespace  ipc
namespace  jetpack
namespace  jsipc
namespace  layers
namespace  layout
namespace  net
namespace  places
namespace  plugins
namespace  scache
namespace  services
namespace  sse_private
namespace  storage
namespace  threads

Classes

class  CheckedInt
 Integer wrapper class checking for integer overflow and other errors. More...
struct  cast_to_CheckedInt_impl
struct  cast_to_CheckedInt_impl< T, CheckedInt< T > >
class  FrameLayerBuilder
 The FrameLayerBuilder belongs to an nsDisplayListBuilder and is responsible for converting display lists into layer trees. More...
struct  FramePropertyDescriptor
 A pointer to a FramePropertyDescriptor serves as a unique property ID. More...
class  FramePropertyTable
 The FramePropertyTable is optimized for storing 0 or 1 properties on a given frame. More...
class  FrameProperties
 This class encapsulates the properties of a frame. More...
struct  AutoSwap_PRUint16
struct  AutoSwap_PRInt16
struct  AutoSwap_PRUint32
struct  AutoSwap_PRInt32
struct  AutoSwap_PRUint64
struct  AutoSwap_PRUint24
struct  SFNTHeader
struct  TableDirEntry
struct  HeadTable
struct  OS2Table
struct  PostTable
struct  HheaTable
struct  MaxpTableHeader
struct  KernTableVersion0
struct  KernTableSubtableHeaderVersion0
struct  KernTableVersion1
struct  KernTableSubtableHeaderVersion1
struct  void_t
struct  null_t
class  AutoRestore
 Save the current value of a variable and restore it when the object goes out of scope. More...
class  BlockingResourceBase
 BlockingResourceBase Base class of resources that might block clients trying to acquire them. More...
class  CondVar
 CondVar Vanilla condition variable. More...
class  URIAndPrincipalHashKey
class  CallStack
class  DeadlockDetector
 DeadlockDetector. More...
class  AutoFDClose
 AutoFDClose is a RAII wrapper for PRFileDesc. More...
struct  ScopedClose
 Instances close() their fds when they go out of scope. More...
class  FunctionTimerLog
class  FunctionTimer
class  GenericFactory
 A generic factory which uses a constructor function to create instances. More...
class  IHistory
struct  Module
 A module implements one or more XPCOM components. More...
class  ModuleLoader
 Module loaders are responsible for loading a component file. More...
class  GenericModule
class  Monitor
 Monitor Java-like monitor. More...
class  MonitorAutoEnter
 MonitorAutoEnter Enters the Monitor when it enters scope, and exits it when it leaves scope. More...
class  Mutex
 Mutex When possible, use MutexAutoLock/MutexAutoUnlock to lock/unlock this mutex within a scope, instead of calling Lock/Unlock directly. More...
class  MutexAutoLock
 MutexAutoLock Acquires the Mutex when it enters scope, and releases it when it leaves scope. More...
class  MutexAutoUnlock
 MutexAutoUnlock Releases the Mutex when it enters scope, and re-acquires it when it leaves scope. More...
class  PaintTracker
class  PluginLibrary
class  PluginPRLibrary
class  TimeDuration
 Instances of this class represent the length of an interval of time. More...
class  TimeStamp
 Instances of this class represent moments in time, or a special "null" moment. More...
struct  unused_t
struct  ScopedXFree
 Invoke XFree() on a pointer to memory allocated by Xlib (if the pointer is nonnull) when this class goes out of scope. More...
class  ScopedXErrorHandler
 On construction, set a graceful X error handler that doesn't crash the application and records X errors. More...
struct  AlignmentTestStruct
class  MonitorAutoExit
 MonitorAutoExit Exit the Monitor when it enters scope, and enters it when it leaves scope. More...

Typedefs

typedef CheckedInt< PRInt8 > CheckedInt8
typedef CheckedInt< PRUint8 > CheckedUint8
typedef CheckedInt< PRInt16 > CheckedInt16
typedef CheckedInt< PRUint16 > CheckedUint16
typedef CheckedInt< PRInt32 > CheckedInt32
typedef CheckedInt< PRUint32 > CheckedUint32
typedef CheckedInt< PRInt64CheckedInt64
typedef CheckedInt< PRUint64CheckedUint64
typedef void(* FramePropertyDestructor )(void *aPropertyValue)
typedef void(* FramePropertyDestructorWithFrame )(nsIFrame *aFrame, void *aPropertyValue)
typedef gfxPattern::GraphicsFilter GraphicsFilterType
typedef gfxASurface::gfxSurfaceType gfxSurfaceType
typedef LayerManager::LayersBackend LayersBackend

Enumerations

enum  LayerState { LAYER_NONE, LAYER_INACTIVE, LAYER_ACTIVE }

Functions

template<typename T >
CheckedInt< T > operator+ (const CheckedInt< T > &lhs, const CheckedInt< T > &rhs)
template<typename T >
CheckedInt< T > operator- (const CheckedInt< T > &lhs, const CheckedInt< T > &rhs)
template<typename T >
CheckedInt< T > operator* (const CheckedInt< T > &lhs, const CheckedInt< T > &rhs)
template<typename T >
CheckedInt< T > operator/ (const CheckedInt< T > &lhs, const CheckedInt< T > &rhs)
template<typename T , typename U >
cast_to_CheckedInt_impl< T, U >
::return_type 
cast_to_CheckedInt (U u)
template<typename T , typename U >
CheckedInt< T > operator+ (const CheckedInt< T > &lhs, U rhs)
template<typename T , typename U >
CheckedInt< T > operator+ (U lhs, const CheckedInt< T > &rhs)
template<typename T , typename U >
CheckedInt< T > operator* (const CheckedInt< T > &lhs, U rhs)
template<typename T , typename U >
CheckedInt< T > operator* (U lhs, const CheckedInt< T > &rhs)
template<typename T , typename U >
CheckedInt< T > operator- (const CheckedInt< T > &lhs, U rhs)
template<typename T , typename U >
CheckedInt< T > operator- (U lhs, const CheckedInt< T > &rhs)
template<typename T , typename U >
CheckedInt< T > operator/ (const CheckedInt< T > &lhs, U rhs)
template<typename T , typename U >
CheckedInt< T > operator/ (U lhs, const CheckedInt< T > &rhs)
template<typename T , typename U >
PRBool operator== (const CheckedInt< T > &lhs, U rhs)
template<typename T , typename U >
PRBool operator== (U lhs, const CheckedInt< T > &rhs)
PRUint32 FindHighestBit (PRUint32 value)
NS_COM_GLUE bool fallocate (PRFileDesc *aFD, PRInt64 aLength)
 Fallocate efficiently and continuously allocates files via fallocate-type APIs.
void NoteIntentionalCrash (const char *processType)
bool supports_mmx ()
bool supports_sse ()
bool supports_sse2 ()
bool supports_sse3 ()
bool supports_ssse3 ()
bool supports_sse4a ()
bool supports_sse4_1 ()
bool supports_sse4_2 ()
template<typename T >
void operator<< (const unused_t &, const T &)
Display * DefaultXDisplay ()
 Return the default X Display created and used by the UI toolkit.

Variables

const unused_t unused

Detailed Description

This is the base class for all link classes.

A macro, NS_ALIGNMENT_OF(t_) that determines the alignment requirements of a type.

Note: This file is included by Variant.h.

This class is used by the storage module whenever an nsIVariant needs to be returned.

The public interface of this header consists of a set of macros and functions for Intel CPU features.

The StartupCache is a persistent cache of simple key-value pairs, where the keys are null-terminated c-strings and the values are arbitrary data, passed as a (char*, size) tuple.

|Shmem| is one agent in the IPDL shared memory scheme.

The way it works is essentially

(1) C++ code calls, say, |parentActor->AllocShmem(size)|

(2) IPDL-generated code creates a |mozillaipc::SharedMemory| wrapping the bare OS shmem primitives. The code then adds the new SharedMemory to the set of shmem segments being managed by IPDL.

(3) IPDL-generated code "shares" the new SharedMemory to the child process, and then sends a special asynchronous IPC message to the child notifying it of the creation of the segment. (What this means is OS specific.)

(4a) The child receives the special IPC message, and using the |SharedMemory{SysV,Basic}Handle| it was passed, creates a |mozillaipc::SharedMemory| in the child process.

(4b) After sending the "shmem-created" IPC message, IPDL-generated code in the parent returns a |mozillaipc::Shmem| back to the C++ caller of |parentActor->AllocShmem()|. The |Shmem| is a "weak reference" to the underlying |SharedMemory|, which is managed by IPDL-generated code. C++ consumers of |Shmem| can't get at the underlying |SharedMemory|.

If parent code wants to give access rights to the Shmem to the child, it does so by sending its |Shmem| to the child, in an IPDL message. The parent's |Shmem| then "dies", i.e. becomes inaccessible. This process could be compared to passing a "shmem-access baton" between parent and child.

Clients should use the GetSingleton() static method to access the cache. It will be available from the end of XPCOM init (NS_InitXPCOM3 in nsXPComInit.cpp), until XPCOM shutdown begins. The GetSingleton() method will return null if the cache is unavailable. The cache is only provided for libxul builds -- it will fail to link in non-libxul builds. The XPCOM interface is provided only to allow compiled-code tests; clients should avoid using it.

The API provided is very simple: GetBuffer() returns a buffer that was previously stored in the cache (if any), and PutBuffer() inserts a buffer into the cache. GetBuffer returns a new buffer, and the caller must take ownership of it. PutBuffer will assert if the client attempts to insert a buffer with the same name as an existing entry. The cache makes a copy of the passed-in buffer, so client retains ownership.

InvalidateCache() may be called if a client suspects data corruption or wishes to invalidate for any other reason. This will remove all existing cache data. Finally, getDebugObjectOutputStream() allows debug code to wrap an objectstream with a debug objectstream, to check for multiply-referenced objects. These will generally fail to deserialize correctly, unless they are stateless singletons or the client maintains their own object data map for deserialization.

Writes before the final-ui-startup notification are placed in an intermediate cache in memory, then written out to disk at a later time, to get writes off the startup path. In any case, clients should not rely on being able to GetBuffer() data that is written to the cache, since it may not have been written to disk or another client may have invalidated the cache. In other words, it should be used as a cache only, and not a reliable persistent store.

Some utility functions are provided in StartupCacheUtils. These functions wrap the buffers into object streams, which may be useful for serializing objects. Note the above caution about multiply-referenced objects, though -- the streams are just as 'dumb' as the underlying buffers about multiply-referenced objects. They just provide some convenience in writing out data.

DETECTING ISA EXTENSIONS ========================

This header provides the following functions for determining whether the current CPU supports a particular instruction set extension:

mozilla::supports_mmx mozilla::supports_sse mozilla::supports_sse2 mozilla::supports_sse3 mozilla::supports_ssse3 mozilla::supports_sse4a mozilla::supports_sse4_1 mozilla::supports_sse4_2

If you're writing code using inline assembly, you should guard it with a call to one of these functions. For instance:

if (mozilla::supports_sse2()) { asm(" ... "); } else { ... }

Note that these functions depend on cpuid intrinsics only available in gcc 4.3 or later and MSVC 8.0 (Visual C++ 2005) or later, so they return false in older compilers. (This could be fixed by replacing the code with inline assembly.)

USING INTRINSICS ================

This header also provides support for coding using CPU intrinsics.

For each mozilla::supports_abc function, we define a MOZILLA_MAY_SUPPORT_ABC macro which indicates that the target/compiler combination we're using is compatible with the ABC extension. For instance, x86_64 with MSVC 2003 is compatible with SSE2 but not SSE3, since although there exist x86_64 CPUs with SSE3 support, MSVC 2003 only supports through SSE2.

Until gcc fixes pragma target [1] [2] or our x86 builds require SSE2, you'll need to separate code using intrinsics into a file separate from your regular code. Here's the recommended pattern:

ifdef MOZILLA_MAY_SUPPORT_ABC namespace mozilla { namespace ABC { void foo(); } } endif

void foo() { ifdef MOZILLA_MAY_SUPPORT_ABC if (mozilla::supports_abc()) { mozilla::ABC::foo(); // in a separate file return; } endif

foo_unvectorized(); }

You'll need to define mozilla::ABC::foo() in a separate file and add the -mabc flag when using gcc.

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39787 and [2] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41201 being fixed.

We provide traits for the basic sqlite types to make use easier. The following types map to the indicated sqlite type: PRInt64 -> INTEGER (use IntegerVariant) double -> FLOAT (use FloatVariant) nsString -> TEXT (use TextVariant) nsCString -> TEXT (use UTF8TextVariant) PRUint8[] -> BLOB (use BlobVariant) nsnull -> NULL (use NullVariant)


Typedef Documentation

typedef CheckedInt<PRInt16 > mozilla::CheckedInt16
typedef CheckedInt<PRInt32 > mozilla::CheckedInt32
typedef CheckedInt<PRInt8 > mozilla::CheckedInt8
typedef CheckedInt<PRUint16 > mozilla::CheckedUint16
typedef CheckedInt<PRUint32 > mozilla::CheckedUint32
typedef CheckedInt<PRUint8 > mozilla::CheckedUint8
typedef void(* mozilla::FramePropertyDestructor)(void *aPropertyValue)
typedef void(* mozilla::FramePropertyDestructorWithFrame)(nsIFrame *aFrame, void *aPropertyValue)
typedef LayerManager::LayersBackend mozilla::LayersBackend

Enumeration Type Documentation

Enumerator:
LAYER_NONE 
LAYER_INACTIVE 
LAYER_ACTIVE 

Function Documentation

template<typename T , typename U >
cast_to_CheckedInt_impl<T, U>::return_type mozilla::cast_to_CheckedInt ( u  )  [inline]
Display* mozilla::DefaultXDisplay (  )  [inline]

Return the default X Display created and used by the UI toolkit.

NS_COM_GLUE bool mozilla::fallocate ( PRFileDesc aFD,
PRInt64  aLength 
)

Fallocate efficiently and continuously allocates files via fallocate-type APIs.

This is useful for avoiding fragmentation. On sucess the file be padded with zeros to grow to aLength.

Parameters:
aFD file descriptor.
aLength length of file to grow to.
Returns:
true on success.
PRUint32 mozilla::FindHighestBit ( PRUint32  value  )  [inline]
void mozilla::NoteIntentionalCrash ( const char *  processType  )  [inline]
template<typename T >
CheckedInt<T> mozilla::operator* ( const CheckedInt< T > &  lhs,
const CheckedInt< T > &  rhs 
) [inline]
template<typename T , typename U >
CheckedInt<T> mozilla::operator* ( const CheckedInt< T > &  lhs,
rhs 
) [inline]
template<typename T , typename U >
CheckedInt<T> mozilla::operator* ( lhs,
const CheckedInt< T > &  rhs 
) [inline]
template<typename T , typename U >
CheckedInt<T> mozilla::operator+ ( const CheckedInt< T > &  lhs,
rhs 
) [inline]
template<typename T >
CheckedInt<T> mozilla::operator+ ( const CheckedInt< T > &  lhs,
const CheckedInt< T > &  rhs 
) [inline]
template<typename T , typename U >
CheckedInt<T> mozilla::operator+ ( lhs,
const CheckedInt< T > &  rhs 
) [inline]
template<typename T >
CheckedInt<T> mozilla::operator- ( const CheckedInt< T > &  lhs,
const CheckedInt< T > &  rhs 
) [inline]
template<typename T , typename U >
CheckedInt<T> mozilla::operator- ( const CheckedInt< T > &  lhs,
rhs 
) [inline]
template<typename T , typename U >
CheckedInt<T> mozilla::operator- ( lhs,
const CheckedInt< T > &  rhs 
) [inline]
template<typename T >
CheckedInt<T> mozilla::operator/ ( const CheckedInt< T > &  lhs,
const CheckedInt< T > &  rhs 
) [inline]
template<typename T , typename U >
CheckedInt<T> mozilla::operator/ ( const CheckedInt< T > &  lhs,
rhs 
) [inline]
template<typename T , typename U >
CheckedInt<T> mozilla::operator/ ( lhs,
const CheckedInt< T > &  rhs 
) [inline]
template<typename T >
void mozilla::operator<< ( const unused_t &  ,
const T &   
) [inline]
template<typename T , typename U >
PRBool mozilla::operator== ( const CheckedInt< T > &  lhs,
rhs 
) [inline]
template<typename T , typename U >
PRBool mozilla::operator== ( lhs,
const CheckedInt< T > &  rhs 
) [inline]
bool mozilla::supports_mmx (  )  [inline]
bool mozilla::supports_sse (  )  [inline]
bool mozilla::supports_sse2 (  )  [inline]
bool mozilla::supports_sse3 (  )  [inline]
bool mozilla::supports_sse4_1 (  )  [inline]
bool mozilla::supports_sse4_2 (  )  [inline]
bool mozilla::supports_sse4a (  )  [inline]
bool mozilla::supports_ssse3 (  )  [inline]

Variable Documentation