parser/html/nsHtml5Atoms.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/parser/html/nsHtml5Atoms.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/*
    1.10 + * This class wraps up the creation (and destruction) of the standard
    1.11 + * set of atoms used by the HTML5 parser; the atoms are created when
    1.12 + * nsHtml5Module is loaded and they are destroyed when nsHtml5Module is
    1.13 + * unloaded.
    1.14 + */
    1.15 +
    1.16 +#include "nsHtml5Atoms.h"
    1.17 +#include "nsStaticAtom.h"
    1.18 +
    1.19 +using namespace mozilla;
    1.20 +
    1.21 +// define storage for all atoms
    1.22 +#define HTML5_ATOM(_name, _value) nsIAtom* nsHtml5Atoms::_name;
    1.23 +#include "nsHtml5AtomList.h"
    1.24 +#undef HTML5_ATOM
    1.25 +
    1.26 +#define HTML5_ATOM(name_, value_) NS_STATIC_ATOM_BUFFER(name_##_buffer, value_)
    1.27 +#include "nsHtml5AtomList.h"
    1.28 +#undef HTML5_ATOM
    1.29 +
    1.30 +static const nsStaticAtom Html5Atoms_info[] = {
    1.31 +#define HTML5_ATOM(name_, value_) NS_STATIC_ATOM(name_##_buffer, &nsHtml5Atoms::name_),
    1.32 +#include "nsHtml5AtomList.h"
    1.33 +#undef HTML5_ATOM
    1.34 +};
    1.35 +
    1.36 +void nsHtml5Atoms::AddRefAtoms()
    1.37 +{
    1.38 +  NS_RegisterStaticAtoms(Html5Atoms_info);
    1.39 +}

mercurial