Crashpad
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Loading...
Searching...
No Matches
crashpad::AnnotationList Class Reference

A list that contains all the currently set annotations. More...

#include "client/annotation_list.h"

Classes

class  IteratorBase
 An InputIterator for the AnnotationList. More...
 

Public Types

using Iterator = IteratorBase<Annotation>
 
using ConstIterator = IteratorBase<const Annotation>
 

Public Member Functions

 AnnotationList (const AnnotationList &)=delete
 
AnnotationListoperator= (const AnnotationList &)=delete
 
void Add (Annotation *annotation)
 Adds annotation to the global list. This method does not need to be called by clients directly. The Annotation object will do so automatically.
 
Iterator begin ()
 Returns an iterator to the first element of the annotation list.
 
ConstIterator begin () const
 
ConstIterator cbegin () const
 
Iterator end ()
 Returns an iterator past the last element of the annotation list.
 
ConstIterator end () const
 
ConstIterator cend () const
 

Static Public Member Functions

static AnnotationListGet ()
 Returns the instance of the list that has been registered on the CrashapdInfo structure.
 
static AnnotationListRegister ()
 Returns the instace of the list, creating and registering it if one is not already set on the CrashapdInfo structure.
 

Protected Member Functions

const Annotationtail_pointer () const
 Returns a pointer to the tail node.
 
const Annotationhead () const
 Returns a pointer to the head element.
 

Detailed Description

A list that contains all the currently set annotations.

An instance of this class must be registered on the CrashpadInfo structure in order to use the annotations system. Once a list object has been registered on the CrashpadInfo, a different instance should not be used instead.

Member Function Documentation

◆ Add()

void crashpad::AnnotationList::Add ( Annotation * annotation)

Adds annotation to the global list. This method does not need to be called by clients directly. The Annotation object will do so automatically.

Once an annotation is added to the list, it is not removed. This is because the AnnotationList avoids the use of locks/mutexes, in case it is being manipulated in a compromised context. Instead, an Annotation keeps track of when it has been cleared, which excludes it from a crash report. This design also avoids linear scans of the list when repeatedly setting and/or clearing the value.


The documentation for this class was generated from the following files: